Skip to content

CengzYavuz/Smart-RoboCar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏁 Smart Arduino Car β€” ETE3007 Robot Challenge Spring 2025

This project is an autonomous smart car developed for the DEU ETE3007 Fundamentals of Robotics Robot Challenge (Spring 2025). The car uses a modular event-driven control system, relying solely on onboard sensors and logic to navigate the competition track featuring hills, wall obstacles, and color zones.


🎯 Objective

Build an autonomous mobile robot capable of navigating the challenge track from start to finish, without remote control, in accordance with competition rules. The robot must:

  • Start autonomously after a reset
  • Pass over a hill and through three wall obstacles
  • React accurately to colored track zones
  • Reach the finish line while earning checkpoints and time bonuses

πŸ”§ Hardware Used

Component Description
🧠 Arduino Uno Main microcontroller
βš™οΈ Adafruit Motor Shield Controls 4 DC motors
πŸš— 4x DC Motors Provides locomotion
πŸ“ Ultrasonic Sensor Used for obstacle detection and alignment
πŸ”‹ Battery Pack Powers motors and Arduino

🧠 Software Architecture

The robot is driven by a custom event queue system, where each event contains:

  • An action function (what the robot should do)
  • A condition function (when to do it)
  • An optional duration (how long the action should run)
struct Event {
  ActionFunction action;
  ConditionFunction condition;
  unsigned long duration; // in ms
};

βœ… Features

  • Event Queue Logic: Modular movement instructions that run under given conditions or time constraints
  • Distance Alignment: AdjustMiddle() aligns the robot to a target distance using PID-like speed control
  • Actions Supported:
    • Forward, Backward
    • Left and Right Turn
    • Stop
  • Obstacle Handling: Ultrasonic sensor helps maintain spacing from obstacles (walls, checkpoints)

πŸ›  How to Use

  1. Connect hardware as follows:
    • Motors to M1–M4 on AFMotor Shield
    • Ultrasonic sensor:
      • TRIG_PIN β†’ A1
      • ECHO_PIN β†’ A0
  2. Upload the sketch to the Arduino.
  3. Place robot at the start line.
  4. Press the reset button to start execution after referee’s start signal.

πŸ§ͺ Behavior Flow

The robot proceeds through a sequence of actions such as:

  • Drive forward for specified durations
  • Use AdjustMiddle() to align distance (e.g., before a wall or obstacle)
  • Turn left or right at specific checkpoints
  • Stop at the finish line

Example event:

addEvent(
  []() { AdjustMiddle(26); },
  []() { return CorrectFlag; },
  0
);

πŸ“Š Scoring Strategy

The robot is designed to maximize the following:

  • βœ… Passing Checkpoints (walls and hill)
  • ⏱ Time Efficiency via optimized speed and smooth transitions
  • πŸ€– Complexity & Embedded Control using event-based logic
  • πŸ“ Distance Adjustments for obstacle safety
  • 🎨 Future additions may enhance aesthetics if needed

πŸ“ Project Structure

smart-car/
β”œβ”€β”€ smart_car.ino         # Main Arduino code
β”œβ”€β”€ README.md             # Project documentation (this file)
└── competition_doc.pdf   # ETE3007 competition guidelines

πŸ“Œ Rules Compliance

βœ… No remote control used
βœ… Fully autonomous and self-contained
βœ… Communication modules (Bluetooth/WiFi) not used during execution
βœ… Final reset logic triggered manually before starting


πŸ“œ License

MIT License – free to use, modify, and learn from for educational and competitive purposes.

About

Source code and the detailed document for Robotic lecture challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages