DIY ESP32 robot crab: parts, wiring and an honest status report

Crabby started life as a simulator, but it's designed around real, cheap hobby parts. This page explains the hardware design, what you'd need to build one, and, just as importantly, what hasn't been tested yet.

Status: Maker Preview. The 3D parts, wiring, firmware and PCB have only been checked in software (CAD checks, firmware compile checks, PCB design-rule checks and the simulator). No prototype has been printed, wired or powered yet. Expect to adjust fits, servo trims and the walking gait.
FreeCAD assembly of the 3D-printable robot crab
The printable FreeCAD model: plates, leg brackets, legs, claws and sensor mounts.

The design in one paragraph

Six legs with two servos each (hip and knee) walk in a tripod gait, and two more servos drive the claws: 14 SG90 micro servos in total. A PCA9685 board drives all the servos over I²C. An ESP32 DevKit runs the firmware, reads an HC-SR04 ultrasonic sensor (the crab's “eyes”), two TCRT5000 IR edge sensors and a copper-tape touch pad, and plays tunes on a passive buzzer. Power comes from two 18650 Li-ion cells through a fuse, a switch and a 5 A UBEC.

Parts list (approximate)

The parts cost roughly US$45–50 before tools. Prices vary a lot by country and shop, so treat that as an estimate.

Wiring

Wiring diagram: ESP32, PCA9685, servos, sensors and power
Breadboard wiring: ESP32 + PCA9685. Common ground everywhere; servos never powered from the ESP32.

The key safety rules: share one ground, power the servos from the UBEC (never from the ESP32 pins), put a voltage divider on the HC-SR04's 5 V echo pin, and keep the robot's legs in the air the first time you power it up.

Firmware and the simulator link

The CrabRobot Arduino library implements the same walk, turn, jump, claw and sensor functions as the simulator. The crab_live sketch lets the browser drive the real robot over USB with Web Serial (in Chrome or Edge), so the robot copies the simulator. A calibration sketch saves per-servo trims to flash. Any block program in the Blockly simulator can also be exported as a standalone Arduino sketch.

Optional custom PCB

Render of the optional Crabby controller PCB with ESP32-S3
Optional controller board: ESP32-S3, on-board 5 A servo regulator, 16 servo headers.

For a tidier build there is an optional 2-layer board built around an ESP32-S3-WROOM-1-N16R8 module. It has USB-C, reverse-polarity protection, a 5 A servo regulator and connectors for every sensor. It passes the KiCad electrical and design-rule checks, and the JLCPCB fabrication files are ready, but no boards have been made yet. We recommend building the breadboard version first.

What's in the build kit

The Crabby Build Kit, Maker Preview ($15) is a digital download. It contains 14 STL files and the FreeCAD source, print settings, the parts list, the wiring diagram, firmware and libraries, ready-to-flash binaries, a step-by-step bring-up and calibration guide, and the optional PCB files. It doesn't include physical parts. Because the hardware is untested, please treat it as a project for experienced makers, and tell us what you find so the next version can fix it.

What still needs a prototype

The Build Kit includes a printable prototype checklist with pass/fail tables and go/no-go criteria for anyone building the first unit. If you do build it, please send photos, measurements and the checklist results. They go straight into the next revision.

Start without hardware

You can do everything on screen first: open the free simulator, try the free Lesson 1, and build your programs before a single part arrives. When you're ready for parts, the digital Build Kit ($15) has the files.