RoboCUST Robotics Competition Organized by SEEK & IEEE at Capital University of Science and Technology, Islamabad π March 2nd, 2024
π· Gallery β’ π§ How It Works β’ π οΈ Hardware β’ π Getting Started β’ π Achievement
An autonomous robot car that detects obstacles using an ultrasonic sensor and steers around them in real-time β battle-tested by winning a live robotics maze competition!
This car was built as a semester project for Digital Logic Design (DLD) and later competed in the RoboCUST 2024 Robotics Competition where it won 1st place in the Robo Maze category. It operates fully autonomously β no remote control, no pre-programmed path β using real-time ultrasonic sensing to navigate through obstacles.
| Step | Action | Description |
|---|---|---|
| 1οΈβ£ | Measure | HC-SR04 ultrasonic sensor continuously reads distance ahead |
| 2οΈβ£ | React | Stops, reverses, and scans left & right when obstacle is within 15cm |
| 3οΈβ£ | Decide | Turns toward whichever side has more open space |
| 4οΈβ£ | Continue | Drives forward with smooth speed ramp-up to protect battery |
| # | Component | Details |
|---|---|---|
| 1 | Microcontroller | Arduino Uno |
| 2 | Motor Driver | Adafruit Motor Shield v1 |
| 3 | Drive Motors | DC Gear Motors (x4) |
| 4 | Steering | SG90 Servo Motor |
| 5 | Distance Sensor | HC-SR04 Ultrasonic Sensor |
| 6 | Wheels | Rubber wheels compatible with TT gear motors |
| 7 | Power Supply | 18650 Li-ion Battery |
| 8 | Wiring | Male & Female Jumper Wires |
Install all three via Sketch β Include Library β Add .ZIP File:
| Library | Purpose | Download |
|---|---|---|
| AFMotor | Controls DC motors via Motor Shield | adafruit.com |
| NewPing | Reads HC-SR04 ultrasonic sensor | GitHub |
| Servo | Controls servo motor direction | GitHub |
| Component | Arduino Pin |
|---|---|
| HC-SR04 TRIG | A0 |
| HC-SR04 ECHO | A1 |
| Servo Signal | D10 |
| Motor 1 & 2 | Motor Shield Port 1 & 2 |
| Motor 3 & 4 | Motor Shield Port 3 & 4 |
π‘ Motors are controlled through the Motor Driver Shield β connect them to the shield's screw terminals, not directly to Arduino pins. The 18650 battery powers the motors via the shield's power input.
Tweak these values at the top of the sketch to tune your car's behavior:
#define MAX_DISTANCE 200 // Maximum sonar range (cm)
#define MAX_SPEED 190 // Motor top speed (0β255)
#define MAX_SPEED_OFFSET 20 // Speed offset between motors# 1. Clone this repository
git clone https://github.com/huda-usman/Obstacle-Avoidance-Car.git
# 2. Open in Arduino IDE
# File β Open β ObstacleAvoidanceCar/ObstacleAvoidanceCar.ino
# 3. Install the three required libraries (see above)
# 4. Select board: Tools β Board β Arduino Uno
# 5. Upload and watch it go! πObstacle-Avoidance-Car/
βββ ObstacleAvoidanceCar.ino # Main Arduino sketch
βββ photo.png # The Maze-Solver-Car + shield photo
βββ .gitignore # Git ignore rules
βββ README.md # This file
| π Event | RoboCUST Robotics Competition 2024 |
| π Category | Robo Maze |
| π₯ Result | 1st Position |
| ποΈ Venue | Capital University of Science and Technology, Islamabad |
| π₯ Organizers | SEEK & IEEE CUST Student Branch |
| π Date | March 2nd, 2024 |
The car navigated a physical maze entirely autonomously using only ultrasonic sensing β no pre-programmed path, no mapping, pure real-time obstacle avoidance β and took 1st place among all competing teams.
This project is open-source under the MIT License.
- Adafruit for the Motor Shield library
- Tim Eckel for the NewPing library
- SEEK & IEEE CUST for organizing RoboCUST 2024
