CIRCUIT DIAGRAM:
This project builds a smart robotic car that detects and avoids obstacles automatically using an ultrasonic sensor. It can navigate its surroundings without crashing into objects.
Components Needed:
Arduino UNO
Ultrasonic Sensor (HC-SR04)
L293 Motor Driver shield
2 or 4 DC Motors (depending on design)
Wheels
Chassis
Jumper Wires
Power Supply (Battery)
Working Principle:
The ultrasonic sensor measures the distance between the car and any obstacle.
If the obstacle is far, the car moves forward.
If the obstacle is too close (e.g., less than 15 cm), the car stops, then turns left or right to avoid the obstacle.
All decisions are controlled by the Arduino UNO.
Ultrasonic Sensor Working:
Trig pin sends out ultrasonic pulses.
Echo pin receives the pulse back after bouncing off an object.
The time difference is used to calculate the distance.
Formula:
cpp
CopyEdit
distance = (time × speed of sound) / 2
Speed of sound = 343 m/s = 0.0343 cm/µs