Skip to content

Task 10 - Line Maze Solving Alphabot (Shortest Path)

Task

Finding The Shortest Path Possible to Solve The Maze Using Alphabot

Functions To Do

  1. Sensor & Movement Logic
    • Read 5 IR sensors to detect the white line and junctions, storing values in an array.
    • Calibrate sensors at startup for accurate detection.
    • Continuously process sensor values and round for stability.
    • Detect junctions (T, L, +, dead ends) using sensor patterns and logic.
    • Implement maze-solving logic: record the path taken, optimize it for the shortest route using backtracking and path simplification, and update path memory to avoid unnecessary loops.
    • Switch to shortest path replay mode after mapping, following the optimized path memory.
    • Stop at the end of the maze or when a goal is detected.
  2. Motor Control
    • Use PID control (proportional, integral, derivative) to follow the line and adjust motor speeds for smooth tracking.
    • Use PWM to control left and right motor speeds independently.
    • Implement functions for turning left, right, moving forward, and making 180-degree turns using motor direction and speed control.
    • Stop motors when needed for precise maneuvers or at the end of the maze.
  3. Path Recording & Optimization
    • Record each movement (L, R, S, B) at junctions into a path array.
    • Optimize the path by removing unnecessary loops and dead ends to find the shortest route.
    • Replay the optimized path for efficient maze solving.
  4. Feedback & Debugging
    • Print sensor values, path memory, and power difference to the serial monitor for debugging and calibration.

Output

Solution

Maze_Solving_Shortest_Path

(Please Go To Main branch)