Part 1: build the robot
From a parts list to a wired robot whose motor turns both ways. Print, snap together, wire, power up, motor test.
On this page
You need a 3D printer (any bed, PLA), a soldering iron, a multimeter and a computer with a USB port. The parts cost about $31.
Each step has one thing to do and one check. Do not start the next step until the check passes.
1Buy the parts
Order everything on this list. The prices are pack prices, so check them. The cells must be a matched pair of genuine high-drain 18650s. Add a 8.4 V 1 A Li-ion charger if you have none: about $10.
| Part | Qty | About |
|---|---|---|
| Dual-shaft TT gearmotor 1:48 | 1 | $3.00 |
| 65 mm TT wheel | 2 | $4.00 |
| ESP32 DevKit (classic WROOM-32) | 1 | $7.00 |
| GY-521 MPU-6050 | 1 | $2.60 |
| MX1508 motor driver | 1 | $1.60 |
| Mini360 buck (set to 5.0 V) | 1 | $0.90 |
| 2S BMS with balancing | 1 | $1.60 |
| 2 x 18650 holder, series | 1 | $1.75 |
| 18650 cells | 2 | on hand |
| PTC fuse 3 A, power switch | 1 each | $1.30 |
| 470 uF 16 V, 100 nF (2), 100k (3), 33k | $0.95 | |
| JST-XH 2-pin pair | 2 | $1.60 |
| DC 5.5 x 2.1 mm jack on a pigtail | 1 | $0.70 |
| Perfboard scrap, header pins, Dupont jumpers | $1.35 | |
| Zip ties, a hook-and-loop strap, wire | $2.00 | |
| A second hook-and-loop strap (both up to 12 mm wide), double-sided foam tape | not priced | |
| PLA | 24 g | $0.39 |
| Total | about $31 |
If it does not work: do not use that cell. See battery safety.
2Print the cheek and try it on the motor

Print cheek.stl first: PLA, 0.2 mm layers, 4 walls, 30 % infill, no supports, no brim. It takes about 9 minutes. Push it onto each face of the gearbox in turn, then push a wheel onto the shaft.
If it does not work: measure your motor and change the MEASURE block in snap.py, as in try the cheek.
3Print the spine, rungs and shelf
Print the other two files with the same settings. Each lies flat as it comes out of the file.
If it does not work: see what you print.
4Fit the motor plug
Solder a red and a black lead and the 100 nF capacitor C3 to the two motor tabs. Crimp the motor half of the K1 plug onto the leads.
If it does not work: see the wire list, wires W22 and W23.
5Snap the body together

Push both rungs into the spine and slide in the shelf. Lay the motor on the spine, then push the cheek on from the other side until the rungs click through it. Push a wheel onto each end of the shaft. The full order is in put it together.
If it does not work: see put it together.
6Build the junction board
Build the small board JB that carries the battery-sense divider and the power plug, on scrap perfboard: build the junction board.
If it does not work: look for a solder bridge between rows.
7Fix the boards on

Tie the ESP32 to its four pads with two zip ties, USB pointing forward. Push the IMU onto its two pegs and put one tie across it. Strap the battery case to the other face of the spine. Stick the BMS, fuse, switch, JB, MX1508 and Mini360 to the front of the battery case with foam tape. No cells yet.
If it does not work: see where the boards go.
8Wire it
Print the one-page wiring sheet and wire one connection at a time, ticking each off. Leave K1 (motor) and K2 (power) unplugged, and leave the jumpers off the ESP32 for now.
If it does not work: see the full wire list and the schematic.
9Power it up and set the buck
Read battery safety first. Fit the cells, wire the BMS B-, then BM, then B+. Plug K2 and switch on, with the Mini360 output still off the ESP32: it ships set to a random voltage that can kill one. Turn its pot until the output is right.
If it does not work: follow the power-up checklist, which has a reading for each connection.
10Connect the ESP32
Switch off. Push the Mini360 output (W15, W16), the battery-sense jumper (W17), the two motor-driver jumpers (W18, W19) and the four IMU jumpers (W24-W27) onto the ESP32. Leave USB unplugged and the motor unplugged at K1. Switch on.
If it does not work: switch off at once and check W15 and W16 against the power-up checklist, step 6.
11Install the Arduino tools
Install arduino-cli, then the ESP32 board package:
arduino-cli core update-index --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
arduino-cli core install esp32:esp32 --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
The Arduino IDE works too: board "ESP32 Dev Module".
arduino-cli core list shows esp32:esp32.If it does not work: see the arduino-cli documentation.
12Run the motor test
Switch off and plug in K1. Hold the robot with its wheels off the ground, and switch on. Plug in USB with the battery on only if your board passed the diode check. From the top of the repository:
arduino-cli compile -b esp32:esp32:esp32 firmware/teeter_motor_test
arduino-cli upload -b esp32:esp32:esp32 -p /dev/cu.usbserial-XXXX firmware/teeter_motor_test
arduino-cli monitor -p /dev/cu.usbserial-XXXX -c baudrate=115200
teeter_motor_test.ino on GitHub Raw file
It starts 3 s after reset. Press EN on the ESP32 to run it again.
If it does not work: nothing turns: check the switch, MX1508 power, IN1 on GPIO 25, IN2 on GPIO 26 and the motor on MOTOR-A. See troubleshooting.