Introduction: Wirelessly Control a Robot Using Arduino and RF Modules !

Picture of Wirelessly Control a Robot Using Arduino and RF Modules !


Edit 05/05/2016

Hey guys, I've been busy with college and couldn't reply to commments. Most of y'all wanted the code and schematics done a bit better so I've made the schematics on Eagle 7.2.0 and uploaded everything on Github.

Here's the link :



In this Instructable you'll learn how to make an RF controlled Arduino Robot.....or in other words your very own Minion waiting to obey your commands..... :p


In this project I've used a 433Mhz Tx and Rx pair to allow the Arduinos to communicate wirelessly with each other.These modules are probably the easiest way to set up wireless simplex communincation between two arduinos and are much cheaper compared to other wireless modules like Xbee or bluetooth modules(reduced range though).

I have shown two alternatives for controlling the robot :- 1). Using your computer's keyboard to control the bot and 2).Using a separate controller made on a breadboard.
The robot uses differential drive in order to turn (wheels on either side move in opposite directions).

Refer to the pdf attached for getting started with these modules.

So lets get started..... :)

Step 1: Collect Your Parts

Picture of Collect Your Parts

Here is the parts list and some links for buying them :-

The Controller Board :-

1. Any model/clone Arduino board.
2.The 433MHz OR the 315MHz module (both work the same way) Tx and Rx pair ( Link here)
3. A breadboard for the controller pad (Not needed if you're using a computer to control the bot).
4.Push button switches X 5 (Again not needed if you're using a computer to control the bot).
5. Connecting wires.
6. 9V battery to power the Arduino on the Tx end.
7.A 17cm long breadboard wire for the Antenna for the Tx and Rx.

The Receiver Board :-

1. Any Arduino model/clone board.
2. The Rx part of theTx/Rx pair (Link in Step 2 above).
3. Breadboard and connecting wires.
4.12V battery pack to power Motors.(In the video I have used a 12V AC to DC adapter)
5. 100uF Electrolytic Caps X 4.
6. L293D motor driver chip X 2 (Each chip controls 2 motors bi-directionally...So if you want to make a 2 wheeled bot you will require only 1 L293D chip).
7. 0.1uF ceramic caps X 12 (3 for each motor)....for eliminating noise between the controller and motors.
8. A 9V battery for powering the Arduino on the Rx end.

Note :- You can skip step 5 and 6 if you have a motor shield...though the code will need some tweaking then!

Robot Chassis and Drivetrain :-

1.DC Motors X 4
2.Robot chasis
3. Wheels X 4

Note :- I used this robot chassis....came with the motors and wheels 

Now on to the build......

Step 2: The Transmitter : Part 1 :- Controlling the Robot Using the Computer

Picture of The Transmitter : Part 1 :- Controlling the Robot Using the Computer

The transmitter and receiver communicate across a  433MHz frequency ( or 315MHz...really depends on what module you use).

The transmitter is the smaller module having 4 pins :-

(1)Ant ---------> Antenna
(2)Vcc ---------> Power this case 5v from the Arduino at the Tx end.
(3)Data -------> Data pin.....transmits the data in bytes.
(4)Gnd-------->Ground pin....connected to Arduino ground.

First solder the 17 cm (about 13cm for the 315MHz module) solid core breadboard wire to the Ant pin on the Tx module....the added antenna increases the communication range and improves performance indoors.
If you do not want to solder the antenna directly you can  always connect it on the breadboard.

In this step you will learn how to control the bot using the computer.

You can have a look at Step 3 which shows how to control  the bot using a breadboard controller.

Connections :-

These are the connection between the Arduino and the Tx module.

                           Tx                                                Arduino

                        Vcc----------------------------------->  5v pin
                       Gnd-----------------------------------> Gnd pin
                      Data-----------------------------------> Digital Pin 3 

Code :-

First you need to download the VirtualWire Library...this library makes coding these modules for the  Arduino very easy.
Download and Installation instructions are provided here

Working of the code :-

The code accept inputs from the user (f,b,r,l,s)  through the serial monitor and then uses Switch-Case statements to determine which command is to be sent by the Tx .i.e. Front, Back, Left, Right, or Stop.

The code is attached below in a .txt file.....just paste it into a new window on the Arduino IDE.

Moving on......

Step 3: The Transmitter : Part 2 :- Breadboard Remote Controller

Picture of The Transmitter : Part 2 :- Breadboard Remote Controller

This is an alternative way of controlling the building your own remote on a breadboard.

This is where the push buttons come in use...connect the push-buttons in a way that you find comfortable to control the bot (see the pics for reference).

Make sure you identify the correct terminals of all the switches.

The Connections :-

Connect one terminal of each switch  to  a common ground that is connected to an Arduino ground pin (Again refer to the pics).

Connect the other terminal to a Digital pin on the Arduino.

The connections should be something like this :-

                                           Button                                                            Digital Pin

                                       Forward ------------------------------------------->     08
                                      Backward ------------------------------------------>    09
                                      Right        -------------------------------------------->   10
                                      Left            ------------------------------------------->   11
                                      Stop         -------------------------------------------->   12

You can change the digital pin connections....but make sure you change them in the RemoteTx code as well!!

The Code :-

(1) The Tx Code :-

The code reads whenever a button is pressed since the corresponding digital pin goes LOW.Based on which digital pin goes LOW the appropriate command is transmitted.

(2)The Rx Code :-

The code receives the transmitted byte and based on the command received move the bot in the desired direction.

Both codes are attached at the bottom.

Step 4: The Receiver

Picture of The Receiver

The Rx is the longer module having 8 pins :-



Note :- we only use the first Data pin (pin 7).

Now take the second 17cm wire and solder it to the Ant pin of the Rx module.

Connections :- 

These are the connections between the Arduino and the Rx module.

                             Rx                                                Arduino

                        Vcc----------------------------------->  5v pin
                       Gnd-----------------------------------> Gnd pin
                      Data-----------------------------------> Digital Pin 2

You will also need to connect the two L293D motor driver chips to the Arduino at the receiver.( Pin diagram of L293D given in the pics) Make sure you connect the chip properly...the end with the notch is the front end.

                          First L293D                                           Arduino

                             Enable1 --------------------------------> Digital Pin 05
                             Enable2  -------------------------------->Digital Pin 06
                             Input 1     -------------------------------->Digital Pin 07
                             Input 2 ----------------------------------->Digital Pin 08
                             Input 3 ----------------------------------->Digital Pin 09
                             Input 4 ----------------------------------->Digital Pin 10

                              Second L293D                                           Arduino

                             Enable1 --------------------------------> Digital Pin 03
                             Enable2  -------------------------------->Digital Pin 11
                             Input 1     -------------------------------->Digital Pin 04
                             Input 2 ----------------------------------->Digital Pin 12
                             Input 3 ----------------------------------->Digital Pin 14(Analog 0)
                             Input 4 ----------------------------------->Digital Pin 15(Analog 1)

Additional connections :-

(1)For the L293D motor drivers :-
Pin 8 of both the L293D chip go to the poitive of the 12V supply....this pin gives the power to the motors.

Pins 4,5,12,13 of both chips go to ground.

Pins 3 and 6  are connected to the leads of first motor........and pins 11,14 go to the leads of the second motor.(Same for the second L293D as well but for third and fourth motor).

Pin 16 of both chips is connected to the Arduino 5v supply...............this pin powers the chip.

Very Important  :- Make sure Arduino and 12V  supply grounds are connected  TOGETHER!!!!

The Code :-

This code is receives the transmitted commands from the Tx and moves the robot in the desired direction.

Note :- This receiver code is used when the robot is controlled via the computer input. Another modified receiver code is used with the breadboard controller and can be downloaded in Step 3.

Step 5: The Chassis and Drivetrain

Picture of The Chassis and Drivetrain

Now get your Motors and robot chassis ready....

First solder the 0.1uf ceramic caps on the motors in the following way :-

(1) connect one capacitor across the terminals of the motor.
(2)connect one lead each of the 2 other caps on the motor body and the other lead to each motor terminal.
These caps don't have polarity so don't get worried about connecting them wrong.

You can refer to the pics and also to the link for more help :-

Now attach your motors to the chassis and connect the motor terminals to the correct pins on the L293D motor driver.

Don't forget to connect the 100uF electrolytic caps to the supply pins of the L293Ds (Pins 8 and 16).
Electrolytic caps are polarized and  need to be connected correctly.The shorter lead (the side of the casing with the strip ) is the negative terminal and the longer lead is the positive one.These caps smooth out voltage spikes from the supply.

Now for the main assembly........

Step 6: Main Assembly

Picture of Main Assembly

First make sure all the circuit connections are correct, caps  on the motors are soldered well and check for any loose connections.

Be Careful While adding the batteries and make sure ALL connections are correct before connecting the batteries and powering up.

For mounting the the receiver breadboard on to the robot I used bits of velcro. I secured the Arduino on to the robot by  using a zip tie.

Use small bits of solid core wires or rubber bands to tie the different bunches of wires to make it a bit neater.

Now on to Testing!!!!!!!!!!!

Step 7: Test It!!

Picture of Test It!!
With everything assembled and all the wires connected properly the only step left is Testing!

Before you put the wheels on and power the bot  up.....test  it  without the wheels attached first...this way you can make sure all the motors have been connected correctly with the motor driver and their direction of rotation is correct.
Once you're satisfied with the speed and rotation of the motors put the wheels on!
Be careful when using the 12v supply and double check all your connections before powering anything up again!
I have attached links to  videos of the robot testing when  controlled by both the computer and the separate breadboard controller.

Now that your robot is made add some more features to it (I'm planning on tank tracks!) your bot is ready to do your bidding! :p

Initial Test Video :-

PS :- I have entered this Instructable in the Microcontroller please vote if you liked it...Thanks!

Update (28-10-13) :- Here is a short  video of the robot in action with batteries.....sorry for the bad shooting, had the controller in my other hand!


unknown1111 (author)2017-08-19

amazing project !!!

Can I use an arduino nano in this project?

ravindrascout (author)2017-07-17

Hi there,

I was requested to make a remote control car with a mounted camera. it should work for longer ranges so it was opted that we go for radio transmitter over blue tooth. it should be arduino controlled. the remote control consist of a joystick. in addition there is a requirement that the camera should send images / videos to our display. (well that can wait) but it'll be great if you can give me a tutorial from the basic lvl since i'm quite new to the field. Thanks

IrwanF (author)2016-02-23

I like this project,,,,,
I have aq question....
how long distance we can control this robot...???

RonitB5 (author)IrwanF2017-06-17

depends on the module u use.

YatharthA1 (author)2017-04-19

amazing job done man!!!!!!!!!!!!

Blazingnite (author)2016-08-26

What does int i = 0; i < 12; i++) mean?

jjack10 (author)Blazingnite2017-03-26

Its a for loop in c lenguage its mean the loop work agaim and again 12 tims when i=o to i=12

Blazingnite (author)2016-08-26

also if im using an l298n dual h bridge will i need to change the program a bit?

laith mohamed (author)2016-07-29

Attracted me this experiment , go on ...

devanshr1221 (author)2016-07-29

I have a problem..

My transmitter is sending signals properly as i can see through my serial port, but my receiver is not receiving it.

Please someone help me..

Soulofhoror (author)2016-05-27

Hi, nice work. I'm new to Arduino so this may sound dum. Sorry about that in advance.

In the reseiver code I saw that you put the controls(forward, backward etc) on different methods referring to the void loop(which i think might be the main method). so when the program loops does the code holds the previous set command until a new one is reserved? If so why? If not why?

Plz answer a nubie here.....

r5sb (author)Soulofhoror2016-05-29

Hey we all started somewhere right? :D

The receiver responds according to the button pressed at the Tx. Since I didn't want to keep on pressing the Forward button in order to make the robot go forward, I made it move continuously in the direction pressed and also added a Stop button.

RajdeepR3 (author)2016-04-11

hey man, i have a prob i am making a rc car using arduino and l293d motor driver and i want to use rf but i am facing prob in connections and writing codes so if u could help me regarding this i would be really thankful

Sujeet Pa (author)2016-03-31

Could you use Diagrammatic Representations because in most of the pictures given, i could only see some wires

Vinayak Tyagi (author)2016-03-28

Hi RoboDude, I like your tutorial! I added the remote part on my robot using your code and it works perfectly. I've also written and instructable on a wireless RF robot, but its a bit different than urs. Thanks for the remote code. Definitely, I'm adding this to my favorites.

Here's my instructable :

ArpitPatel (author)2016-03-10

Hello Author... I am working on this project and only want to ask you about sequence of motor. In this project there are total 2(two) L293D interfaced so total 4(four) motors will be connected to two L293D right. Now you have clearly mentioned the number of ICs i.e. First L293D and Second L293D, but which motors are connected to first IC and which motors are connected to second IC. Sir, Now my question is in the bot there are total four motors connected, two motors at the front and two motors at the rear. Now Out of these all four motors which are connected to which ICs...?? Kind Request to clearly mention the motor sequence i.e. motor no. 1,2,3,4... and front left...? front right...? rear left...? rear right...?

NavinD3 (author)2016-02-29

i am planning to use bluetooth instead of rf and to make my android device as it possible ?

Sudhansu Barik (author)NavinD32016-03-04

Yes, you can use HC-05 Bluetooth Host for Arduino. And then you can control it using your android device.

abinay777 (author)2015-10-26

hi,i have tried uploading the programme before buying the products to make sure it works or its a waste of money.

on trying to upload it ,it showed an error saying there is no directory saying

''sketch_oct24a.ino:5:25: fatal error: VirtualWire.h: No such file or directory"

what should i do pls anyone can help me

i would be gratefull

vasu0712 (author)abinay7772016-02-17

Have u extracted the virtual wire pdf to the library folder in arduino??

RishikeshC (author)abinay7772015-11-24

check if you have the virtual wire library in tools on the arduino sketch page.

if not you can download it from google

abinay777 (author)RishikeshC2016-01-19

Thanks ,but I couldn't find any libraries relating to virtualwire on the internet
Can u send a link to the library if possible

mistermetro (author)abinay7772016-01-23

vasu0712 (author)2016-02-17

Bro guide me the steps to control it using computer...i have uploaded the reciever program in arduino board and tx program in tx part...but i dont know what to do next.

bjose (author)2016-02-13

Nice presentation,but pls give a proper circuit diagram.All i can see is a couple of wires in your photo.

robot_maker (author)2015-11-28

how do i do it if using l293d motor driver shield????

Yes I think that will work very well with no changes in the Arduino sketch. But as I am writing this two months after your question was asked you already know the answer.

Volthaus Electronics Laboratory made it! (author)2015-09-30

I have made a few changes. Only two motors on robot so i will add motors for interesting options. Just ready to test i think maybe sleep a little before i add electricity if you know what i mean. thanks for the good work on your Instructable.

Very nice work. Thank you so much for sharing this with all of us.

p3dr0d14z (author)2015-02-11

Sometimes when I press the buttons on the transmitter does not reach the order to the receiver. Will be a noise problem and insulation? Or maybe poor quality RF modules? Has already happened to anyone?

nodoubtman (author)p3dr0d14z2015-07-18

What is the distance between your Tx and Rx module?

r5sb (author)p3dr0d14z2015-02-15

Hey sorry for the late reply, I didn't have access to my laptop for a few days. This problem has happened to me too. These modules have a range of about 100m line of sight in an open field. In indoor environments this range is reduced because of walls, furniture, etc. However the modules I got were pretty decent and sometimes even when I was in a separate room from the robot.

surendra2369 (author)r5sb2015-04-17

Hey i need ur suggestion in connecting 8 motors at the receiver end.
Like how to connect 4 l293d chips to one arduino.?
Should i use two arduinos for 8 motors (4 motors and 2 l293d for each arduino) to connect to Rx module.?
If so explain me with the connections with clear diagrams.
Please help me with this.
Reply me

p3dr0d14z (author)surendra23692015-04-17

Multiply this x4. you will need a power source suitable to the needs of your motors. You only need 2 Arduino digital pins to control each motor. Arduino UNO leaves you 12 free digital pins so you will not have problems to control 8 motor with Arduino UNO and L293D.

surendra2369 (author)p3dr0d14z2015-04-18
In the picture u didnt connected the enable pins.
Can i connect all enable pins (i.e all 8 enable pins of 4 l293d's) to one or two digital pins.?
If so, can u show it diagramatically.?
Reply here

p3dr0d14z (author)surendra23692015-04-18

You can connect all enable pins to positive pole of the font you use to power the motors.

surendra2369 (author)p3dr0d14z2015-04-18
What about enable pins.?
Pic doesnt show any connection for enable pins.
Can i connect all enable pins (8 pins for 4 l293d chips) to a single or two digital pins.?

alys5 (author)2015-06-09

can this project work with nrf24l01 instead of rf433 module

nodoubtman (author)alys52015-07-18

yes, why not? you have to simply change the code :-)

alys5 (author)2015-06-09

are the motors pwm controlled

nodoubtman (author)alys52015-07-18

motor are control using the L293D motor driver, with digitalWrite commands.

eeg1109 (author)2015-05-30


I have a seed motorshield 2.0 and cant get it to run using the transmitter. I can get it to transmit with no problem but as soon as I add the motor.h file it stops working. I know you said it needed some tweeking if using the shield. Can any you help me out? I am not sure where to start. I am kinda new to this.

r5sb (author)eeg11092015-05-31

Hey, I'm not too familiar with the seed motorshield 2.0 but sounds like you may have a conflict of timers in the Arduino. Are you using a servo in your project? Also make sure you've installed the libraries in the correct folder. Check this instructable. I've used a motor shield and wirleless modules in this case. Hope this helps!

eeg1109 (author)r5sb2015-05-31

also i think that shield uses pin 13 as well for PWM. Would that conflict with the virtual wire library?

eeg1109 (author)r5sb2015-05-31


thanks for your reply. The libraries work fine as i have tried them independently. I am using dc motors just like yours. I tried using the other code but nothing.I read somewhere that the virtual wire library uses timer1 and may be incompatible with other libraries that use timer1. Would you happen to know anything about this?

shreyask1 (author)2015-05-11

I want to make a wirelessly controlled TWO WHEELED ROBOT (NOT 4 WHEELED) Using Arduino and RF Modules .........CAN SOMEONE PLEASE HELP ????

surendra2369 (author)2015-04-18
In the picture u didnt connected the enable pins.
Can i connect all enable pins (i.e all 8 enable pins of 4 l293d's) to one or two digital pins.?
If so, can u show it diagramatically.?
Reply here

surendra2369 (author)2015-04-18
In the picture u didnt connected the enable pins.
Can i connect all enable pins (i.e all 8 enable pins of 4 l293d's) to one or two digital pins.?
If so, can u show it diagramatically.?
Reply here

surendra2369 (author)2015-04-18
In the picture u didnt connected the enable pins.
Can i connect all enable pins (i.e all 8 enable pins of 4 l293d's) to one or two digital pins.?
If so, can u show it diagramatically.?
Reply here

About This Instructable




Bio: I break things so I can figure out how they're made when I put it back together.
More by r5sb:Raspberry Pi Document Scanner With Automatic Upload to Dropbox.Arduino Hexapod (With A Personality)DIY Line Follower Sensor Array
Add instructable to: