Introduction: DIY Laptop Controlled Robot V1.0

Picture of DIY Laptop Controlled Robot V1.0

It would be so good if would be able to control a robot or your rc car using a laptop just like you control a car in a game. Well, it can be made possible using the versatile arduino UNO. There are thousands of projects you can make with arduino. This one of those projects. It is basically a robot which can be controlled over a laptop or pc. It can be connected to your pc using bluetooth. It uses an HC-05 bluetooth module which is connected to arduino UNO. When you press a button on the keyboard, a string of data is sent to bluetooth module through the bluetooth of laptop. The module then transmitts the data to arduino which processes it. Arduino then sends a signal to motor driver ic which conducts current to the motors and the motor spins.

For making this robot you should need some basic knowledge about electronics and arduino. I have tried my best to make this instructable easy for even a beginner to understand but this is my first instructable so there can be some errors in this it. Correct me if i am wrong somewhere and feel free to comment and ask any questions. Being a 14 year old guy, I am not a professional in the field of electronics but I still have enough knowledge to work on arduino projects.

Check out the new version of this project: Laptop Controlled Robot v2.0

__________

Update:

It's not easy to reply to each and every comment on so many instructables, so you can ping me for any assistance/discussion/query. My email address is: agarwalsanyam946@gmail.com

For more such awesome DIYs, subscribe to my YouTube channel.

My Facebook page: Make w/ SA

Get the best of the parts at reasonable rates from GearBest.

Also, have a look at their ongoing sales:

The Fall 3D Printer and Electronic Tools Promotional Sale

Arduino Best Deals

Creality3D CR - 10 3D Printer (coupon: GBCR10J) $396.99

Step 1: Gather Parts

Picture of Gather Parts



For making this robot you would need the parts and tools listed below. Most of them can be bought from ebay or radioshack.


PARTS-:

1x Arduino board (UNO)

1x HC-05 Bluetooth module

1x 12v Battery (according to your requirement,i'm using 1.3AH)

4x DC Geared motors (speed and torque according to your requirement)

4x Wheels for motors (i used two small ones and two big ones)

1x Adapter Jack (to power the arduino board)

1x L293d motor driver ic

8x Male jumper wires

1x Breadboard

Rainbow cable (for motor connections)

Jumper cable (for breadboard connections)

Alligator clips (for connecting battery)

LEDs- 2x red, 2x white (if you want to add front and rear lights)

Male headers


TOOLS-:


-Soldering Iron
-Soldering Wire
-Fume Extractor (if you don't like the bad smell of burning flux)
-Wire Cutter/Stripper -Double Sided Sticky Foam Tape

Step 2: Making the Chassis

Picture of Making the Chassis

So first we start by making the chassis. Fix all the four motors as shown in the fig. above. If you are not using a similar base, you can use clamps to mount the motors. It is recommended to use a metal base as it does not bend when lifting a huge weight.

Step 3: Making the Chassis (Part 2)

Picture of Making the Chassis (Part 2)

As we are making a 4 wheeled robot, we need to connect left and right motors in parallel because l293d can only drive two motors. So cut the required amount of rainbow cable and connect both the positive terminals of left side motors then connect both the negative terminals. Do the same for right side motors. Now solder two more wires to each pair of motors and finally solder male headers to the remaining free ends of wires.

Step 4: Attaching Wheels

Picture of Attaching Wheels

Now we are all done with the wiring of chassis. The last step for completing the chassis is to attach wheels to all of the motors.

Step 5: Attaching Breadboard and Arduino to the Base

Picture of Attaching Breadboard and Arduino to the Base

Attach the breadboard to the base using double sided tape. Now cut two equal lengths of jumper cable and connect it as shown in the breadboard layout above. Fix the arduino board just in the middle of the breadboard.

Step 6: Wiring and Connections (Bluetooth Module)

Picture of Wiring and Connections (Bluetooth Module)

Here comes the most complicated part of the project and the most important one but no worries because it is not too difficult.

The first part of this step is to fix the bluetooth module and the motor driver IC to the breadboard. For all the connections refer to these steps-:

Step 1:- Connect the Tx pin of bluetooth module to arduino pin 0 (Rx).

Step 2:- Connect the Rx pin of bluetooth module to arduino pin 1 (Tx).

Step 3:- Connect vcc of bluetooth module to arduino +3.3v (if you are using HC-05 module). Connect vcc to +5v (if you are using ( HC-06, JY-MCU or any other module). You can see the voltage ratings given at the back of the module.

Step 4:- Connect gnd of bluetooth module to arduino gnd.

NOTE: I have not used a voltage divider for bluetooth module because i took the pictures first without knowing about that. However it still works without adding it but it is recommended use a voltage divider.I have added a breadboard layout above with the voltage divider. Use a 1.2k and 2.2k resistor for it.

Step 7: Wiring and Connections (L293d)

Picture of Wiring and Connections (L293d)

L293d is a dual h bridge motor driver integrated circuit. We are using it because arduino operates at a low voltage and requires a small amount of current to operate while the motors require a relatively high voltage and current to operate. The l293d ic takes input from arduino in the form of logic 0 and 1, and gives a high output which is enough to drive a motor. It has two voltage pins and two enable pins. Enable pins are connect to vcc to enable the motors. As we already want the motors enabled, we are connecting both the enable pins to the positive terminal of battery. All the four output pins are connected to motors and four input pins are connected to arduino. You can also use l298 for this purpose. however l298 is expensive but it can drive even higher power motors.

Fix the ic on the breadboard. Be sure to check whether you have placed it right or not. Look for a small semi-circle at the top of the ic, it should face in the front. For connections of the ic refer to the following steps-:


Step 1-: as you can see in the pin layout above, pin 4,5,12 and 13 are always connected to ground so first connect pins 4 and 5 using jumper cable then connect pins 12 and 13.

Step 2-: Connect pins 5 and 13 together and then connect pin 12 to the negative rail of breadboard.

Step 3-: Connect pins 1,8,9,16 together then connect pin 16 to the positive rail of breadboard.

Step 4-: Connect pin 2 of ic to arduino pin 2 then connect pin 7 of ic to arduino pin 4.

Step 5-: Connect pin 10 of ic to arduino pin 7 then connect pin 15 of ic to to arduino pin 5.

Step 6-: Connect left pair of motors to pin 3 and 6 in either way. don't worry about the polarity of the motors right now as we would see to that later.

Step 7-: Connect right pair of motors to pin 11 and 14 in either way.

Step 8: Wiring and Connections (LEDs)- Optional

Picture of Wiring and Connections (LEDs)- Optional

You can skip this step if you don't want to add any lights to your robot. You can use LEDs of any colour, I used white for front lights and red for rear lights. For connections of led refer to the following steps-:

Step 1-: First connect two white LEDs in parallel then connect the positive terminal of led to arduino pin 9. connect negative of led to arduino gnd.

Step 2-: Similarly connect two red LEDs in parallel and connect the positive terminal of led to arduino pin 11. connect negative of led to arduino gnd.

Step 9: Upload the Code

Picture of Upload the Code

So we are all done with the messy stuff. Now its the time to upload the code to arduino. Connect your arduino device to your pc and open the arduino IDE. Copy the following code and paste it on the arduino screen -:

*********************************

// DIY Laptop Controlled Robot

// made by - Saiyam Agrawal

int r_mtr_n = 2; // assign motor pins to arduino

int r_mtr_p = 4;

int l_mtr_p = 5;

int l_mtr_n = 7;

int b_light = 9; // assign light pins to arduino

int f_light = 11;

int incomingByte = 0; // assign pin for bluetooth module

void setup()

{

pinMode(r_mtr_n, OUTPUT);


pinMode(r_mtr_p, OUTPUT);

pinMode(l_mtr_p, OUTPUT);

pinMode(l_mtr_n, OUTPUT);

pinMode(b_light, OUTPUT);

pinMode(f_light, OUTPUT);

digitalWrite(r_mtr_n, LOW);

digitalWrite(r_mtr_p, LOW);

digitalWrite(l_mtr_p, LOW);

digitalWrite(l_mtr_n, LOW);

digitalWrite(b_light, LOW);

digitalWrite(f_light, LOW);

Serial.begin(9600);

Serial.println("start");

}

void loop()

{

if (Serial.available() > 0) {

incomingByte = Serial.read();

}

switch(incomingByte)

{

case 'S':

digitalWrite(r_mtr_n, LOW); // control for stop

digitalWrite(r_mtr_p, LOW);

digitalWrite(l_mtr_p, LOW);

digitalWrite(l_mtr_n, LOW);

Serial.println("Stop\n");

incomingByte='*';

break;

case 'R':

digitalWrite(r_mtr_n, HIGH); // control for right

digitalWrite(r_mtr_p, LOW);

digitalWrite(l_mtr_p, HIGH);

digitalWrite(l_mtr_n, LOW);

Serial.println("right\n");

incomingByte='*';

break;

case 'L':

digitalWrite(r_mtr_n, LOW); // control for left

digitalWrite(r_mtr_p, HIGH);

digitalWrite(l_mtr_p, LOW);

digitalWrite(l_mtr_n, HIGH);

Serial.println("left\n");

incomingByte='*';

break;

case 'F':

digitalWrite(r_mtr_n, HIGH); // control for forward

digitalWrite(r_mtr_p, LOW);

digitalWrite(l_mtr_p, LOW);

digitalWrite(l_mtr_n, HIGH);

Serial.println("forward\n");

incomingByte='*';

break;

case 'B':

digitalWrite(r_mtr_n, LOW); // control for backward

digitalWrite(r_mtr_p, HIGH);

digitalWrite(l_mtr_p, HIGH);

digitalWrite(l_mtr_n, LOW);

Serial.println("backwards\n");

incomingByte='*';

break;

case 'f':

digitalWrite(r_mtr_n, LOW); // control for stop

digitalWrite(r_mtr_p, LOW);

digitalWrite(l_mtr_p, LOW);

digitalWrite(l_mtr_n, LOW);

Serial.println("Stop\n");

incomingByte='*';

break;

case 'd':

digitalWrite(r_mtr_n, HIGH); // control for right

digitalWrite(r_mtr_p, LOW);

digitalWrite(l_mtr_p, HIGH);

digitalWrite(l_mtr_n, LOW);

Serial.println("right\n");

incomingByte='*';

break;

case 'a':

digitalWrite(r_mtr_n, LOW); // control for left

digitalWrite(r_mtr_p, HIGH);

digitalWrite(l_mtr_p, LOW);

digitalWrite(l_mtr_n, HIGH);

Serial.println("left\n");

incomingByte='*';

break;

case 'w':

digitalWrite(r_mtr_n, HIGH); // control for forward

digitalWrite(r_mtr_p, LOW);

digitalWrite(l_mtr_p, LOW);

digitalWrite(l_mtr_n, HIGH);

Serial.println("forward\n");

incomingByte='*';

break;

case 's':

digitalWrite(r_mtr_n, LOW); // control for backward

digitalWrite(r_mtr_p, HIGH);

digitalWrite(l_mtr_p, HIGH);

digitalWrite(l_mtr_n, LOW);

Serial.println("backwards\n");

incomingByte='*';

break;

case 'n':

digitalWrite(f_light, HIGH); // control for lights

Serial.println("front lights on");

incomingByte='*';

break;

case 'j':

digitalWrite(f_light, LOW);

Serial.println("front lights off");

incomingByte='*';

break;

case 'm':

digitalWrite(b_light, HIGH);

Serial.println("rear lights on");

incomingByte='*';

break;

case 'k':

digitalWrite(b_light, LOW);

Serial.println("rear lights off");

incomingByte='*';

break;

delay(5000);

}

}

*********************************

Step 10: Battery and Power

Picture of Battery and Power

When you are done uploading the code, power the arduino board by connecting it to breadboard using adapter jack then connect the battery to the power rails of breadboard using alligator clips.

You can use any battery according to your requirement. Using a low voltage battery would lower the speed of motors. Recommended voltage to power the robot is 12v.

Now comes the type of battery to use, I would recommend lithium-ion as they are small, light-weight, have long battery-life and can fit anywhere easily but their disadvantage is that they are expensive and cannot be charged easily. I used lead-acid because they are cheap and can be charged easily.

Step 11: Software

Picture of Software

I used tera term to control the robot using laptop. First download tera term then connect it to your robot. If you dont know how to connect, follow these steps-:

Step 1-: first switch on your robot by connecting the battery.

Step 2-: go to devices and printers on your pc then click on add a device. install the hc05 module. the pairing code is 1234.

Step 3-: now select your module, go to properties and check on which serial port is your device connected for eg- mine was COM 65.

Step 4-: open tera term, a screen will appear. now select serial and enter your module's serial port there and select OK.

Now your robot is connected to your laptop. following are the commands to control your robot-

Forward- w or F (upper case)
Backward- s or B (upper case)
Left- a or L (upper case)
Right- d or R (upper case)
Stop- f or S
Front lights on- n
Front lights off- j
Rear lights on- m
Rear lights off- k

Step 12: Checking

Picture of Checking

If your robot is working fine after checking it in step 11, you can skip this step. If your robot is turning left or right when pressing the forward button, you have a problem with the polarity of the motor. Reverse the polarity of any one of the motors, If it is moving backward then reverse the polarity of both the motors.

If your robot is not moving at all check all the connections of ic as well as bluetooth module. Touch the ic, if it is hot then you have done the wiring wrong. Maybe the connections are too loose if you are not using a good quality jumper wire as making anything on breadboard does not ensure good electrical contacts. If it still does not work then solder the whole circuit on perfboard or maybe an etched pcb. It is advised that double-check all the connections before connecting the battery.

Step 13: Enjoy!!

Picture of Enjoy!!

Ok so you are done with the making of this robot. Just connect it to your laptop and enjoy. Here are some tips and suggestions for making your robot event better-

1) - as you already know we have used only 8 digital pins of arduino so you still have 6 more pins. So let your imagination flow so you can add more features to your robot.

2) - you can add a buzzer as a horn for your robot.

3) - you can even add more leds to the robot.

4) - this robot can also be controlled over an android device. download an app named bluetooth rc controller from play store.

5) - you can modify the program to make the robot voice controlled using an android device.

6) - you can add a webcam and sensors as well.

Ok, so this is the end of this instructable. Thanks for watching it. If you have any questions related to this instructable, feel free to ask. THANK YOU :)

Switch to: Laptop Controlled Robot v2.0

Comments

funshanas (author)2017-12-11

Hi, author and everyone. I have an issue with this project. All the things work fine if arduino cable is connected to pc. If I disconnect arduino cable, laptop commands to move robot stop working. But, Arduino and bluetooth module still gets power from battery. On the other side, if I disconnect battery, robot still works on Arduino power getting from PC. Please guide me how to make it work without cable connected to PC.

DhyanSagar (author)2016-12-02

tera term for windows

what's for mac os x i'am using mac

Jugabrata Das (author)2016-09-09

CAN I MAKE IT TO TALK

SanuB1 (author)2016-01-20

2 questions:-

. What is the power source used? where can i getit?

.Can i use RF transmitter and receiver module to do this task?

colbtron (author)2016-01-07

make the break lights come on when you stop!

Shiellmoore YmerienG (author)2015-10-22

Please reply i need an answer. :(

Shiellmoore YmerienG (author)2015-10-20

can i use gizduino instead of arduino uno? is there a problem? and can i use also EGBT-04 BT instead of HC-05 BT? is there a change of ckt or pins? please reply, im a beginner. godbless

Venkat Jayanth (author)2015-10-14

can i use 4 or 5 terminated blutooth module.if yes, what is the circuit

thegoldenboy (author)2015-10-03

is this same when i used bluetooth shield driver? what is the pin config?

ahmedalinassar34 (author)2015-07-24

sajithpeiRi5 (author)2015-02-24

RafayJ (author)sajithpeiRi52015-07-23

.

abhinaw gupta (author)2015-07-14

hi sayam
it is very nice project and I am interested in making it
I have a problem there are many arduino unos available online .which should I use ? plz suggest
thanks
abhinaw

hacklavya (author)2015-05-25

all 4 motors connected to same voltage, but different sized wheels.

I don't know how there is not a slipping of the wheels.

This is problem.

murphadonut (author)2015-05-19

What part of the code would I need to change to make it work for android?

fsebbah (author)2015-05-19

Hi Saylam,
It's a very impressionnant project. I would like if it's possible to have the Fritzing Schemas.

Thanks,

Franck

myusof3 (author)2015-05-05

Hai sir. May i know if i can use Zigbee to replace the bluetooth module? is that possible?

Saiyam (author)myusof32015-05-05

Yes it can be used with the same wiring.

myusof3 (author)Saiyam2015-05-05

can you be more specific sir? because it must have two zigbee used. right? or can i use only one? i cannot find the rx and tx pin. how should i solve that? please be specific. im sorry im just a beginner

Saiyam (author)myusof32015-05-06

Sorry I don't know much about zigbee module .Can you send me a picture of the module? Maybe I'm able to identify then.

MANJAMIRAI (author)Saiyam2015-05-07

this is the zigbee module that i want to use. do you know specific way to do it?

avinash.veelon (author)2015-05-07

teraterm is not working in my laptop can u plz suggest alternatve software for me..

basic engineer (author)2015-04-20

How did you get the rx and tx from the Bluetooth module to connect with the arduino uno. I seem to be having issues connecting and uploading them.

basic engineer (author)2015-04-13

how would you modify the code if you are only using 2 motors in the back with 4 wheels instead of 4 motors, with the arduino uno?

Saiyam (author)basic engineer2015-04-14

No need to modify the code. As you can see, I have connected two motors in parallel so instead of connecting them in parallel you can connect one motor directly to the ic.

LakmalN (author)2015-04-03

Good Tutorial! Please add some video.

What is that Battery?

Saiyam (author)LakmalN2015-04-03

That is a 12v lead acid battery. Cheap and provides great power.

abhis1 (author)2015-03-29

how to use teraterm i m not getting can you help please

Saiyam (author)abhis12015-03-29

You can check step 11 for details.

francis.famo (author)2015-03-20

hi i have a question, i made all the connections and the wiring but only the lights are fuontioning while the wheels are not spinning. please help. i check also the voltage and there is a power but no spinning. please help :( thank you

Saiyam (author)francis.famo2015-03-21

Are your motors alright? I mean when you connect them directly to the battery, do they spin?

What is the output voltage supplied by l293d when checked by a multimeter?

francis.famo (author)Saiyam2015-03-21

hello sir, yes sir the motor are spinning. when i press the forward, backward, left and right. the arduino passes a signal to the ld293d but there is no response in the motor. no spinning.

Saiyam (author)francis.famo2015-03-22

There is a way to check l293d. Look the circuit carefully and connect everything according to it. Leave the arduino for a while. If both the motors spin this time, that means that the ic is alright. Hope this helps.

francis.famo (author)Saiyam2015-03-23

sir good news. i tried your circuit and YES. the IC is in good condition but my question is why the motors are not spinning? i connect all the wires properly. or am i going to solder it in the PCB? is it a good idea sir?

Saiyam (author)francis.famo2015-03-23

Yes that should be a good idea. Make sure you solder everything according to the circuit carefully.

francis.famo (author)Saiyam2015-03-22

wow thank you sir.. i try this one. that means when i automatically supply the IC, the motors will start immediately?

and also i decided to put it in a PCB to fix the connection and to ensure a good connection.

Saiyam (author)francis.famo2015-03-22

Please tell me what happened after trying

Saiyam (author)francis.famo2015-03-22

If they do not, that would mean that the ic is faulty.

Saiyam (author)francis.famo2015-03-22

That means the l293d is faulty or it does not work. If yes, try it with another ic. If you think that the ic is alright then it means there is a problem with the wiring.

francis.famo (author)Saiyam2015-03-22

sir what makes the IC faulty? we connect the wires correctly and the IC is brand new. can you give me an idea what makes it faulty incase thats the reason why the motor is not spinning.

francis.famo (author)Saiyam2015-03-21

there is a supply in the IC. but the motors are not spinning. please help sir. i followed all your procedure and wiring but still no response. only the LED are functioning but the motors are not.

MillyYao (author)2015-03-22

Hi. i Have a question. May I know which program you are using for the schematics,
wiring diagrams?

Saiyam (author)MillyYao2015-03-22

Its Fritzing. You can download it from here- fritzing.org

MillyYao (author)2015-03-19

Hi, may I know what interface system you are using in this project?

ahmeda39 (author)2015-03-06

it's very nice intrucable

tmoir (author)2015-02-28

You're better with a LiPo battery, far lighter.

Saiyam (author)tmoir2015-03-03

Yes you're right, far lighter.

Ikhwan95 (author)2015-03-02

Please help me, I got problem during installing the Tera Term Software...

Saiyam (author)Ikhwan952015-03-03

What problem?

shaikfayaz458 (author)2015-02-28

i bought 12v,2a battery,it destroy L293d ic

did you use any voltage regulators for connection with L293d

About This Instructable

64,049views

635favorites

License:

Bio: I am Saiyam, currently studying in 12th standard and soon going to complete high school. I like to make random DIY projects whenever free. I ... More »
More by Saiyam:The Most Annoying Alarm Clock Ever!Portable Evaporative Room CoolerCleanSweep- the Floor Cleaning Robot!
Add instructable to: