Dhruva's Bluetooth Robot

Table of Contents

Fork me on GitHub

1 Introduction

Parts and Tools required

  • 4 High torque DC motors (aka Gear Motors)
  • Motor wheels
  • Motor Driver
  • Arduino UNO or Nano (with USB)
  • Bluetooth Module (HC-06 preferable)
  • Small rectangular piece of Plywood (2 the same size)(~15cm)
  • Hot Glue Gun
  • PP3 Battery Snap
  • 9V PP3 Battery
  • Drill (with a 3mm dill bit)
  • Power bank (3000mAh is sufficient)
  • Soldering Iron
  • Wire cutters/strippers
  • Small Screwdriver
  • Male to male jumper cables
  • Female to male jumper cables
  • Red and black wires (general)
  • M3 screws and nuts
  • And finally a phone to control your masterpiece.

Build

  1. Get the wire stripper and strip the ends of the wires (small wires like ~4cm) do this to 4 wires of the equivalent length and then strip 4 (8cm) wires.
  2. Then using the soldering iron solder the 4cm wires oppositely to the motors and then solder and 2 of the 8cm wires to one motor.
  3. Do step 2 to the other pair and then hot glue them to opposite ends of the rectangular piece of wood afterwards hot glue the other on top of the motors so that the motors are sandwiched to the rectangular board.
  4. Then take your Arduino UNO and make dots where the holes are, do the same with the motor driver and then drill those holes and put m3 screws on then with the UNO and motor driver on and put nuts on them.
  5. Make 2 more holes on the middle right and left of the board and the 4 (8cm) wires through those holes (therefore 2 for 1 hole and 2 for the other).
  6. Get the screw driver and loosen all the screws on the motor driver.
  7. Put the 8cm wires into the holes on the sides of the motor driver and screw them down as tight as you can.
  8. Hot glue the PP3 battery snap and the Bluetooth module to the rectangular piece of wood.

Motor_wiring.jpg

Connecting Wires

  • Bluetooth Module to the UNO:
  • Using male to female jumper wires to:
  • Connect the VCC of the Bluetooth module to the 5V on the UNO.
  • Connect the GND to GND next to the 5V on the UNO.
  • Connect the TX on the Bluetooth module to the RX on the UNO.
  • Connect the RX on the Bluetooth module to the TX on the UNO.
  • Motor Driver to the UNO:
  • Use 4 male to female jumper wires to:
  • Connect the IN1 on the Motor Driver to Digital 10.
  • Connect the IN2 on the Motor Driver to Digital 11.
  • Connect the IN3 on the Motor Driver to Digital 12.
  • Connect the IN4 on the Motor Driver to Digital 13.
  • UNO to the Motor Driver:
  • Using Male to Male jumper cables:
  • Connect the VIN of the UNO to the connector next to where the jumper cables are.
  • Connect the GND to the middle connector with the black wire on the P3 Battery Snap and screw them up
  • PP3 Battery Snap to the Motor Driver:
  • Connect the Red wire on the PP3 battery snap to the last open connector and screw it up.
  • Now it is time to put on the wheels.

Code It

  • Download the free Arduino app on the Arduino website onto your computer/PC and copy the code and paste the code on the Arduino app then connect the USB given with the UNO and connect one to the UNO and the other to the computer.
  • Go to tools and on boards select Arduino/Genuino UNO and select the appropriate port as well which the UNO is connected to.
  • Then Press the upload button and after it has said “Done Uploading” take the USB out and connect it to your power bank and put it in the sandwiched part of your base, if it doesn’t fit then just put it on top.
  • Now connect the 9V battery.
  • You need to download the RC Bluetooth Control Car on your phone.
  • Then turn on your Bluetooth and press the settings icon, connect to car and select HC-06 or whatever Bluetooth module you have is called and if the light on the left goes from red to green that means it is connected and you can use the buttons now to control your car.
  • You will need to disconnect the Rx and Tx pins before uploading the code.

Code It

  • Here is the code for the Arduino:


char t;

void setup() {
pinMode(13,OUTPUT); //left motors forward
pinMode(12,OUTPUT); //left motors reverse
pinMode(11,OUTPUT); //right motors forward
pinMode(10,OUTPUT); //right motors reverse
pinMode(9,OUTPUT); //Led
Serial.begin(9600);

}

void loop() {
if(Serial.available()){
  t = Serial.read();
  Serial.println(t);
}

if(t == 'F'){
  digitalWrite(13,HIGH);
  digitalWrite(11,HIGH);
}

else if(t == 'B'){
  digitalWrite(12,HIGH);
  digitalWrite(10,HIGH);
}

else if(t == 'L'){
  digitalWrite(13,HIGH);
  digitalWrite(10,HIGH);
}

else if(t == 'R'){
  digitalWrite(11,HIGH);
  digitalWrite(12,HIGH);
}

else if(t == 'W'){
  digitalWrite(9,HIGH);
}
else if(t == 'w'){
  digitalWrite(9,LOW);
}

else if(t == 'S'){
  digitalWrite(13,LOW);
  digitalWrite(12,LOW);
  digitalWrite(11,LOW);
  digitalWrite(10,LOW);
}
delay(100);
}

Build It

  • Here are the finished picture of the car.

Buggy_1.JPG Buggy_2.JPG Buggy_3.JPG Buggy_4.JPG