Skip to content

huda-usman/Obstacle-Avoidance-Car

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Arduino Language Status Competition DLD


πŸ† 1st Position β€” Robo Maze Category

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


πŸŽ“ About This Project

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.


πŸ“· The Car in Action

The Maze-Solver-Car alongside its 1st place shield from RoboCUST 2024 πŸ†


🧠 How It Works

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

πŸ› οΈ Hardware Used

# 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

πŸ“¦ Libraries Required

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

πŸ”Œ Wiring / Pin Connections

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.


βš™οΈ Configuration

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

πŸš€ Getting Started

# 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! πŸš—

πŸ“ Repository Structure

Obstacle-Avoidance-Car/
β”œβ”€β”€ ObstacleAvoidanceCar.ino   # Main Arduino sketch
β”œβ”€β”€ photo.png                  # The Maze-Solver-Car + shield photo
β”œβ”€β”€ .gitignore                 # Git ignore rules
└── README.md                  # This file

πŸ… Competition Achievement

πŸ† 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.


πŸ“„ License

This project is open-source under the MIT License.


πŸ™Œ Acknowledgements

  • Adafruit for the Motor Shield library
  • Tim Eckel for the NewPing library
  • SEEK & IEEE CUST for organizing RoboCUST 2024

πŸ™‹β€β™€οΈ Connect with Me

Developed by Huda Usman

LinkedIn


⭐ If you found this project interesting, please give it a star! ⭐

About

πŸ† 1st Place RoboCUST 2024 β€” Autonomous obstacle avoidance car built with Arduino Uno, ultrasonic sensor & servo motor

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages