Measure Temperature using the Thermistor

You require the Bluetooth Starter Kit to complete these exercises. There are 2 exercises. First you will connect up the Bluetooth Starter Kit and thermistor and run the Thermometer app. Second you will use Intent to communicate between the App Inventor program and the Thermometer app

I) Connect the Bluetooth Starter Kit and thermistor and Run the Thermometer App

  1. Connect the thermistor to the Light Application Adaptor if it has not yet been done
    • Connect the thermistor to the Light Application Adaptor screw terminals labeled IDAC and AGND
    • Connect a wire from IDAC to AIN3
    • Connect a wire from AGND to AIN2
  2. Connect up the Bluetooth Starter Kit and power up the circuit by putting in batteries to the battery holder. Note the Mac Address.
  3. Bluetooth Starter Kit
  4. On your smartphone goto Settings->Applications and enable Unknown sources. Download and install the Thermometer App Temperature.apk to your Android smartphone.
  5. When the Thermometer App runs
    • Turn on Bluetooth if it is off
    • Click the Get Address button if you are running it the first time. If the mac address of your bluetooth DAQ module is not displayed, click the Scan for devices button. If this is the first time your phone is connecting to this particular device, you will need to select your device and pair with it using the pin code 1234
    • Click on the Start checkbox to start temperature measurements. You will see the measured temperature displayed. Uncheck to stop.
    • Click on either the Red or Green radio button to turn on the respective LED on the Light Application Adaptor

For more information, see Using thermistor and DAQ to measure temperature

II) Using Intent to connect the Thermometer App to the App Inventor Program

Download intent.zip to your computer and then upload to your App Inventor account

Designer

4 components are used

  1. Basic->TextBox
  2. Basic->Label
  3. Basic->Button
  4. Other stuff->ActivityStarter (This is a non visible component, that is it will not appear on the screen)

Block Editor

The following blocks are used

  1. My Blocks->Button1->Button1.Click
  2. My Blocks->TextBox1->TextBox1.Text
  3. My Blocks->Label1->Label1.Text
  4. My Blocks->ActivityStarter1->ActivityStarter1.Action << Built-In->Text->text string com.emant.temperature.START
  5. My Blocks->ActivityStarter1->ActivityStarter1.ActivityClass << Built-In->Text->text string com.emant.temperature.TempIntent
  6. My Blocks->ActivityStarter1->ActivityStarter1.ActivityPackage << Built-In->Text->text string com.emant.temperature
  7. My Blocks->ActivityStarter1->ActivityStarter1.ExtraKey << Built-In->Text->text string LED
  8. My Blocks->ActivityStarter1->ActivityStarter1.ExtraKey
    If the text value assigned is red (not case sensitive), the RED LED will light up. Any other value will light up the GREEN LED
  9. My Blocks->ActivityStarter1->ActivityStarter1.ResultName << Built-In->Text->text string TEMP
  10. My Blocks->ActivityStarter1->ActivityStarter1.StartActivity
  11. My Blocks->ActivityStarter1->ActivityStarter1.AfterActivity
  12. My Blocks->ActivityStarter1->ActivityStarter1.Result
    The measured temperature from the Thermometer App is returned

Activity parameters are defined by the Thermometer App. When the result is available from the started activity, an ActivityStarter1.AfterActivity event is activated. What is returned is also defined by the Thermometer App.