Skip to content

OfficialBishal/Mazer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mazer

Smart maze-solving robot powered by Arduino. The robot follows black lines, learns intersections during a dry run, simplifies the recorded path, and then replays the optimal route for a fast solve.

Features

  • PID-based line following with five IR reflectance sensors.
  • Intersection detection and path recording for maze solving.
  • Path simplification to remove loops before the timed run.
  • Onboard push button to toggle between a learning lap and the final run.
  • Built-in LED signaling for quick status feedback.

Hardware

  • Arduino Uno (or compatible) microcontroller.
  • Dual-channel motor driver (e.g., L298N/L293D).
  • Two DC gear motors with encoders optional.
  • Five line sensors plus two side turn sensors.
  • Optional ultrasonic or forward-facing IR sensors (see sketch_jan05a.ino).
  • Push button and indicator LED.
  • 7–12 V battery pack suitable for the chosen motors and driver.

Pinout (default final.ino)

Component Pin(s)
Left motor driver input 2, 3
Right motor driver input 4, 5
Left motor enable (PWM) 10
Right motor enable (PWM) 11
Turn sensors 6 (left), 7 (right)
Line sensors A0 (far left), A2 (near left), A3 (center), A4 (near right), A5 (far right)
Status LED 8
Push button 9

Getting started

  1. Wire the robot according to the pinout above and your motor driver’s datasheet.
  2. Install the Arduino IDE or arduino-cli.
  3. Open final.ino, select Arduino Uno (or your board) and the correct port.
  4. Upload the sketch.
  5. Place the robot at the maze entrance and press the button once to start the dry run. Press the button again to replay the optimized path.

Tuning tips

  • Adjust kp, ki, and kd near the top of final.ino to suit your maze’s contrast and your motor driver’s responsiveness. Start with ki = 0 and increase slowly to avoid windup.
  • Use initial_motor_speed, rotating_speed, and forward_speed to match your drive train and traction.
  • If you only need to focus on PID behavior, try the dedicated tuning sketch Final_PID.ino, which isolates the line-following logic.

Repository guide

  • final.ino – primary firmware for maze discovery and optimized playback.
  • Final_PID.ino – pared-down sketch for experimenting with PID gains on a six-sensor layout.
  • sketch_jan05a.ino – prototype that mixes line following with additional sensors such as ultrasonic rangefinders.

Contributing

Issues and pull requests are welcome. Please keep code formatted (the repository uses clang-format defaults) and include concise descriptions of hardware setups or tuning parameters that affect behavior.

Releases

No releases published

Packages

 
 
 

Contributors

Languages