Introduction: Bluetooth Controlled 4wd Arduino Robot

About: Sourya Choudhury is a 15 year old student and a computer science enthusiast living in Kolkata, India.

Most of us think of robotics as a rather difficult hobby. Well, it is not so.

When we are getting started with Arduino we should never go for making the very tempting but difficult-to-make projects. Arduino is a rather easy to use prototyping platform which is recommended for beginners.

You should first acquire some knowledge about the basic of C/C++ programming before making this project.

Step 1: Step 1: Required Parts.

The following items are required for this project:

1) 4 x 100 rpm dc geared motors.

2) 1 x hc-05 bluetooth module.

3) 1 x chassis.

4) 2 x mini breadboards.

5)1 x 7.4v lipo battery.

6) 1 x power bank.

7) 1 x L298n motor driver.

8) 1 x Arduino nano development board.

9) Some double sided tape.

10) 4 x wheels.

11) Jumper wires(Male to male, male to female).

12) Lots of patience.

Step 2: Step 2: Assembling the Chassis.

Now, let us assemble the chassis.

Attach the motors to the chassis . Then attach the wheels with a screw driver.

Step 3: Step 3: the Arduino, Bluetooth Module and Motor Driver

We now come to the most critical part of the project.

Connect the following Arduino pins to the motor driver:

D3 - in1;

D4- in2;

D5- in3;

D6- in4;

Now, connect these pins to the bluetooth module:

Tx (Arduino)- Rx(hc 05);

Tx(Arduino)- Tx (hc 05);

3.3v- 3.3v;

gnd- gnd.

Now wire the wires from the motor to the output sockets of the motor driver.

Step 4: Step 4: Power.

Use a 7.4v lithium polymer or lithium ion battery to power the robot.

Use a power bank to power the Arduino.

Step 5: Step 5: Code.

// Written by Sourya Choudhury.

char a;

int in1=3;

int in2= 4;

int in3= 5;

int in4= 6;

void setup() {

Serial.begin(9600);

Serial.begin(38400);

pinMode(in1,OUTPUT);

pinMode(in2,OUTPUT);

pinMode(in3,OUTPUT);

pinMode(in4,OUTPUT);

}

void loop()
{

if (Serial.available()){

a= (Serial.read());

Serial.write(a);

}

if(a=='F')

{

digitalWrite(in1,HIGH);

digitalWrite(in2,LOW);

digitalWrite(in3,HIGH);

digitalWrite(in4,LOW); ;

}

else if(a=='B')

{ digitalWrite(in1,LOW);

digitalWrite(in2,HIGH);

digitalWrite(in3,LOW);

digitalWrite(in4,HIGH);

} else if(a=='R')

{

digitalWrite(in1,HIGH);

digitalWrite(in2,LOW);

digitalWrite(in3,LOW);

digitalWrite(in4,HIGH);

}

else if(a=='L')

{

digitalWrite(in1,LOW);

digitalWrite(in2,HIGH);

digitalWrite(in3,HIGH);

digitalWrite(in4,LOW);

}

else

{

digitalWrite(in1,LOW);

digitalWrite(in2,LOW);

digitalWrite(in3,LOW);

digitalWrite(in4,LOW);

}

}

Step 6: Step 6: Troubleshooting.

Check your wiring before you use your project.

See that all possible delays in the code are eliminated.

Check your battery's power and ensure that the pair of ena pins and the pair of enb pins (l298n) are connected.

Do not be disappointed if the project does not work properly.

Step 7: ENJOY!!!!!

Make it Move Contest

Participated in the
Make it Move Contest