Tab Content
Tab Title
Instructions
Tab Content
  1. Before testing the app, connect the Android device to the Bluetooth module. On most Android devices swipe down from the top of the screen and press and hold the Bluetooth symbol. Scan for devices and connect to the desired Bluetooth device. If it asks for a password, enter 1234.
  2. Re-open the web browser and make sure you are in App Inventor with your Bluetooth App open, then click connect at the top of the computer screen and select AI Companion.
  3. Notice the QR code and the 6-letter code that appear on the screen.
  4. Open the AI Companion app on the mobile device.
  5. Type in the six-character code and press “connect with code” or press “scan QR code” to scan the code from the computer screen. Make sure both the computer and the Android device are connected to the same Wi-Fi network.
  6. Once the app is open on the device, click “Step 1: Select Bluetooth Device” and select the Bluetooth module that is connected to your Arduino. If the above device is not listed here, repeat step 1. Once the device is selected, you should see the name of that device where the words “Bluetooth Name” used to be.
  7. Once the correct device is selected, press “Step 2: Connect to Bluetooth Device”. When the device is connected, you should get a notification that says “connected” and the name of the Bluetooth module should turn green.
  8. When the connection is made, test your app by pressing the buttons that control the LED and Servo.
Tab Title
Implementation
Tab Content

If you are using this activity with a group of students, we highly recommend labeling the Bluetooth modules prior to beginning. At the Thinkabit Lab, we re-named all the modules to be easily located within the list of nearby devices for all students, since they will be completing these steps at the same time.  Download instructions on how to read and change the name of the Bluetooth module here.  Alternatively, you could connect each Bluetooth device one at a time, connect it to learn its name, and then label it for future use.

Tab Title
Troubleshooting
Tab Content
  1. Mobile device won’t connect to App Inventor
  • Make sure that the device is connected to Wi-Fi to use the AI2 Companion app.
  • Make sure that the six-character code is entered correctly and “connect with code” has been pressed or that the QR code has been scanned.
  • Make sure both the computer and the Android device are connected to the same Wi-Fi network.
  • Sometimes it takes time for the mobile device to connect. Wait a few minutes before doing any corrective measures.
  • The program might be frozen. Close the program completely and restart again. The connection on the computer might need to be reset as well by going to Connect and clicking “Reset Connection”.

 

  1. Mobile device won’t connect to Bluetooth module
  • Make sure that the Arduino is connected to power and the Bluetooth module is properly connected to the Arduino.
  • Make sure that you are attempting to connect to the correct Bluetooth module.
  • Press the reset button on the Arduino.
  • Press the reset button on the Bluetooth module.
  • Disconnect the Bluetooth module from the jumper wires and reconnect again.

 

  1. Pressing the buttons and nothing is happening
  • Check for errors systematically, like an engineer.
    • Make sure the Android device is connected to the Bluetooth module.
    • Check the App Inventor blocks to make sure that each button is programmed to send information over Bluetooth.
    • Check the Arduino code to make sure that each letter received over Bluetooth triggers an action on the LED or Servo.
    • Check that all wires have been properly connected, students often flip-flop the placement of the wires for TXD and RXD.
    • Re-check the Arduino code to make sure that all lines of code are properly written, repeat earlier steps as necessary.
  • Press the reset button on the Arduino.
  • Upload the code to the Arduino again (remember to disconnect the wires from pins 0 and 1 before uploading and only to reconnect the wires once the code is done uploading).
Instruction Category
Video