Arduino Robot
![pik 008.jpg](/proxy/?url=https://content.instructables.com/FOH/5T9P/I6000RBI/FOH5T9PI6000RBI.jpg&filename=pik 008.jpg)
Ever thought about building a robot but think that it`s too difficult, well now it`s not. It is a simple robot which is operated by an arduino and what it does is that it just roams around and avoids obstacles. It detects the obstacles with a HC-SR04 ultrasonic sensor. It is a simple project which anyone can build. Lets get started !!
Materials Required
![ins 002.jpg](/proxy/?url=https://content.instructables.com/FDY/V4HX/I4PHUC6G/FDYV4HXI4PHUC6G.jpg&filename=ins 002.jpg)
![pik 002.jpg](/proxy/?url=https://content.instructables.com/FPN/OMOZ/I5TI2HDR/FPNOMOZI5TI2HDR.jpg&filename=pik 002.jpg)
![pik 003.jpg](/proxy/?url=https://content.instructables.com/FXQ/PPM6/I5TI2HE9/FXQPPM6I5TI2HE9.jpg&filename=pik 003.jpg)
![pik.jpg](/proxy/?url=https://content.instructables.com/F38/M0Z1/I5TI2HHR/F38M0Z1I5TI2HHR.jpg&filename=pik.jpg)
![ins 001.jpg](/proxy/?url=https://content.instructables.com/F86/KP1Z/I4PHUC64/F86KP1ZI4PHUC64.jpg&filename=ins 001.jpg)
![pik 001.jpg](/proxy/?url=https://content.instructables.com/F6N/O7VW/I5TI2HDJ/F6NO7VWI5TI2HDJ.jpg&filename=pik 001.jpg)
![pik 004.jpg](/proxy/?url=https://content.instructables.com/FPJ/SY1P/I5TI2HEF/FPJSY1PI5TI2HEF.jpg&filename=pik 004.jpg)
1. Arduino
2. HC-SR04
3. Robot chassis and motors
4. L293D IC
5. Breadboard
6. Jumper wires
7. 9v Battery
8. AA battery back (9v)
9. Double sided foam tape
And that's it !!
Wiring and Schematic
![arduino robot schematic.jpg](/proxy/?url=https://content.instructables.com/FAD/AE73/I5TI2IVV/FADAE73I5TI2IVV.jpg&filename=arduino robot schematic.jpg)
![pik 005.jpg](/proxy/?url=https://content.instructables.com/FKT/A6O4/I5TI2IWR/FKTA6O4I5TI2IWR.jpg&filename=pik 005.jpg)
![pik 006.jpg](/proxy/?url=https://content.instructables.com/F1Y/GYBG/I5TI2IXI/F1YGYBGI5TI2IXI.jpg&filename=pik 006.jpg)
![pik 007.jpg](/proxy/?url=https://content.instructables.com/FD4/85UH/I5TI2J04/FD485UHI5TI2J04.jpg&filename=pik 007.jpg)
![l293d-motor-surucu-entegresi.png](/proxy/?url=https://content.instructables.com/FND/UUOK/I6000L1C/FNDUUOKI6000L1C.png&filename=l293d-motor-surucu-entegresi.png)
You may find this step a bit complicated but its not. Follow these steps:
1. Connect pin 1, 9 and 16 together and connect it to 5v
2. Connect pin 4,5,12,13 together and connect it Gnd
3. Connect your 1st motor to pin 3 and 6
4. Connect your 2nd motor to pin 11 and 14
5. Connect pin 15 to digital pin 8
6. Connect pin 10 to digital pin 9
7. Connect pin 2 to digital pin 10
8. Connect pin 7 to digital pin 11
9. Connect HC-SR04 Vcc pin to 5v and Gnd to Gnd
10. Trig to digital pin 3 and Echo to digital pin 2
11. Battery pack's positive to IC pin 8 and Battery pack's Gnd to Gnd
12. Connect 9v battery's positive to Vin on Arduino and Gnd to Gnd
Programming
![sketch.bmp](/proxy/?url=https://content.instructables.com/FUZ/AJA3/I6000OD7/FUZAJA3I6000OD7.bmp&filename=sketch.bmp)
The code very easy. You can also change the code and try different things. If the robot is going in weird directions, try changing all the digitalWrite, HIGH to digitalWrite, LOW and all the digitalWrite, LOW to digitalWrite, HIGH.
For the code to work you have to download the NewPing library from this link: http://playground.arduino.cc/Code/NewPing#Download. And then it put in the arduino library folder.
Have Fun !!