This project features a smart 4-wheel drive robot car controlled by an Arduino Uno. The robot can operate in two distinct modes, switchable via a push button: a Line Follower mode that tracks a black line using two IR sensors, and an Obstacle Avoidance mode that uses an ultrasonic sensor to navigate around obstacles. A buzzer provides audio alerts when switching modes and when encountering obstacles.
To understand multi-sensor integration (IR and Ultrasonic) in Arduino.
To implement a finite state machine (switching modes with a button).
To master multi-motor control for advanced robotic maneuvers.
To practice obstacle detection and avoidance logic.
Arduino Uno R3
2x L298N Dual H-Bridge Motor Drivers
4x DC Geared Motors with wheels
HC-SR04 Ultrasonic Sensor
2x IR Line Tracking Sensors
Push Button
Active/Passive Buzzer
External Battery Pack (e.g., 2x 18650 Li-ion)
Jumper wires & Chassis
We used two L298N drivers instead of one to allow independent speed and direction control for all four motors. By doing this, we avoid connecting the front and rear motors in parallel on the same driver. This provides much smoother movement and greater control over dynamic maneuvers (like pivot turns and smooth curved steering), ensuring high performance for the robot.
We held a kickoff meeting with the team (consisting of me, Maryam, and Eng. Rawan) to establish the workflow and distribute the tasks as follows:
Mr : Ibrahim: Responsible for detailing and wiring the electrical circuits.
Eng. Rawan: Responsible for the chassis assembly and mechanical structure of the car.
Eng. Maryam: Responsible for the software, writing, adjusting, and optimizing the code.
We began our practical work by focusing primarily on building and calibrating the obstacle avoidance system to ensure the basic movement logic was working correctly.
The car did not succeed on the first attempt. We conducted numerous tests and faced several failures, but we iterated and repeated the process until we achieved success.
Based on a valuable suggestion/proposal from Eng. Abdelrahman, we decided to add an RGB LED and a Buzzer to the system. This addition was meant to provide visual and audio alerts when an obstacle is detected.
Now, whenever the car detects an obstacle, the buzzer sounds an alarm and the RGB LED glows bright red. The final results were absolutely stunning and impressive!