The problem
A Maze Solving Robot with IR Sensors and Arduino is an autonomous differential-drive robot that finds its way out of a physical maze using reflected infrared light, not a camera or remote control. Five TCRT5000 reflective IR sensors shine 950 nm infrared light at the maze and read back the reflections, so the Arduino Uno always knows which sides are open and which are blocked. Students who learn embedded systems only from a screen rarely handle sensor noise, motor timing or calibration, and this build closes that gap with a machine that must decide correctly at every junction. The robot applies the left-hand rule — left first, then straight, then right, then back — which guarantees an exit from any simply-connected maze, and it records the route for a flood-fill replay of the shortest path. The whole system runs from an AA battery pack through an L298N motor driver, with no computer or internet needed once the code is uploaded.
Five TCRT5000 sensors shine 950 nm infrared light and read back the reflections.
Follow the working sequence
How it works
The maze-solving robot works as a continuous sense-decide-drive loop running on the Arduino Uno. In every loop the five TCRT5000 sensors each shine 950 nm infrared light at the maze and measure how much reflects back; strong reflection means a nearby light surface, weak reflection means dark surface or open space, and the five-sensor pattern tells the Arduino whether it faces a wall, an opening or a junction. The controller compares that pattern with the left-hand rule — prefer a left turn, then straight ahead, then right, then a U-turn — and picks the next move, storing each junction decision in memory. It then drives the two gear motors through the L298N driver with PWM speed control, turning on the spot at junctions and easing speed on straight runs. When the exit pattern is detected the buzzer sounds and the robot stops; on a second run the stored map feeds a flood-fill pass that replays the shortest route.
- The five TCRT5000 sensors scan the maze ahead and report a light/dark pattern to the Arduino Uno.
- The Arduino compares each reading with the calibrated threshold to decide which sides of the robot are open and which are blocked.
- The pattern is classified as a straight corridor, a left or right turn, a T-junction, a crossroads or a dead end.
- The left-hand rule selects the next move — left first, then straight, then right, then a U-turn — and the decision is stored in memory.
- The L298N driver powers the two DC gear motors with PWM speed control to execute the move, turning on the spot at junctions.
- The robot repeats the loop at every junction until the exit pattern is detected, when the buzzer sounds and the motors stop.
- On a known maze, the stored route is converted by flood-fill into the shortest path and replayed as a faster second run.
Tech stack:
- Arduino Uno (ATmega328P)
- Embedded C in Arduino IDE
- TCRT5000 reflective IR sensor array (5 sensors)
- L298N dual H-bridge motor driver
- DC gear motors with differential drive
- AA battery pack with onboard 5 V regulation
- Foam-board maze (5 × 5 cells)
- Serial Monitor for sensor calibration
| Parameter | Value |
|---|---|
| Controller | Arduino Uno — ATmega328P, 16 MHz clock (datasheet value) |
| Digital I/O | 14 pins, 6 with PWM output (datasheet value) |
| Analog inputs | 6 pins, 10-bit ADC (datasheet value) |
| IR sensors | 5 × TCRT5000 reflective sensors, 950 nm emitter wavelength (datasheet value) |
| Sensor range | 0.2 mm to 15 mm operating range, 2.5 mm peak operating distance (datasheet values) |
| Motor driver | L298N dual H-bridge, 2 A DC per channel, up to 46 V motor supply (datasheet values) |
| Driver voltage drop | 1.8 V to 3.2 V at 1 A load (datasheet value) |
| Motors | 2 × DC gear motors, differential drive |
| Drive layout | 2 driven wheels + 1 caster wheel |
| Maze | 5 × 5 cells, foam-board walls, approximately 60 cm × 60 cm overall (design target) |
| Power | AA battery pack, 12 V nominal; logic from onboard 5 V regulator |
| Maze solve time | Under 90 s for a 5 × 5 cell maze (design target, not a measured claim) |
| Code size | Approximately 300 lines of Arduino C (expected) |
| Operating mode | Fully offline; no Wi-Fi or internet required |
Project features
The maze-solving robot's four strongest capabilities are its five-sensor IR wall detection, its two-mode solving logic, its differential-drive steering and its fully offline operation. The five TCRT5000 sensors give the robot a wide view of the maze at every junction, so it can tell a dead end from a corridor in a single reading instead of probing with one sensor at a time. The left-hand rule mode solves any simply-connected maze without a map, while the flood-fill mode replays the recorded route on a maze it has already explored, which is the faster second run examiners like to see. Differential drive — two independently driven wheels plus a caster — lets the robot turn on the spot at a junction, so it never needs a wide turning circle. Because the Arduino Uno runs everything locally, the robot works in any classroom with no Wi-Fi, no laptop and no cloud service.
- [Five-sensor IR array] Five TCRT5000 reflective sensors across the front read walls and openings in one scan, so the robot recognises junctions, dead ends and corridors without turning to look.
- [Left-hand rule solver] The controller always prefers a left turn, then straight, then right, then a U-turn — a rule that guarantees an exit from any simply-connected maze with no map stored in advance.
- [Flood-fill shortest-path replay] Every junction decision is recorded during the first run, and the flood-fill mode replays the shortest route on a maze the robot has already explored.
- [Differential drive with PWM speed control] Two DC gear motors driven independently through the L298N let the robot turn on the spot, slow down for junctions and ease through straight runs.
- [Sensor threshold calibration] Each sensor module has an onboard trimmer, and a step-by-step calibration procedure sets the light/dark threshold for the actual maze surface before every run.
- [Exit detection buzzer] A buzzer sounds when the robot reaches the exit pattern, giving a clear audible finish signal during a demonstration.
- [Foam-board test maze] A 5 × 5 cell maze built from foam-board walls is supplied with the robot, so the build can be demonstrated the day it arrives.
What is included
- Working maze-solving robot prototype (Arduino Uno, 5-sensor IR array, L298N driver, gear motors, chassis, battery pack)
- Foam-board maze with 5 × 5 cells
- Complete Arduino source code with comments
- Circuit diagram and wiring documentation
- Sensor calibration procedure for the supplied maze
- Project report PDF (background, algorithm explanation, methodology, results)
- PPT presentation for final review
- Viva Q&A preparation document
- Project abstract PDF
Limitations & prerequisites
- The left-hand rule guarantees an exit only for simply-connected mazes; a maze with loops or isolated wall islands can trap it, and flood-fill mode needs a prior exploration run.
- IR sensors read surfaces by reflected infrared, not by colour as the eye sees it — glossy black tape can reflect the 950 nm beam and read as a wall, so the maze surface and thresholds must be calibrated together.
- The build is tuned for the supplied foam-board maze; a maze built from different materials or with different wall heights needs recalibration.
- The solve time is a design target, not a measured result — actual time depends on maze layout, battery charge and calibration.
- No camera, mapping display or remote control — navigation is sensor-only, and the robot carries no record of the maze except the junction decisions it stores.
- An academic prototype, not a competition-grade micromouse: no wheel encoders, so distance is estimated from timed motor runs rather than measured.
Frequently Asked Questions
How does the robot actually solve the maze?
The robot scans the maze with five TCRT5000 IR sensors, decides which sides are open from the reflection pattern, and applies the left-hand rule at every junction — left first, then straight, then right, then a U-turn. It records each junction decision, so on a second run it can replay the shortest route with flood-fill. The Arduino Uno runs this sense-decide-drive loop continuously, and a buzzer sounds when the exit pattern is detected.
What is the difference between the left-hand rule and flood-fill?
The left-hand rule is a wall-following strategy that needs no map: it guarantees an exit from any simply-connected maze by always keeping one hand on the wall, but it can take the long way round. Flood-fill is a map-based method: after the first run the robot knows the maze layout and computes the shortest path cell by cell. This build uses the left-hand rule to explore and flood-fill to replay the fastest route.
Why do IR sensors misread on glossy black tape?
Because a TCRT5000 measures reflected infrared light, not visible colour. Glossy black tape looks dark to the eye but its shiny surface reflects the sensor's 950 nm beam almost like white paper, so the sensor reports a wall where the builder expected open floor. This is the single most common calibration mistake in this build: thresholds must be set on the actual maze surface, not on a different test card, and matte tape should be used for any dark markings.
What is the most common wiring mistake in this build?
Connecting the L298N motor supply and the Arduino 5 V logic rail together. The L298N module's onboard regulator makes 5 V from the motor supply only while its enable jumper is fitted; with the jumper removed, feeding motor voltage into the Arduino's 5 V pin can damage the board. The wiring guide in this build labels both rails separately and checks them with a multimeter before the first power-on.
Does the robot need Wi-Fi or a laptop while it runs?
No. The Arduino Uno holds the whole program and makes every navigation decision locally, so once the code is uploaded the robot runs on its battery pack alone with no Wi-Fi, laptop or phone connected. A laptop is needed only during setup, to upload the code and to watch sensor readings on the Serial Monitor while the thresholds are calibrated. That makes the robot easy to demonstrate in any classroom, including rooms with no internet access at all.
Is this project suitable for a final-year project?
Yes. It fits Electronics, E&TC and Electrical final-year programs because it combines embedded C programming, sensor interfacing, motor-driver control and algorithm design in one working build, and the two solving modes give the report a clear algorithm discussion. The calibration procedure also gives the viva a genuine first-principles talking point. Examiners can ask about the left-hand rule guarantee, the flood-fill replay or the IR threshold setting, and each has a concrete answer in the build.
Components & software requirements
- Arduino Uno (ATmega328P)
- Embedded C in Arduino IDE
- TCRT5000 reflective IR sensor array (5 sensors)
- L298N dual H-bridge motor driver
- DC gear motors with differential drive
- AA battery pack with onboard 5 V regulation
- Foam-board maze (5 × 5 cells)
- Serial Monitor for sensor calibration
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.