Shop OBEX P1 Docs P2 Docs Learn Events
Android and RN-42 BlueTooth module — Parallax Forums

Android and RN-42 BlueTooth module

NikosGNikosG Posts: 705
edited 2018-04-15 10:24 in Customer Projects
Hi,
Here is a quick description of LEDs and lamp control with Android mobile phone using Parallax RN 42 BlueTooth module and Board of Education Shield
Google Play free App: Arduino BlueTooth control

Here is the circuit:
Arduino_Uno_Bluetooth_Parallax_STUDENTS.jpg
A video demo:
[video]

Comments

  • NikosGNikosG Posts: 705
    edited 2018-04-16 19:03
    Some more details and Help:

    After you make the circuit from the previous post) you must load to your Arduino the next code: (I have also attached the code)
    Arduino_led_code.jpg

    Then go to your mobile phone and istall the Google Play free App: Arduino BlueTooth control
    and make the next steps:
    Arduino_App_all.jpg
    1) after the istallation into your phone, "run" the application
    2) choose the RN-42 BlueTooth and pair both devices
    3) Connect in controller mode
    4 & 5) Setup the keys as shown (Write the characters )
    6) You are ready to Play


    The setup of arrow keys is in order to make an RC robot (I explain in next post)


    As you can see the characters that I wrote on my phone App (step5) are connected to the characters that exist on my Arduino code:

    "r" for the red LED (The "sr" character has an "s" before "r" that says to the controller to switch off all the LEDs before switch on the red LED)
    "g" for the green LED (the "sg" characte has an "s" before "g" that says to the controller to switch off all the LEDs before switch on the green LED)
    "y" for the yellow LED (The "sy" character has an "s" before "y" that says to the controller to switch off all the LEDs before switch on the yellow LED)
    "s"in order to switch off all the LEDs


    The characters on (step 4) are for the RC- robot.....
    "l" left movement
    "r" right
    "f" forward
    "b" backward
    "s" stop

    Of course you can change the characters but remember to make it on both (adruino code and mobile App)


    732 x 770 - 99K
    1274 x 1245 - 612K
  • NikosGNikosG Posts: 705
    edited 2018-04-16 18:03
    For those who want to control (Switch on/off) a home device (e.g a lamp) with Bluetooth, a relay board is necessary.
    Build carefully the following circuit because we have high current voltage:
    Arduino_Uno_Bluetooth_Parallax_lamp.jpg
    With the yellow led you also be able to switch on/off the lamp!

    You can also add devices and relays to the other two LEds and play with them....
  • FYI: I primarily use B4A (Basic 4 Android) to control external devices but the following are also useful and very easy to use.

    1) RFOBasic: This is an open source interpreter but can still produce a apk.
    2) OliBasic: A derivative of RFOBasic but with enhanced features/capabilities
    3) Mintoris: This BASIC features USB-serial comms, specifically for communications with microcontrollers.
  • JonnyMacJonnyMac Posts: 8,918
    edited 2018-04-21 14:07
    FYI: I primarily use B4A (Basic 4 Android) to control external devices but the following are also useful and very easy to use.
    Are you happy with it? I'm considering as I have a project where a customer wants to start with a simple Android app, and later have the same thing run on iOS. The B4X family seems to suggest that's possible.
  • Oh absolutely thrilled with the B4X family.

    Try the demo, it will put a big ol' smile on your face.
Sign In or Register to comment.