PROJECT DOSSIER

Zouzou · maze-solving robot

It explores a maze it has never seen, proves which way out is shortest, drives home by itself, then races it. On tape or between walls.

Type
PROJECT DOSSIER
Project
Zouzou
Status
Firmware v3 · tuning in progress
Updated
2026-11-15
Read time
8 min
Language
EN
PLATE · ZOUZOU · EXPLORE, PROVE, RACEILLUSTRATIVE
TAPE MAZE · ILLUSTRATIVE RUNSTARTEXITtried then dropped: dead endthe shortest route, proven then racedTHE FACE · 8×8 MATRIXHOW IT THINKS01FOLLOW5 sensors, one position, PD02MEASUREencoders: distance and heading03RECOGNISEknown coordinate = loop closed04EXPLOREnearest untried road05PROVE|dx| + |dy| bounds the rest06RACEDijkstra, a turn costs 80 mm3000simulated mazes,all solved optimally250 Hzcontrol loop0external librariesSolver verified on a PC. Tuning on the chassis in progress.
The grey ghost replays the exploration, the blue robot replays the chosen route. The drawing is illustrative; the three figures are the project’s.
SIMULATOR · ZOUZOU’S BRAIN IN THE BROWSERINTERACTIVE

TRY IT

Watch it draw the map.

The same solver as the firmware, loops included. Draw your own maze, then compare with the old turn list.

Full screen

Interface in English.

In pictures

0 / 6 · Photos of the finished robot and of the sessions are on their way. Each frame is reserved.

In this document
  1. 01 · The challenge
  2. 02 · One run, one picture
  3. 03 · How it thinks
  4. 04 · Hardware
  5. 05 · The remote, with no app
  6. 06 · A show for children
  7. 07 · Design decisions
  8. 08 · What is verified, and what is not
  9. 09 · Documents and sources
Contribution
Design, firmware, solver, remote and documentation
Period
2026
Tools
C++ · ESP32 · PD control · Dijkstra · odometry

01 · The challenge#

Zouzou is a Club Electro-Power project at EHTP. The brief fits in one sentence: a two-wheeled robot has to get out of an unknown maze, then find the shortest way again, and do it in front of a room of children who must be able to follow what it is doing.

The classic method, remembering a list of turns and erasing dead ends, fails as soon as the maze contains a loop: the left-hand rule can circle forever. So Zouzou measures where it is instead of only remembering what it turned.

02 · One run, one picture#

Test maze with the driven trail: the way out in blue, the dead ends in red dots
Blue: driven once, the way out. Red dots: driven twice, a dead end there and back.
TurnsSequence
Exploring17S R B L L L R R B L L L L B S L L
Shortest route5R S R L L

This maze has no loops, so writing down the turns would be enough. The map is for the mazes where it is not.

03 · How it thinks#

StepWhat happens
FollowFive reflectance sensors become one line position, from -2000 to +2000. A PD controller steers on it at 250 Hz.
Read the junctionThe robot creeps across, notes the side roads as its outer sensors cross them, then puts its wheels on the junction before turning.
MapEvery turn is 90°, so the robot always faces one of four ways. Road length plus heading give each junction a coordinate.
RecogniseArriving at a coordinate already on the map means: I have been here. That one test makes loops harmless.
Stop earlyRoads run along two axes, so the exit is never closer than |dx| + |dy|. A road that could not beat the best route even in a straight line is not explored.
RaceDijkstra’s algorithm, where a turn costs as much as 80 mm of road. The route is stored with every road length, so the robot knows when to brake.
The three phases of reading a junction
Reading a junction in three phases: approach, cross while noting the roads, centre the wheels.

Why it wobbles more at speed

correction = Kp · position + Kd · Δposition
ÿ + kL·ẏ + kv·y = 0
ωₙ = √(kv)
ζ = (L / 2)·√(k / v)

With y the sideways offset of the axle, v the speed and L the distance from the axle to the sensors, damping grows with L and falls as 1/√v. Sensors mounted further forward calm the robot down; more speed needs more Kd.

04 · Hardware#

Top view of the chassis with its eight numbered parts
The chassis from above. Heavy parts sit low and near the axle.
#PartWhat it is for
15 × TCRT5000See the black line: three steer, two notice side roads
2Ball casterFront support
3MAX7219 8×8 matrixThe face
4ESP32 DevKitThe brain, and the Wi-Fi for the phone
5Motor driverL298N, TB6612FNG, DRV8833
62 × N20 motor with encoderDrive, and count 0.15 mm steps
73 × 18650 and 5 V buckPower
83 × HC-SR04Hear walls and obstacles
Complete wiring diagram of the robot
Complete wiring. All 23 usable pins of the board are taken; every one is described in config.h.

Three lithium cells, four habits

  • A 3 A fuse right at the battery.
  • The buck converter is set to 5.0 V with a multimeter before anything is connected.
  • The battery never goes to VIN directly; every HC-SR04 ECHO returns through a 1 k / 2 k divider.
  • One common ground. The firmware limits the PWM for 6 V motors and refuses to start a run below 9.9 V.

05 · The remote, with no app#

Zouzou makes its own Wi-Fi network and serves one page. Any phone works, with no internet. Without a phone, the BOOT button on the ESP32 is enough to calibrate, explore and start the speed run.

Three screens of the phone remote: maze, play and map
The Maze, Play and Map tabs. The robot’s face is mirrored at the top of every screen.
TabWhat is on it
MazeWake up, explore, speed run; the mode where the children choose at each crossing; every turn tried, the shortest way, both times.
PlayJoystick, an 8×8 pad that draws on the face, scrolling messages, an eight-key piano.
MapThe maze as the robot has drawn it so far, live.
LabSensor bars, ultrasonic distances, encoder ruler, wheel test, every gain and measurement.

06 · A show for children#

The robot does not need the theatre to solve the maze. The children need it to see what is happening. Five acts, about fifteen minutes.

ActThey seeThey learn
1 · Meet the robotIt scrolls its name. A child draws a heart and it appears on the face.A screen is dots someone switches on.
2 · You are the brainIt stops at each crossing, arrows blink, they shout a direction.Guessing is slow. Is there a rule?
3 · The robot’s turnDead ends, dizzy eyes, and the maze drawing itself on a big screen.A robot cannot see the maze: it must go and find out, and remember.
4 · Did it learn?It drives home by itself.It is using what it remembered.
5 · The raceStraight to the exit. Fireworks on the matrix.Remembering made it fast. Compare the times.

The question that makes act 3 land: “What would you tell the robot to always do?” Someone says “always go left”. That is the left-hand rule, and they invented it.

07 · Design decisions#

DecisionIn one line
A matrix instead of the OLED64 big LEDs read from the back of a room, and the MAX7219 is driven in twenty lines with no library.
Encoders from the first versionPlanned as an upgrade, they turned out to be the foundation: without distance there is no map.
A map and DijkstraKnowing where the robot is fixes both loops and route choice at once.
Stop exploring earlyProving the route is shortest is cheaper than driving every road.
Three ultrasonic sensors, one switchThe solver never needed to know there was a line, so it also works between walls.
Software guards the battery and the motorsThree cells are too much for 6 V motors unless something limits them.

08 · What is verified, and what is not#

  • Verified: the solver has no hardware in it, so it runs on a PC. A simulated robot with realistic measurement errors drove 3000 random mazes with loops; every stored route was the true shortest one.
  • Verified: the whole firmware is type-checked on a PC against stand-in Arduino headers, and the turn list and the matrix pictures have their own tests.
  • In progress: gains, wheel measurements and the wall-maze constants are starting values, to be tuned on the real chassis.
  • Not yet demonstrated: wall mode has not run on the finished chassis.

09 · Documents and sources#

IN 60 SECONDS

Elmehdi Essamit

I build complete systems, from the ESP32 sensor to the power-flow solver, and validate every result against a reference.

Profile
Engineering student, year 1 · EHTP
Looking for
Introductory internship · 1 to 2 months
Period
Summer 2027
Mobility
Morocco or abroad
Languages
Arabic · French · English
Download the CVessamit.elmehdi@proton.meLinkedInFull recruiter page

Search the portfolio