Arduino Car Controlled Via Bluetooth App

5,471

68

24

All we know that Arduino is an excellent prototyping platform, principally because it uses a friendly programming language and there are a lot of extra incredible components that provide us great experiences.

We can integrate the Arduino with differents shields or modules and build fantastic things. In this project i will show you how use the Bluetooth module to control a robot platform through commands coming from a smartphone.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Parts

Hardware:

  • 1x Arduino Uno
  • 1x Motor Shield L293D Driver
  • 1x Bluetooth Module
  • 1x Robot platform
  • 4x Dupont Wire for Bluetooth Module (Male to Female)
  • 4x Dupont Wire for motors (Male to Male)
  • 2x motors + 2x Wheels
  • 1x Caster Wheel

Software:

  • Arduino IDE
  • A to B USB Cable
  • Bluetooth RC Controller (you can download this app here)

Step 2: Assembling the Arduino Car

The mounting of the robotic platform is very easy. If you buy one like that, you will receive a manual with all steps.

Firstly mount the 2 motor onto the robot platform.

Secondly mount the caster wheel onto the robot platform.

Thirdly mount the Arduino Uno onto the robot platform and place the motor shield onto the Arduino Uno.

Fourthly connect the left and the right motor's wire indicated in the picture. (Note: Red Wire is + & Black Wire is -)

Fifthly connect the Bluetooth Module:

  • RXD to TXD on Arduino Uno
  • TXD to RXD on Arduino Uno
  • VCC to 5V on Arduino Uno
  • GND to GND on Arduino Uno

Step 3: Software

The Arduino uno is very easy to program.

- To control the motors, I used the library AFMotor.h included above.

- The communication between the smartphone and the Bluetooth module was done using the serial communication arduino.

- The app "Bluetooth RC Controller" send to the bluetooth module the following commands:

  • Forward -> F
  • Back -> B
  • Left -> L
  • Right -> R
  • Forward Left -> G
  • Forward Right -> I
  • Back Left -> H
  • Back Right -> J
  • Stop -> S
  • Front Lights On -> W
  • Front Lights Off -> w
  • Back Lights On -> U
  • Back Lights Off -> u
  • Horn On -> V
  • Horn Off -> v
  • Extra On -> X
  • Extra Off -> x
  • Speed 0 -> 0
  • Speed 10 -> 1
  • Speed 20 -> 2
  • Speed 30 -> 3
  • Speed 90 -> 9
  • Speed 100 -> q
  • Stop All -> D

In this project I have programmed 2 commands:

1.Basic (Forward, Back, Left and Right)

2.Full Command (Forward, Back, Left and Right) and also (Forward Left, 1.Forward Right, Back Left, Back Right)

The entire code is available for you to download.

Step 4: Don't Forget to Share, Like and Vote!!!

Homemade Gifts Contest 2016

Participated in the
Homemade Gifts Contest 2016

Arduino Contest 2016

Participated in the
Arduino Contest 2016

Epilog Contest 8

Participated in the
Epilog Contest 8

Be the First to Share

    Recommendations

    • Assistive Tech Contest

      Assistive Tech Contest
    • Reuse Contest

      Reuse Contest
    • Made with Math Contest

      Made with Math Contest

    24 Discussions

    0
    None
    supniz

    2 years ago

    Hi, I am getting a lot of error messages when I try to compile the code, and I couldn't figure out how to fix them. Could you please help me? Here are the error messages

    c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to `main'

    C:\Users\me\AppData\Local\Temp\ccrNvWHT.ltrans0.ltrans.o: In function `latch_tx':

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:57: undefined reference to `digitalWrite'

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:60: undefined reference to `digitalWrite'

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:64: undefined reference to `digitalWrite'

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:71: undefined reference to `digitalWrite'

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:74: undefined reference to `digitalWrite'

    C:\Users\me\AppData\Local\Temp\ccrNvWHT.ltrans0.ltrans.o:C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:77: more undefined references to `digitalWrite' follow

    C:\Users\me\AppData\Local\Temp\ccrNvWHT.ltrans0.ltrans.o: In function `enable':

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:39: undefined reference to `pinMode'

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:40: undefined reference to `pinMode'

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:41: undefined reference to `pinMode'

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:42: undefined reference to `pinMode'

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:49: undefined reference to `digitalWrite'

    C:\Users\me\AppData\Local\Temp\ccrNvWHT.ltrans0.ltrans.o: In function `initPWM3(unsigned char) [clone .isra.0]':

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:261: undefined reference to `pinMode'

    C:\Users\me\AppData\Local\Temp\ccrNvWHT.ltrans0.ltrans.o: In function `initPWM4(unsigned char) [clone .isra.1]':

    C:\Users\me\Documents\Arduino\libraries\adafruit-Adafruit-Motor-Shield-library-99381df/AFMotor.cpp:316: undefined reference to `pinMode'

    collect2.exe: error: ld returned 1 exit status

    1 reply
    0
    None
    SlkStephanesupniz

    Reply 1 year ago

    Hi there,
    i have been off for the past 2 years I’ll rebuild one and let you know.

    0
    None
    SlkStephanehprkkarunarathna

    Answer 1 year ago

    You can simply connect the light to the ground and 5v from the board. I have been off for the past 2 years. I’ll rebuild one ASAP and provide you a code.

    0
    None
    SlkStephanestanglj

    Answer 1 year ago

    It’s an an for Androids only. It’s called Bluetooth RC Controller.

    0
    None
    aadityaaher

    1 year ago

    Hey. Can u please tell how u inserted battery level indicator???

    1 reply
    0
    None
    SlkStephaneaadityaaher

    Reply 1 year ago

    I have connected the battery level indicator onto the battery input on the shield.

    0
    None
    Raj wadia

    2 years ago

    how can i connect txd and rxd on arduino when i have a shield on it where to insert the wire coming from txd and rxd on bt module

    temp_384839400.jpg
    2 replies
    0
    None
    SlkStephaneRaj wadia

    Reply 1 year ago

    You can solder two wires right onto the shield. What I have done is inserted 2 wires with the shield pins together.

    0
    None
    SlkStephaneRaj wadia

    Reply 2 years ago

    What I did is I put


    • RXD cable to TXD on Arduino Uno
    • TXD cable to RXD on Arduino Uno
    then I inserted the shield on top of the cable
    0
    None
    SlkStephaneRaj wadia

    Reply 1 year ago

    Sorry for the late reply. No sorry I don’t. I will get some when I build one back.

    0
    None
    supniz

    2 years ago

    Could you please post some pictures without the cardboard cover ...

    1 reply
    0
    None
    bribin

    2 years ago

    Should be a typo with two 'forwardleft'.

    case 'G':
    forwardleft();
    break;
    case 'I':
    forwardleft();
    break;

    1 reply
    0
    None
    SlkStephanebribin

    Reply 2 years ago

    Yes, your correct I will correct this soon.

    Here's the correct one

    case 'G':
    forwardleft();
    break;
    case 'I':
    forwardright();
    break;