loading

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

<p>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 :)</p>
<p>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</p>
<p>What???? Sorry too much i/p, o/p, xyx for me. Mine is working great, but can't interface with your acronyms.</p>
Same happened with me
<p>nice use of elseif statement , not confusing and clear the code is . good job</p>
<p>Thank you</p>
<p>i have a some code your but my pc in missin can you help me give the code me please ,</p><p>my email address/////// neranjanmadhumal@gmail.com please send me...</p>
<p>i like</p>
<p>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</p>
<p>Interesting!</p>
<p>Thank you</p>
<p>bro plse your project step by step connection images send me bro.....plszzzz</p>
How to delete robotIRremote library?
<p>did anyone else get &quot;error: 'volatile struct irparams_t' has no member named 'rawlen'&quot;?</p>
Surprisingly difficult to immediately get my hands on a LM293D, so I just picked up a SEEED motor shield. Fingers crossed
<p>great project!</p>
<p>Can I use ir sensor module instead of ir receiver????</p><p>And from where did u bought ir receiver??? </p>
<p>http://www.amazon.in/dp/B0126YIXZ6/ref=wl_it_dp_o_pC_nS_ttl?_encoding=UTF8&amp;colid=3BYAGD7INLQUW&amp;coliid=I21GFVUSAD70F7</p>
<p>u can get it on amazon </p>
<p>HI I m khan....i have uploaded the program but its not working </p><p>kindly tel me what should i do</p>
<p>HI I m khan....i have uploaded the program but its not working </p><p>kindly tel me what should i do</p>
<p>my device is not working</p>
<p>i seen some error in code will executing the code in 123D circuits</p><p>&quot;no name type is defined&quot;</p><p>kindly please help in coding</p><p>so please send me the codes that you are executed in doing the project</p>
<p>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.</p>
<p>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??</p>
<p>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 </p><p>This report would have more information with <br> &quot;Show verbose output during compilation&quot; <br> enabled in File &gt; Preferences. <br>Arduino: 1.0.6 (Windows 7), Board: &quot;Arduino NG or older w/ ATmega8&quot; <br>C:\Program Files (x86)\Arduino\libraries\RobotIRremote\IRremoteTools.cpp:5: error: 'TKD2' was not declared in this scope</p>
<p>Hi Yogesh, I know what problem ur facing bcas some time ago I was also having same issue. try this</p><p>1. first follow </p><p>C:\Program Files (x86)\Arduino\libraries\RobotIRremote\ and delete the file IRremoteTools.cpp </p><p>2. delete include line of your code</p><p>3. paste this before first line of ur program</p><p>#include &quot;IRremote.h&quot;<br>#include &lt;Arduino.h&gt;<br><br><br>int RECV_PIN = 15; // the pin the IR receiver is connected to<br>IRrecv irrecv(RECV_PIN); // an instance of the IR receiver object<br>decode_results results; // container for received IR codes<br><br>void beginIRremote(){<br> irrecv.enableIRIn(); // Start the receiver<br>}<br><br>bool IRrecived(){<br> return irrecv.decode(&amp;results);<br>}<br><br>void resumeIRremote(){<br> irrecv.resume(); // resume receiver<br>}<br><br>unsigned long getIRresult(){<br> return results.value;<br>}</p><p>4. it will still give you some error saying duplicate initialization</p><p>just delete initialization lines from ur actual code </p>
<p>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 .</p>
<p>what if I used Arduino ATmega 128, does the code doesn't need to change?</p>
<p>no you don't need to change the code. use the same code with ATmega128</p>
<p>Też miałem ten problem lecz należy wejść Arduino \ Biblioteki \ RobotIRremote </p><p>usunac tam wszystkie pliki a nastepnię wszystkimi tymi pr&oacute;cz folderu je tam wsawić</p>
<p>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 </p><p>This report would have more information with <br> &quot;Show verbose output during compilation&quot; <br> enabled in File &gt; Preferences. <br>Arduino: 1.0.6 (Windows 7), Board: &quot;Arduino NG or older w/ ATmega8&quot; <br>C:\Program Files (x86)\Arduino\libraries\RobotIRremote\IRremoteTools.cpp:5: error: 'TKD2' was not declared in this scope</p>
<p>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</p>
<p>In the IR remote button value reading sketch with on every it shows 0 only. Help me</p>
<p>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 </p>
<p>In the IR remote button value reading sketch with on every it shows 0 only. Help me</p>
<p>In the IR remote button value reading sketch with on every it shows 0 only. Help me</p>
<p>In the IR remote button value reading sketch with on every it shows 0 only. Help me</p>
<p>In the IR remote button value reading sketch with on every it shows 0 only. Help me</p>
<p>In the IR remote button value reading sketch with on every it shows 0 only. Help me</p>
<p>In the IR remote button value reading sketch with on every it shows 0 only. Help me</p>
<p>In the IR remote button value reading sketch with on every it shows 0 only. Help me</p>
<p>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.</p><p>thankyou in advance :)</p>
<p>hi </p><p>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.</p>
<p>thank u instructable and vignesh :-) its working well..keep posting new projects.</p>
<p>Excellent Instructable! I installed this on my robot and works perfectly. Thanks for the clear instructions and code!</p><p>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.</p>
<p>Thank you.</p><p>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.</p><p>and also change my code from</p><p> pinMode(7,OUTPUT);</p><p>pinMode(6,OUTPUT);</p><p>pinMode(5,OUTPUT);</p><p>pinMode(4,OUTPUT);</p><p>to</p><p> pinMode(8,OUTPUT);</p><p> pinMode(11,OUTPUT);</p><p>pinMode(12,OUTPUT);</p><p>pinMode(13,OUTPUT);</p><p>for motor input pins</p>
<p>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 :)</p>
<p>hi </p><p>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.</p>
Smart idea! I really like this project. Thanks for shearig :)

About This Instructable

58,856views

53favorites

License:

More by vigneshraja:Speed control of dc motor from laptop using arduino and processing Program Arduino Pro Mini Using Arduino Uno Touch switch for MSP430 launchpad 
Add instructable to: