What it is
NeuroMouse V2.0 is a micromouse: a small autonomous robot that has to find its own way from a corner of a 16×16 maze to the four centre cells, with no map given in advance. It runs on an ESP32-S3, sees walls with four infrared sensors, holds heading with an MPU-6500 gyro, and measures distance with magnetic encoders on two N20 gear motors. I built it with Yu Hong (Elijah) Chen. Our SJSU team, registered as "Neuromouse", placed 3rd overall at the 2026 All American Micromouse Competition (AAMC), held by IEEE at UCLA on May 24, 2026.

NeuroMouse V2.0 from above in a maze cell.
Why
Most open-source micromice run on STM32; the ESP32 is still fairly new in this contest. NeuroMouse is an ESP32-S3 stack that placed on a full-size 16×16 maze, and two months after AAMC the firmware went open source.
We built two mice. V1.0 was a custom PCB, and every mistake (a wrong resistor, a noisy power rail, a sensor too close to a wheel) meant another board spin of about a week. V2.0, the one that placed, is point-to-point wiring on protoboard. Moving a sensor and re-testing took about fifteen minutes.

V2.0 (hand-wired protoboard) next to V1.0 (custom PCB).
How it works
Hardware
- ESP32-S3-WROOM dev board, PlatformIO + Arduino 2.x
- 2× GA-N20 1:30 gear motors (500 RPM at 6 V) with 7 CPR magnetic encoders, on a DRV8833
- 4 IR channels (SFH4545 emitters + TEFT4300 phototransistors), all facing their wall at 90°: two forward, two sideways
- MPU-6500 gyro and 0.96" SSD1306 OLED on one I2C bus
- 300 mAh 2S LiPo; 95 × 85 mm; about 161 g

Top of the V2.0 protoboard stack: ESP32-S3 dev board, OLED, keyswitch.
The motors run 10-bit PWM at 200 Hz. It whines, but on this DRV8833 + N20 combination 200 Hz gave the most breakaway torque; 10–20 kHz gave weaker low-PWM response. The repo has no V2.0 schematic, so include/PinConfig.h is the wiring reference.

Close-up of the hand-wired protoboard and OLED.
Firmware
- One translation unit:
src/main.cppincludes every header. Pins live inPinConfig.h, tuning knobs inTuning.h. - The ESP32-S3 PCNT peripheral decodes the encoders 4×, at no CPU cost.
- A 16×16 flood-fill BFS picks moves, preferring straight, then left, right and U-turn on ties, and penalising visited cells.
- Each move is a short phase script.
PH_FORWARDruns a trapezoidal profile under position-PID, steered by IR centering, encoder balance and gyro yaw-hold.PH_SPOTturns in place on a gyro yaw-PID.PH_ALIGN_FRONTcreeps to a calibrated front-wall gap in dead-ends and, during Explore, before a 90° turn with a wall ahead. - The loop runs at about 200 Hz, paced with
micros(). The repo ships withTELEMETRY = false, because Serial prints slow that loop. - Explore drives to the centre and back, saving walls to NVS at each end. Outbound it brakes at every cell; on the way home it chains straights only through cells it already sensed. Fast Run reloads the map, walls off cells Explore never visited, and fuses straight runs into one move.
- The OLED shows the menu, IR counts, encoder ticks, run state and battery. Dump Walls prints the map to serial. Spinning the right wheel scrolls the menu.

The OLED IR Test screen with live LF/L/R/RF counts and front distance.

Bench debugging with the laptop next to the mouse.
The web-debugger screenshots below come from an earlier firmware sketch that has since been removed from the repo. The repo marks the HTTP debug server in include/WifiDebug.h dormant. It isn't part of the main build, and its page looks different.

Web debugger (earlier sketch, since removed): run state.

Web debugger (earlier sketch, since removed): turn PID.

Web debugger (earlier sketch, since removed): full telemetry and live PID.
Results
On the organizers' results sheet, Neuromouse is ranked 3rd Overall: maze complete, 54 cells visited, 59.715 s. Three teams completed the maze; ours was the third. The UCLA IEEE livestream's results panel shows the same numbers, plus...
Read more »
Inky Ganbold