Arduino Car Controlled Via Bluetooth App

5,819

69

22

Introduction: Arduino Car Controlled Via Bluetooth App

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.

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

    • Microcontroller Contest

      Microcontroller Contest
    • Automation Contest

      Automation Contest
    • Make it Glow Contest

      Make it Glow Contest

    22 Comments

    0
    supniz
    supniz

    3 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

    0
    SlkStephane
    SlkStephane

    Reply 2 years ago

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

    0
    hprkkarunarathna
    hprkkarunarathna

    Question 2 years ago

    how to add front lights & back lights to this code.

    0
    SlkStephane
    SlkStephane

    Answer 2 years 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
    stanglj
    stanglj

    Question 2 years ago on Step 1


    • Bluetooth RC Controller app did you use?
    0
    SlkStephane
    SlkStephane

    Answer 2 years ago

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

    0
    aadityaaher
    aadityaaher

    3 years ago

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

    0
    SlkStephane
    SlkStephane

    Reply 2 years ago

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

    0
    Raj wadia
    Raj wadia

    4 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
    0
    SlkStephane
    SlkStephane

    Reply 2 years ago

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

    0
    SlkStephane
    SlkStephane

    Reply 4 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
    Raj wadia
    Raj wadia

    4 years ago

    Do you have any video worki g of your car.
    voted

    0
    SlkStephane
    SlkStephane

    Reply 2 years ago

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

    0
    SlkStephane
    SlkStephane

    Reply 4 years ago

    I will upload a video in a day.

    Thanks

    0
    Raj wadia
    Raj wadia

    4 years ago

    how to insert leds to car and code for it.

    0
    SlkStephane
    SlkStephane

    Reply 4 years ago

    I will think about that and come up with a code.

    0
    supniz
    supniz

    4 years ago

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

    0
    SlkStephane
    SlkStephane

    Reply 4 years ago

    Yes I will soon

    0
    hennessyc
    hennessyc

    4 years ago

    I'm new to all this and would like to try it with my son. Where is the best website/place to get parts? Thank you!

    0
    SlkStephane
    SlkStephane

    Reply 4 years ago

    You can buy these parts for cheap from Banggood but delivery time will be longer. I buy from this website as saves money but eBay would be great too