Virtual Obstacle Avoidance Robot
by codingwitht2 in Circuits > Arduino
133 Views, 1 Favorites, 0 Comments
Virtual Obstacle Avoidance Robot
The following items are required in the TinkerCAD software to design the project:
- Arduino UNO R3-1nos.
- L293D H Bridge motor driver IC-1nos.
- HC-SR04 Ultrasonic distance sensor-1nos.
- Small Breadboard-1nos.
- Gearmotor -2nos.
CONNECTING ULTRASONIC SENSOR WITH ARDUINO
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
CONNECT BOTH THE MOTORS AND L293D MOTOR DRIVER AS SHOWN IN THE GIVEN PICTURE
WRITING THE CODE
WRITE THE FOLLOWING CODE WHEN YOUR CONNECTIONS ARE OVER IN THE TinkerCAD software as shown in the given picture