Virtual Obstacle Avoidance Robot

by codingwitht2 in Circuits > Arduino

128 Views, 1 Favorites, 0 Comments

Virtual Obstacle Avoidance Robot

Arduino Uno R3.png
breadboard.png
l293d.png
motor.png
ultrasonic sensor.png

The following items are required in the TinkerCAD software to design the project:

  1. Arduino UNO R3-1nos.
  2. L293D H Bridge motor driver IC-1nos.
  3. HC-SR04 Ultrasonic distance sensor-1nos.
  4. Small Breadboard-1nos.
  5. Gearmotor -2nos.

CONNECTING ULTRASONIC SENSOR WITH ARDUINO

ultrasonic sensor circuit.png

Arduino being the brain of this project will read ultrasonic sensor, so we need to connect the ultrasonic sensor to arduino uno correctly.

You can connect it by seeing the given picture or by reading the connections below:

  • Arduino's GND power pin to the negative terminal pin of the breadboard
  • Arduino's 5V power pin to the positive terminal pin of the breadboard

Note: Be sure to connect both the upper and lower negative terminal pins together and positive terminal pins together in the breadboard

  • Connect trig pin of the ultrasonic sensor to the arduino's digital pin no 6
  • Connect echo pin of the ultrasonic sensor to the arduino's digital pin no 7
  • Connect VCC pin of the ultrasonic sensor to the breadboard's positive terminal pin
  • Connect GND pin of the ultrasonic sensor to the breadboard's negative terminal pin

CONNECTIONS OF L293D AND MOTOR

full circuit.png

CONNECT BOTH THE MOTORS AND L293D MOTOR DRIVER AS SHOWN IN THE GIVEN PICTURE

WRITING THE CODE

code.png
VIRTUAL CREATION OF OBSTACLE AVOIDANCE ROBOT

WRITE THE FOLLOWING CODE WHEN YOUR CONNECTIONS ARE OVER IN THE TinkerCAD software as shown in the given picture