Let's Make Robots!

Obstacle Avoidance Robot Car - Arduino

The robot moves avoiding obstacles and choosing the best way to follow by ultrasound.
IRremote.zip33.18 KB
Code_for_Obstacle_Avoidance_Arduino_Robot.txt7.38 KB

The programming code is attached here as a .txt file. Download it and paste the text on the Arduino compiler.
Remember to add the IRremote library (also attached to this post) to your arduino software before trying to compile the code! 

Further information about motor controller and IR receiver here:

I bought the robot from:

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
I see another arduino shield above .Can anyone tell me that is, if we have the H bridge below?.Would serve any remote or has to be one specific?. Thanks.

Thank you for sharing . I have got code . But i don't have neither schematic capture nor writing diagram of project . please send it for me .

 My gmail is : timlaibautroi090792@gmail.com

Thank you so much !

I have bought kit, sensor shield is v4.0 , can you please help me in wiring this ? i am really confused and i am very new to this....

i have tried searching on google so far i am not able to figure it out completely. 

please i need help

You may check my wiring in the pictures i posted earlier in this blog. Look for them. Good luck!


i have the same robot, i have the same robot. But cannot start motors for drive the wheels.I wired the robot as in description here.

May I ask question about wiring.

1) did you connect 5V and GND contacts of motor shield to Sensor shield V5?

2) Did you connect ENA and ENB port of motor shield to sensor shield V5? In your code these ports are not declared. You dont use them? How you enable motors to start?


Can you please help me in the wiring? and where should i put the ENA & ENB pins? 

i put the wires just like you said, downloaded the IR library and installed it, and uploaded the script. Now all that happens when I press the '1' button is the robot judt keeps moving forward. I tried to move the head thinking that the servo was stuck, but the head (the ultrasonic sensor) would just vibrate in its place. You got any idea about what's happening?


Microservo must be connected to pin number 5.. just in case

Check the wiring of the microservo and ensure that you are using the correct pin according to the programming code. 

Sorry if im asking too much, but if you're an expert programmer, please help me with this:

i downloaded a script for arduino: (this is part of it)

#include "Ultrasonic.h"

#include <Servo.h>

#include <Motor.h>

Ultrasonic ultrasonic(12,13); // 12->trig, 13->echo

Servo myservo; // create servo object to control a servo

Motor motor;


it's showing me this and not letting me compile:'Ultrasonic' does not name a type

What does this mean? And what should i do to fix it?