Open-source hexapod robot
Build the
Hexapod Mochi
A complete four-phase guide — from 3D printing through electronics, firmware, and calibration.
Critical: Do NOT tighten servo horn screws during assembly. Leave them loose — you’ll tighten them properly during calibration after setting each servo to its neutral position.
Print settings
Layer height0.2 mm
Infill20–30%
MaterialPLA / PETG
SupportsSome parts
Body components — ×1 set
Install servos before closing the body. Route wires neatly to avoid pinching. Test-fit all parts before final assembly.
body_base×1
body_side×6
body_top×1
body_head×1
body_battery_top×1
body_servo_side×12Joint components — 3 standard + 3 mirrored
Left side legs use mirrored joints. Right side legs use standard joints. Refer to assembled robot images for correct orientations.
joint_bottom×12
joint_cross×6
joint_top×12Leg components — ×6
Ensure bearings are properly seated. Pins should slide in smoothly without forcing. Verify smooth joint rotation before proceeding.
leg_bottom×6
leg_side×12
leg_top×6Foot components — 3 standard + 3 mirrored
Match foot orientation with joint — left = mirrored, right = standard.
foot_bottom×6
foot_top×6
foot_ground×6
foot_tip TPU×6Hardware
Organize all hardware into labeled containers before assembly. Standard metric parts — available from Amazon, AliExpress, or local hardware stores.
| Item | Spec | Qty | Use |
|---|---|---|---|
| Screw | M2 × 6mm hex socket | 36 | Servo mounting |
| Screw | M2 × 12mm countersunk | 180 | General assembly |
| Nut | M2 hex nut | 216 | Securing screws |
| Pin | M4 × 6mm stainless steel (304) | 18 | Joint pivots |
| Bearing | MR74-2RS — 4mm ID, 7mm OD, 2.5mm bore | 18 | Smooth joint rotation |
Assembly order
1
Install servos in body before closing it — route wires neatly to avoid pinching


2
Assemble joints: bottom → cross → top. Pay close attention to left vs right orientation


3
Build each leg — seat bearings, insert pins (should slide smoothly without forcing)


4
Attach feet — verify orientation matches the joint (standard or mirrored)


5
Attach all 6 completed legs to the body


6
Connect servos and controller — then proceed to Electronics and Software before final tightening
Components
| Image | Component | Spec | Qty | Note |
|---|---|---|---|---|
![]() | Controller board | ESP32 version — RookiDroid custom PCB | 1 | Purchase ↗ |
![]() | Servo | MG92B — 180° rotation | 18 | |
![]() | Toggle switch | SPST, 6mm diameter | 1 | |
![]() | 18650 battery | 3.7V Li-ion, 2000mAh+ | 2 | Protected cells only |
![]() | Battery holder | 2-cell with wire leads | 1 |
Use protected 18650 batteries. Unprotected cells can be hazardous — the protection circuit guards against overcharge, over-discharge, and short circuits.
Wiring
1
Connect each MG92B servo to the numbered ports on the controller board — 18 servos total (3 per leg)
2
Install the toggle switch for main power
3
Connect the 2-cell 18650 battery holder to the board’s power input
4
Refer to the wiring diagram below for exact pin assignments


The custom controller board simplifies wiring significantly — all servo connectors and power management are built in. Available from the RookiDroid shop.
Dependencies
| Library | How to install |
|---|---|
arduino-esp32 | Add board support URL in Arduino IDE → Boards Manager |
Adafruit PWM Servo Driver | Arduino IDE → Library Manager → search and install |
Upload steps
1
Install Arduino IDE from arduino.cc ↗
2
Install
arduino-esp32 board support following the Espressif instructions ↗3
Install both required libraries through Arduino Library Manager
4
Download the firmware from GitHub ↗ and open
hexapod_esp32.ino5
Select board:
ESP32 Dev Module in Arduino IDE6
Upload — the robot performs a boot-up motion sequence on first power on
Default WiFi config
SSID
hexapod
Password
hexapod_1234
UDP port
1234
AP address
192.168.4.1
Source files
📄
hexapod_esp32.ino — main Arduino sketch📄
config.h — configuration parameters and pin mappings📄
motion.h — motion path lookup tables for all movement modes
OTA updates supported. Once firmware is flashed, future updates can be done wirelessly — connect to the hexapod WiFi network and use Arduino IDE’s network port to upload without USB.
The hexapod includes a web-based calibration interface — no need to edit code or re-upload firmware. All adjustments happen live through your browser.
Target neutral positions (all servos at 90°)
Left legs 1, 2, 3
Joint 1 — Coxa (hip)⊥ body
Joint 2 — Femur (thigh)horizontal
Joint 3 — Tibia (shin)90° to femur
Right legs 1, 2, 3
Joint 1 — Coxa (hip)⊥ body
Joint 2 — Femur (thigh)horizontal
Joint 3 — Tibia (shin)90° to femur
Calibration procedure
1
Flash firmware with default offsets, insert batteries, turn on power switch
2
Connect your device to the
hexapod WiFi network (password: hexapod_1234)3
Open a browser and navigate to
http://192.168.4.14
Click “Enter Calibration Mode” — a grid of all 18 servos appears (6 legs × 3 joints)


5
For each misaligned servo, use +/− buttons (1 tick ≈ 0.44°) or type a value — changes apply immediately
6
Compare each leg against the reference images: coxa ⊥ body, femur horizontal, tibia at 90° to femur
7
Click “Save Offsets” — values are written to EEPROM and survive power cycles. Also printed to Serial Monitor as backup
8
Now tighten servo horn screws — with each servo in its correct neutral position, firmly tighten all horn screws
9
Click “Exit Calibration Mode” and send a walk command to verify smooth motion
Tips for good calibration
- Calibrate one leg completely before moving to the next
- Use +/− buttons for fine control — avoid jumping to large values
- If offsets exceed ±25 ticks, physically reposition the servo horn instead of relying on software offset
- Check that servo horn screws are snug before starting — loose horns throw off calibration
- Servos respond immediately as you adjust, so you get real-time visual feedback
- Save your offsets — values persist in EEPROM but always note them from Serial Monitor as backup
- Re-enter calibration mode any time to fine-tune if walking looks uneven




