Arduino Obstacle Avoiding Robot

by arnavssgk4770 in Circuits > Arduino

412 Views, 0 Favorites, 0 Comments

Arduino Obstacle Avoiding Robot

0025.jpg

Hello Everyone,

In this instructable, I will instruct you how to make an obstacle avoiding robot step by step. I will use my all efforts to make these instructions clear and easy and I will also give you a tip on each step. This robot will avoid the obstacle and when any obstacle comes it will stop moving forward and goes some step backwards and look left and right and move to the best position.

Supplies

Uno-R3-CH340G-ATmega328p-Development-Board-Compatible-with-Arduino2.png
QC0408_1_grande.jpg
castor-wheel-parts_1024x1024.jpg
L298N2ABasedMotorDriverModule_1024x1024.jpg
geared-dc-motor-wheel_grande.jpg
dc-geared-motor_grande.jpg
hc-sr04_ultrasonic_sensor_distance_measuring_module_1_.jpg
Micro-Servo-SG90-9G-Eletronic-Module-RC.jpg
SYB-170MiniBreadboard_grande.jpg
WhiteSpongeDouble-SidedTape_852b13ee-44a6-4c95-aaea-803e4da9c151_1024x1024.jpg

Making of Chassis

0001.jpg
0002.jpg
0003.jpg
0004.jpg
  • Take a piece of MDF board and cut it with the size of 15cm x 10cm.
  • Place the components and mark them for making the holes.
  • Make a hole for screwing the components on the MDF board.

Tip: If you do not have the proper tool for making the hole, make a small hole with the tip of the compass and make it large with the help of a screw.

Assembling the Chasis

0005.jpg
0006.jpg
0007.jpg
0012.jpg
0013.jpg
0008.jpg
0010.jpg
0009.jpg
0011.jpg
0014.jpg
  • Screw UNO and motor driver on chassis with help of screws.
  • Stick the BO motor, Castor Wheel, Battery, and Servo motor in the chassis with double side tape as shown in the image.
  • Stick the connector of the output shaft of the servo motor to the mini breadboard with a glue gun or super glue.
  • Place the ultrasonic sensor on the breadboard.

Tip: Do not screw the UNO tightly on the chassis because it may damage the UNO.

Connections

WhatsApp Image 2021-11-08 at 1.11.32 PM.jpeg
0017.jpg
0019.jpg
0018.jpg
0016.jpg
0015.jpg

Now the main part of this robot has come I will write all the steps very clearly so you did not face any issue in connections. Refer to the circuit diagram for more clearance.

  • Connect ENA and ENB to 5v of motor driver.
  • Connect IN1 to pin 4 of UNO.
  • Connect IN2 to pin 5 of UNO.
  • Connect IN3 to pin 6 of UNO.
  • Connect IN4 to pin 7 of UNO.
  • Connect 5v of Motor Driver to VIN pin of UNO.
  • Connect GND of Motor Driver to GND pin of UNO.
  • Connect Servo orange wire to pin 10 of UNO.
  • Connect Ultrasonic sensor Vcc, Trig, Echo, GND pin to pin 5v, A1, A2, Gnd respectively of UNO on the breadboard.
  • Connect Servo red and brown wire to the same Vcc and GND pin of Arduino respectively in the breadboard.( If you are getting confused in this step refer to images.)
  • Connect BO motors to the motor driver.
  • Connect battery - directly to Motor driver and connect a wire in Vcc pin of Motor driver to use it as a switch by connecting and disconnecting the wire to Battery +.

Tip: Use red wire for + and black for - it will help you to do the connections easily.

Programming the Arduino Uno

0022.jpg

Download and Install the Arduino Desktop IDE

Download the New ping library and extract it to C:\Arduino\libraries. You can also install this library directly from Arduino IDE. For installing the library from Arduino IDE go to Tools<Manage Libraries<Search for New Ping and install it.

  • Paste the code in Arduino IDE and choose the correct port and programmer and upload it to UNO by programming cable of UNO.

Download the New Ping Library from https://bitbucket.org/teckel12/arduino-new-ping/downloads/NewPing_v1.9.1.zip

Tip: If you are getting an error in uploading the code try removing all the connected pins to UNO.

Downloads

Final Touch to Robot

0026.jpg
0020.jpg
0021.jpg
0024.jpg
  • Connect breadboard to the servo output shaft.
  • Connect wheels to the motor.
  • Stick the wires to the chassis by double side tape.

Enjoy!! Now your robot is ready to avoid obstacles. Have Fun!