Arduino Car Controlled Via Bluetooth App

4,242

69

18

Introduction: Arduino Car Controlled Via Bluetooth App

About: Just an ordinary teen who likes to work with Arduino and other programming electronics and 3D Printers

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!!!

Share

    Recommendations

    • Metalworking Contest

      Metalworking Contest
    • Water Contest

      Water Contest
    • Creative Misuse Contest

      Creative Misuse Contest

    18 Discussions

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


    • Bluetooth RC Controller app did you use?

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

    0
    None
    supniz

    1 year 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
    None
    supniz

    1 year ago

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

    1 reply
    0
    None
    bribin

    1 year ago

    Should be a typo with two 'forwardleft'.

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

    1 reply

    Yes, your correct I will correct this soon.

    Here's the correct one

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

    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!

    1 reply

    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

    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
    1 reply

    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

    Voted. Lithium instead of lead acid would be much better for runtime. Great job.

    1 reply

    Thanks, I had lead acid when I was doing this but now running on LiPo. Lol