Hexapod walking robot with 18 servos
A six-legged printed walker with three MG90S servos per leg, two PCA9685 servo boards, an MPU-6050 and an ESP32 that runs a tripod gait you write with an AI helper. Powered by two 18650 cells through a rocker switch and two buck converters.

Safety first
- 18 servos can pull several amps. Use the XT60 lead and the two buck converters for the servo rails, never the ESP32 USB port or its 3.3 V pin.
- Use name-brand protected button-top 18650 cells. Charge them individually in a dedicated 18650 charger (the XTAR VC4SL, or one you already own) inside a fire-safe bag, never unattended, and never while they are installed in the printed tray. Do not charge bare 18650s on a LiPo balance charger, and do not use damaged, swollen or mixed cells.
- Set both buck converters to 5.5 V before connecting servos; MG90S servos are rated about 4.8-6 V and burn out above that.
- Unplug or switch off the pack before reaching into the legs. Servos can snap closed and pinch fingers.
Parts
| Part | Qty | Approx. each | Subtotal |
|---|---|---|---|
| MG90S metal-gear micro servo (10-pack)18 servos needed, two packs leave 2 spares. Typical $22-35, no verified link.Amazon (search) | 2 | $28 | $56 |
| HiLetgo PCA9685 16-channel servo driverTwo boards: solder the A0 address jumper on the second one so it answers at 0x41. Price seen $8.99 in our parts catalog (Nov 12, 2026). Typical $7-12.Amazon | 2 | $8.99 | $17.98 |
| Espressif ESP32-DevKitC-32E (DevKitC V4) development boardOfficial Espressif 38-pin DevKitC V4 with ESP32-WROOM-32E (4 MB). Micro-USB port, not USB-C. Buy only the official 38-pin Micro-USB board, not a USB-C or 30-pin clone. Primary listing: Mouser 356-ESP32-DEVKITC32E, $10.20, 1,701 in stock on Nov 12, 2026, per Findchips (https://www.findchips.com/search/ESP32-DEVKITC-32E). The Mouser US page itself returned 403 to a direct fetch, so click-confirm the US storefront before you order. Mouser Netherlands listed 1,622 in stock at €8.60 the same day. Do not use DigiKey as the default today (search snippets showed 0 in stock / long lead time). Official Amazon listing https://www.amazon.com/dp/B09MQJWQN2 was still unavailable; use it if it returns. Amazon search for the official board: https://www.amazon.com/s?k=ESP32-DevKitC-32E. Adafruit #3269 remains $15.00 and was out of stock (https://www.adafruit.com/product/3269). Typical $10-16.Mouser | 1 | $10.20 | $10.20 |
| HiLetgo GY-521 MPU-6050 IMU (3-pack)Tyqloo specifies an MPU-6050 for orientation. One board from the pack is enough; default I2C address 0x68. Catalog ASIN, sold as a 3-pack. Typical $9-14.Amazon | 1 | $10.50 | $10.50 |
| XL4016 8A buck converter modulePrimary 8 A buck: set it to 5.5 V with a multimeter BEFORE any servo is connected. Feeds the ESP32 and the left servo bank. Typical $6-14, no verified link.Amazon (search) | 1 | $9 | $9 |
| DEVMO XL4015 5A DC buck converter with LED voltmeterPrice seen $11.99, in stock, sold by developmoreus and ships from Amazon (Nov 12, 2026). Secondary 5 A buck for the right servo bank; also set to 5.5 V before connecting servos. Typical $9-15.Amazon | 1 | $11.99 | $11.99 |
| FUSHIBEARING 623ZZ bearings, 3x10x4 mm (20-pack)Price seen $9.99, in stock (17 left when checked Nov 12, 2026), ships from Amazon. Need 18 bearings; the 20-pack leaves two spares. Confirm 3x10x4 mm. Typical $8-14.Amazon | 1 | $9.99 | $9.99 |
| initeq M2.5-0.4 long heat-set inserts, 20-packPrice seen $7.89 for the 20-count long (INM2504) pack (only 2 left when checked Nov 12, 2026). If that count is sold out, the same listing also offers 50- and 100-count packs. Typical $7-16.Amazon | 1 | $7.89 | $7.89 |
| M2.5 socket-head cap screws assortmentTyqloo uses M2.5 screws with the heat-set inserts. The M2 and M3 kit below may not include M2.5. Typical $8-14, no verified link.Amazon (search) | 1 | $10 | $10 |
| M2 and M3 screw assortment kitTypical $9-16, no verified link.Amazon (search) | 1 | $12 | $12 |
| ATNSINC 12V round rocker switch, SPST 20A, 2-pack (red)Price seen $6.99, 7 left when checked Nov 12, 2026, ships from Amazon. 20 A 12 V DC, 3-pin SPST with prewired leads. Confirm the printed cutout (listing gives a ~20 mm / 0.9 in panel hole; the housing is about 29 mm). The LED is sized for 12 V and may glow dimly on a 2S pack. Typical $5-10.Amazon | 1 | $6.99 | $6.99 |
| KeepPower P1835J 3500 mAh protected button-top 18650 (Sanyo NCR18650GA)Price seen $9.99 each, in stock at Illumn (Nov 12, 2026). Protected button-top, 68.90 x 18.60 mm. Two cells in series (~7.4-8.4 V) sit in the printed battery_body / battery_lid tray (about 25 x 43.75 x 77 mm) — no purchased holder is required. Buy a matched pair; do not mix cells. Avoid no-name Amazon "18650" packs. Typical $8-13 each.Illumn | 2 | $9.99 | $19.98 |
| XT60 connector pairs (5-pack)Typical $6-10, no verified link.Amazon (search) | 1 | $8 | $8 |
| 40-pin 20 cm female-to-female jumper wiresCatalog ASIN. Typical $4-8.Amazon | 1 | $5.50 | $5.50 |
| XTAR VC4SL 4-bay USB-C 18650 chargerSkip if you already own one. A proper 18650 charger, not a LiPo balance charger. Price seen $29.47, in stock, sold by AllmaybeDirect and ships from Amazon (Nov 12, 2026). This SKU does not include a wall adapter; a USB-C or QC3.0 supply is required. Charge cells individually in the charger, never in the printed tray. Typical $25-40.Amazon | 1 | $29.47 | $29.47 |
| LiPo fire-safe charging bagSkip if you already own one. Use it when charging the 18650 cells in the XTAR (or any lithium charger). Typical $8-15, no verified link.Amazon (search) | 1 | $10 | $10 |
| RadioMaster RP1 V2 ExpressLRS 2.4 GHz nano receiverSkip if you already own one. Tyqloo includes an ELRS receiver only if you already own an ELRS radio; skip it for Wi-Fi or Bluetooth control. Catalog ASIN. Typical $18-25.Amazon | 1 | $22 | $22 |
| Estimated total (parts only) | $257.49 | ||
Typical US prices, checked 2026-11-12. Prices change and multi-packs are often cheaper per piece.
As an Amazon Associate I earn from qualifying purchases. Prices change; check the store.
Filament
PLA (1.75 mm): about 450 g (151 m), roughly 22 h of printing.
PLA, 0.2 mm layers, 20-25% infill, 3 walls for leg segments and servo brackets, supports only where the design calls for them.
AI agents you'll use
- Code helper (ChatGPT, Claude, Gemini or Grok): Writes the leg inverse-kinematics function, the tripod gait loop, the two-board PCA9685 mapping and the MPU-6050 read, and fixes compile errors you paste in.
- Power budget checker: Adds up the servo current for your gait, checks both buck converters and the wire gauge, and flags anything that will brown out the ESP32.
Tools
- Soldering iron or a heat-set insert tip
- Small Phillips and hex drivers
- Multimeter
- Wire stripper
- USB data cable (Micro-USB for the official DevKitC)
- Dedicated 18650 charger and a fire-safe bag
What you'll learn
- Inverse kinematics for a 3-joint leg
- Tripod and wave gaits
- Driving 18 servos from two I2C PWM boards
- Reading an MPU-6050 for orientation
- Sizing a servo power supply for high current
- Installing heat-set inserts and press-fit bearings
Six legs, eighteen servos and a gait you write yourself. A hexapod is the classic step up from wheeled robots, because it walks over a rug, a book or a pile of cables.
What you'll build
A table-top hexapod about 30 cm across with legs extended. Each leg has three joints (hip, femur, tibia) driven by MG90S servos, with 623ZZ bearings and M2.5 heat-set inserts where the Tyqloo files call for them. Two PCA9685 boards share one I2C bus and give 32 PWM channels, of which 18 are used. An MPU-6050 on the same bus reports orientation. An ESP32 runs the inverse kinematics and gait, and can take commands from a phone over Wi-Fi (or an optional ELRS radio). Two protected 18650 cells in the printed battery tray feed a round rocker switch, then an 8 A XL4016 (ESP32 and left servo bank) and a 5 A XL4015 (right servo bank).
The cost range is $175-285. The low end assumes you already own these items marked "skip if you already own one": XTAR VC4SL 4-bay USB-C 18650 charger, LiPo fire-safe charging bag, RadioMaster RP1 V2 ExpressLRS 2.4 GHz nano receiver. The high end includes them.
Print the parts
Download Tyqloo's "Hexapod under 100€" from Printables (model 1730179) and credit the designer. The listing is CC BY-NC (confirmed via a Printables license scrape dated Oct 27, 2026; re-check the badge before you print). Link only: do not host or redistribute the files. Print battery_body and battery_lid as the 18650 holder — no purchased tray is needed. Press one 623ZZ into each of the 18 bearing seats, and install M2.5 heat-set inserts with a soldering iron or insert tip before final assembly. The 450 g / 22 h figure is an unsliced estimate for the full set (legs, body and battery tray); slice your own files for a firm number. Print one leg first and test-fit three servos plus a bearing.
Wiring
| From | To | Notes |
|---|---|---|
| 18650 pair (series, in the printed tray) | Round rocker switch | Pack positive through the switch, then to both buck inputs. Pack negative to both buck minuses. |
| Rocker-switched pack | XL4016 input and XL4015 input | Primary 8 A XL4016 for the ESP32 and the left servo bank; secondary 5 A XL4015 for the right servo bank. Both set to 5.5 V. |
| XL4016 output (5.5 V) | PCA9685 #1 V+ and ESP32 5V (when not on USB) | Left servo rail and logic power when walking. Use 18 AWG or thicker for the servo side. |
| XL4015 output (5.5 V) | PCA9685 #2 V+ | Right servo rail. Use 18 AWG or thicker. |
| PCA9685 #1 and #2 VCC | ESP32 3V3 | Logic power only. |
| PCA9685 SDA / SCL and MPU-6050 SDA / SCL | ESP32 GPIO21 / GPIO22 | All three devices on the same I2C bus; board #2 at 0x41, MPU-6050 at 0x68. |
| MPU-6050 VCC / GND | ESP32 3V3 / GND | 3.3 V only; do not feed the IMU from the 5.5 V servo rail. |
| All grounds | Common GND | Pack minus, both buck minuses, both PCA9685 GND, the MPU-6050 GND and the ESP32 GND must be joined. |
| Servos (18) | PCA9685 #1 channels 0-8, #2 channels 0-8 | Three per leg; keep a written map of leg and joint per channel. Left legs on the XL4016 board, right legs on the XL4015 board. |
| ESP32 power | USB while coding; the XL4016 5.5 V rail on the 5V pin when walking | Do not feed the ESP32 from the servo rail through its 5V pin while USB is also plugged in. |
Step-by-step
- Print one leg and the body plate, press in a 623ZZ bearing, test-fit the servos, then print the rest including the battery tray.
- Install M2.5 heat-set inserts with a soldering iron or insert tip where the files call for them. Let each insert cool before threading a screw.
- Set the XL4016 and the XL4015 each to 5.5 V with a multimeter and no load attached.
- Solder the A0 jumper on the second PCA9685 and wire both boards and the MPU-6050 to the ESP32. Confirm 0x40, 0x41 and 0x68 with an I2C scanner.
- Wire the printed 18650 tray, the rocker switch, the XT60 lead and both bucks. Switch off and leave the cells out until the rails are verified.
- Center every servo (1500 microseconds) with a test sketch BEFORE attaching horns, so each joint starts at its middle.
- Assemble the legs with the servos centered and the bearings seated, then fill in a table of leg, joint, board and channel.
- Ask the AI helper for a single-leg inverse-kinematics function and test it on one leg in the air. Read the MPU-6050 and print pitch and roll to Serial.
- Add the tripod gait: three legs on the ground while the other three swing. Test it with the robot on a stand first.
- Install a matched pair of charged 18650s in the printed tray, switch on, walk slowly, and watch the pack voltage.
- Add a simple Wi-Fi web page with forward, back, turn and stop buttons. Add the ELRS receiver only if you already have an ELRS radio.
Code
Use the Adafruit PCA9685 library and an MPU-6050 library (Adafruit MPU6050 or similarly maintained) with the Arduino-ESP32 core. Keep the gait parameters (step height, stride, speed) in one place so you can tune them.
Prompt for the code helper:
Write an Arduino sketch for an ESP32 hexapod: 18 MG90S servos on two PCA9685 boards at 0x40 and 0x41 (channels 0-8 on each), three joints per leg (coxa, femur, tibia), plus an MPU-6050 at 0x68 on the same I2C bus (SDA 21, SCL 22).
Include: a channel map table, per-servo trim offsets, a 3-joint inverse-kinematics function with my leg lengths as constants, a tripod gait with stand, forward, turn and stop, and a Serial print of pitch and roll from the IMU.
Use 50 Hz PWM, clamp every angle to safe limits, and ramp moves so all 18 servos never jump at once.
Troubleshooting
- ESP32 resets when it starts walking: The servo rail is sagging. Check both buck converter outputs under load, use thicker wire, and make sure the ESP32 is not powered from the servo rail while also on USB.
- Board #2 does nothing: The A0 jumper is not soldered, or both boards are still at 0x40. Run an I2C scanner; you should see 0x40, 0x41 and 0x68.
- MPU-6050 missing on the scanner: Check 3.3 V power, shared GND, and the SDA/SCL wiring. Some modules need the AD0 pin tied low for 0x68.
- One leg drags: Recheck that joint's trim offset and its channel in the map.
- Servos buzz at rest: Normal under load. Lower the body height or reduce standing time.
Print files
- Hexapod under 100€ (Tyqloo, CC BY-NC. We don't host this file.)
Files, code and docs
- Hexapod under 100€ print files (Tyqloo, Printables 1730179) (CC BY-NC — link only, do not host or redistribute)
- Adafruit PCA9685 PWM servo driver library (BSD)
- Installing the Arduino-ESP32 core (Espressif docs) (Vendor docs)
Last checked 2026-11-12. Double-check parts against your own board and seller listings before you buy.