
The smart robot car is one of the most popular beginner robotics projects, combining motor control and remote sensing to build a small vehicle that can move and avoid obstacles automatically with no human intervention.
Components needed
An Arduino Uno R3 board, an L293D motor driver shield to control two motors at once, two geared DC motors (1:48 gear ratio, 3-6V operating voltage) to drive the rear wheels, a caster wheel for front stability, an HC-SR04 ultrasonic distance sensor, an SG90 servo motor to rotate the sensor, and a 4-pack of AA batteries to power the motors.
Wiring it up
The L293D shield mounts directly on top of the Arduino board, and the motors connect to its dedicated motor terminals. The HC-SR04 sensor is mounted on the servo motor's arm, which connects to a servo pin dedicated on the shield, allowing the sensor to sweep left and right without moving the car's wheels themselves.
How it works
The car moves forward continuously while the sensor measures the distance to the nearest obstacle ahead. When an obstacle comes within 15 centimeters or closer, the car stops and reverses, then the servo motor rotates the sensor first to the left and then to the right to take a distance reading from each side. The code compares the two readings and picks the direction with more room to maneuver, steering the car that way and continuing forward, with this cycle repeating continuously to achieve automatic obstacle avoidance.
You can find the L293D shield, robot motors, the HC-SR04 sensor, and the SG90 servo at Juthour Tech.
اترك تعليقا