Introduction: ARDUINO Based IR Remote Control Robot

Hi everyone. This my new project IR remote control robot using arduino. This is a simple design robot you can easily build it.

Step 1: Requirements:

Project requirements:

  • Arduino uno Tsop1738 (ir receiver)
  • H bridge ic (L293D)
  • Two dc motor
  • A robot base
  • 9v Battery

Step 2: Circuit Diagram

For The circuit diagram refer the bellow device pin description and make connection to arduino based on the program of the robot:

Important: connect ir receiver out to arduino digital pin 11 only.

  • Connect arduino pin 7- l293d INPUT 1 pin 2
  • Connect arduino pin 6- l293d INPUT 2 pin 7
  • Connect arduino pin 5- l293d INPUT 3 pin 10
  • Connect arduino pin 4- l293d INPUT 4 pin 15

Connect two motor show like above images.and configure the lm293d as in image 3 above.

Step 3: Project Step 1: Read Your IR Remote Button Value Using Serial Monitor.

First do the circuit connection shown previous and download the ir remote library file for arduino IDE. And copy the library file in the arduino libraries folder.

And then run the arduino ide select sketch like that given bellow

File -> examples->IR remote->IR recv demo

Upload the sketch to arduino and open serial monitor. Press the TV IR remote (any company) in front of ir receiver then you will see the decode hex code in serial monitor (example : FF30CF). the code will vary according to the remote company. Press any 5 button in remote and note down the codes shown in the serial monitor for programming purpose.

Step 4: Project Step2: Upload IR Robot Code and Play

his is the code for IR robot:
Type your 5 button s code in if else if statement in bellow code. The shown value is my remote value.

Use 5 button to control robot forward, reverse, left right and stop

#include <IRremote.h>

int RECV_PIN = 11;

int statusled = 13;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()

{

irrecv.enableIRIn();

pinMode(statusled,OUTPUT);

pinMode(7,OUTPUT);

pinMode(6,OUTPUT);

pinMode(5,OUTPUT);

pinMode(4,OUTPUT);

digitalWrite(statusled,LOW);

}

void loop() {

if (irrecv.decode(&results)) {

digitalWrite(statusled,HIGH);

irrecv.resume();

if (results.value == 0xFF50AF){ // type your remote forward robot control button hex value in underlined area.

digitalWrite(7,HIGH);

digitalWrite(6,LOW);

digitalWrite(5,HIGH);

digitalWrite(4,LOW);

}else if(results.value == 0xFF30CF){ // type your remote left robot control button hex value in underlined area.

digitalWrite(7,HIGH);

digitalWrite(6,LOW);

digitalWrite(5,LOW);

digitalWrite(4,LOW);

}

else if(results.value == 0xFFB04F){ // type your remote right robot control button hex value in underlined area.

digitalWrite(7,LOW);

digitalWrite(6,LOW);

digitalWrite(5,HIGH);

digitalWrite(4,LOW);

} else if(results.value == 0xFFD02F){ // type your remote backward robot control button hex value in underlined area.

digitalWrite(7,LOW);

digitalWrite(6,HIGH);

digitalWrite(5,LOW);

digitalWrite(4,HIGH);

}else if(results.value == 0xFF9867){ // type your remote stop robot control button hex value in underlined area.

digitalWrite(7,LOW);

digitalWrite(6,LOW);

digitalWrite(5,LOW);

digitalWrite(4,LOW);

}

}

}

That it once you upload it you are ready to go connect the robot with battery and play. I hope that you are all like my project

Thank you all

Comments

author
xanderojones (author)2017-04-27

Hi vigneshraja, I am in the middle of building this and have your vid a few times, could you tell which wheels are actually being driven by the motors, is it the front, back or all 4? thx for the help/guidance :)

author
Varun Chothani (author)2016-07-07

dude i am stuck at the first step , my serial monitor is not showing any o/p against i/p from receiver but instead when i am pulling and re inserting the o/p pin the 'tx' pin glows and some random value is displaced in the serial monitor

author
DennisB36 (author)Varun Chothani2017-01-19

What???? Sorry too much i/p, o/p, xyx for me. Mine is working great, but can't interface with your acronyms.

author

Same happened with me

author
robobot3112 (author)2014-10-11

nice use of elseif statement , not confusing and clear the code is . good job

author
vigneshraja (author)robobot31122014-10-12

Thank you

author
NeranjanM (author)vigneshraja2016-11-27

i have a some code your but my pc in missin can you help me give the code me please ,

my email address/////// neranjanmadhumal@gmail.com please send me...

author
hlin8 (author)2016-08-17

i like

author
Varun Chothani (author)2016-07-07

dude i am stuck at the first step , my serial monitor is not showing any o/p against i/p from receiver but instead when i am pulling and re inserting the o/p pin the 'tx' pin glows and some random value is displaced in the serial monitor

author
seamster (author)2014-09-05

Interesting!

author
vigneshraja (author)seamster2014-09-05

Thank you

author
JeyenD (author)vigneshraja2016-04-11

bro plse your project step by step connection images send me bro.....plszzzz

author
Vj sri (author)2016-02-24

How to delete robotIRremote library?

author
Verkoda (author)2016-01-22

did anyone else get "error: 'volatile struct irparams_t' has no member named 'rawlen'"?

author
Verkoda (author)2016-01-22

Surprisingly difficult to immediately get my hands on a LM293D, so I just picked up a SEEED motor shield. Fingers crossed

author
AfshaanLondhe (author)2016-01-17

great project!

author
satvik.gupta.129 (author)2015-06-10

Can I use ir sensor module instead of ir receiver????

And from where did u bought ir receiver???

author

http://www.amazon.in/dp/B0126YIXZ6/ref=wl_it_dp_o_pC_nS_ttl?_encoding=UTF8&colid=3BYAGD7INLQUW&coliid=I21GFVUSAD70F7

author

u can get it on amazon

author
kahan123 (author)2015-11-27

HI I m khan....i have uploaded the program but its not working

kindly tel me what should i do

author
kahan123 (author)2015-11-27

HI I m khan....i have uploaded the program but its not working

kindly tel me what should i do

author
kahan123 (author)2015-11-27

my device is not working

author
ROMINS (author)2015-08-04

i seen some error in code will executing the code in 123D circuits

"no name type is defined"

kindly please help in coding

so please send me the codes that you are executed in doing the project

author
PikuS (author)2015-03-25

i have a problem frist it works fine but some how a little time later its stuck and not respond with any command when i rest it working again but again the same problem occurs.

author
altair827 (author)2015-03-22

I got a problem... I successfully made it.. but i lost 3 l293d IC in a day... I gave the conection without giving 5v to the enable pins and the vcc1.. Is that the reason??

author
yogeeshnaik (author)2015-01-24

hai my name is yogeesh..i was trying to work on the above project..hardware is fine but the software library which is shown for aurdino is not working ..even the example program in the IRremote library is showing error..please help me someone ..any suggestion is welcomed .and the error is

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Arduino NG or older w/ ATmega8"
C:\Program Files (x86)\Arduino\libraries\RobotIRremote\IRremoteTools.cpp:5: error: 'TKD2' was not declared in this scope

author
sujit pal (author)yogeeshnaik2015-03-11

Hi Yogesh, I know what problem ur facing bcas some time ago I was also having same issue. try this

1. first follow

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\ and delete the file IRremoteTools.cpp

2. delete include line of your code

3. paste this before first line of ur program

#include "IRremote.h"
#include <Arduino.h>


int RECV_PIN = 15; // the pin the IR receiver is connected to
IRrecv irrecv(RECV_PIN); // an instance of the IR receiver object
decode_results results; // container for received IR codes

void beginIRremote(){
irrecv.enableIRIn(); // Start the receiver
}

bool IRrecived(){
return irrecv.decode(&results);
}

void resumeIRremote(){
irrecv.resume(); // resume receiver
}

unsigned long getIRresult(){
return results.value;
}

4. it will still give you some error saying duplicate initialization

just delete initialization lines from ur actual code

author
kavinmk (author)yogeeshnaik2015-02-18

That is a hardware issue. The particular IR library uses more PWM ports than atmega8 has. So the library dosn't work with the board. But there is always a way . Even I am struggling to find that way .

author
gemmao (author)2015-03-09

what if I used Arduino ATmega 128, does the code doesn't need to change?

author
vigneshraja (author)gemmao2015-03-10

no you don't need to change the code. use the same code with ATmega128

author
PiotrG1 (author)2015-03-08

Też miałem ten problem lecz należy wejść Arduino \ Biblioteki \ RobotIRremote

usunac tam wszystkie pliki a nastepnię wszystkimi tymi prócz folderu je tam wsawić

author
yogeeshnaik (author)2015-01-24

hai my name is yogeesh..i was trying to work on the above project..hardware is fine but the software library which is shown for aurdino is not working ..even the example program in the IRremote library is showing error..please help me someone ..any suggestion is welcomed .and the error is

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Arduino NG or older w/ ATmega8"
C:\Program Files (x86)\Arduino\libraries\RobotIRremote\IRremoteTools.cpp:5: error: 'TKD2' was not declared in this scope

author
kavinmk (author)yogeeshnaik2015-02-18

You can't use the IRLibrary on Atmega8 because the library uses more than 3 PWM ports and 2 timers, I think so.But there is always another way, even I am struggling with this

author
Arduino Tech (author)2015-02-01

In the IR remote button value reading sketch with on every it shows 0 only. Help me

author
vigneshraja (author)Arduino Tech2015-02-01

Which type of ir receiver you are using. make sure about ir receiver pin connection with arduino. because different type of pin configuration ir receivers available in market. make sure your ir receiver pinout configuration. connect it with arduino properly. and try again

author
Arduino Tech (author)2015-02-01

In the IR remote button value reading sketch with on every it shows 0 only. Help me

author
Arduino Tech (author)2015-02-01

In the IR remote button value reading sketch with on every it shows 0 only. Help me

author
Arduino Tech (author)2015-02-01

In the IR remote button value reading sketch with on every it shows 0 only. Help me

author
Arduino Tech (author)2015-02-01

In the IR remote button value reading sketch with on every it shows 0 only. Help me

author
Arduino Tech (author)2015-02-01

In the IR remote button value reading sketch with on every it shows 0 only. Help me

author
Arduino Tech (author)2015-02-01

In the IR remote button value reading sketch with on every it shows 0 only. Help me

author
Arduino Tech (author)2015-02-01

In the IR remote button value reading sketch with on every it shows 0 only. Help me

author
sks.rock.224677 (author)2015-01-16

hi vignesh i have a grt doubt please clarify as soon s possible.i cant undstnd how to connect 4 motors with l293d.as u have shown pin 3,6 for 1 motor and pic 14,11 for another bt where the rest to motor will b connected.

thankyou in advance :)

author

hi

only two motors can used with l293d ic . in my robot i used only two motors other two are just two wheels without motor. it is enough to use two motors with robot to work robot finely. if you want to use extra two motors then u need another l293d ic and some changes in above given code.

author
krishnasgwd (author)2015-01-13

thank u instructable and vignesh :-) its working well..keep posting new projects.

author
BobS12 (author)2015-01-04

Excellent Instructable! I installed this on my robot and works perfectly. Thanks for the clear instructions and code!

Advice for anyone who has a Seed Studio Motor controller; Digital pins 8-13 are in use by the motor shield, so the D11 pin will not work. Pins D2-D7 work fine, though.

author
vigneshraja (author)BobS122015-01-04

Thank you.

if you use seed studio motor shield. then u can't use the pin 11 for sensor receiver.so you can use any other pin between pin 2 to 7 by changing code int RECV_PIN = 11; to int RECV_PIN = 5; or some other pin between pin 2 -7.

and also change my code from

pinMode(7,OUTPUT);

pinMode(6,OUTPUT);

pinMode(5,OUTPUT);

pinMode(4,OUTPUT);

to

pinMode(8,OUTPUT);

pinMode(11,OUTPUT);

pinMode(12,OUTPUT);

pinMode(13,OUTPUT);

for motor input pins

author
sks.rock.224677 (author)2014-12-28

first of all thnx a lot vigneshraja fr this awsm description...i have one doubt tht u have conncted 4-5 resistors,4-5 leds and diode of which u havent given any description.nw i am luking forward for making this robot if u say about this in detail i will b obliged to u.thnku in advance :)

author

hi

Thank you for your appreciation. In video i used h bridge module available in the store to drvie motor. so it had leds and resistors to just show the input and output status of L293d ic pins. it is not necessary to have it if you design circuit your own.above in second step i newly add the circuit of the robot. use that connection to design robot circuit.it is enough connection to run robot well. no need to add that module stuffs like leds and resistors.

author
ibenkos (author)2014-10-18

Smart idea! I really like this project. Thanks for shearig :)