🔧 Hands-On Lab

Building a Quadruped Robot from Scratch: The Complete ESP32 + 3D Printing Open-Source Guide

SinoBot编辑部

The Reddit Post That Sparked It

In May 2026, a post on the r/robotics subreddit captured the community’s attention. User m0rg0t-anton shared their first quadruped robot build — based on the open-source sesame-robot project, powered by an ESP32, with 3D-printed structural components and common MG90 servos. No expensive industrial-grade motors. No complex Jetson compute platform. Just a maker at their workbench, taking a robot from zero to walking.

The post earned 118 upvotes, and the comments were filled with “That’s awesome” and “I want to build one too.” What this represents goes far beyond a single DIY project — it marks a moment when the entry barrier for quadruped robotics has dropped to an all-time low.

The State of Open-Source Quadruped Projects

The open-source quadruped movement didn’t happen overnight. From the earliest SpotMicro (a community-driven reverse-engineered open-source take on Boston Dynamics’ Spot) to the more mature OpenDog, and now to sesame-robot with ESP32 at its core, the field has gone through three key generations:

GenerationRepresentativeControllerServo TypeStructureEntry Cost
1st GenSpotMicroRaspberry Pi + PCA9685MG996R3D-printed PLA$300–500
2nd GenOpenDog / Stanford PupperRaspberry Pi / Jetson NanoSerial bus servosCNC / 3D print$500–1000
3rd Gensesame-robot / POPIESP32MG90 / MG996R3D-printed PLA$200–500

sesame-robot’s key breakthrough is choosing the ESP32 as the main controller. Unlike a Raspberry Pi, which needs an additional PWM driver board like the PCA9685, the ESP32 has built-in WiFi/BLE wireless and 16 hardware PWM channels. And compared to a Jetson Nano’s high power draw and price tag, the ESP32 consumes under 1W and costs just $3–5. This choice alone slashes the entry cost of quadruped robotics by a wide margin.

Core Component Breakdown

A complete DIY quadruped robot requires the following components:

Controller: ESP32

The ESP32 is an excellent choice, for these reasons:

  • Dual-core 240 MHz processor, capable of handling real-time PWM for 8 servos and inverse kinematics computations simultaneously
  • 16 hardware PWM channels, eliminating the need for a separate driver board
  • WiFi + BLE dual-mode wireless, enabling mobile app or web-based remote control
  • Ultra-low power consumption (~0.5W), easily powered by a standard LiPo pack
  • Arduino IDE / PlatformIO ecosystem, with rich documentation and community support

Recommended models: ESP32-WROOM-32 dev board ($5), or the more capable ESP32-S3 dev board ($8).

Servo Selection

Each leg on a quadruped robot typically has 2 degrees of freedom (hip + knee), requiring 8 servos total. Common options:

ModelTorqueSpeedPriceBest For
SG901.8 kg·cm0.1s/60°~$2 eachPrototype validation, ultra-small builds
MG90S2.2 kg·cm0.1s/60°~$4 eachRecommended starter: metal gears much more durable
MG996R10 kg·cm0.17s/60°~$6 eachLarger / heavier designs
LD-1501MG15 kg·cm0.17s/60°~$12 eachHigh-torque requirements

For a first build, MG90S offers the best value — the metal gears are far more durable than the SG90’s plastic ones for just twice the price. If the robot is larger (>1 kg body weight), upgrade to MG996R.

3D-Printed Structural Parts

PLA is the go-to material for 3D-printed structural components. It’s easy to print, non-toxic, and perfectly suitable for prototyping and validation. For parts requiring higher strength (such as joint connectors), PETG or ABS can be used.

Recommended print settings:

  • Layer height: 0.2 mm (balance of speed and quality)
  • Infill: 30–50% (50% for structural parts, 30% for cosmetic parts)
  • Supports: depends on part design — some parts print support-free

Designs can be modified in OpenSCAD, Fusion 360, or Onshape.

Power and Sensors

  • Battery: 7.4V 2S LiPo (RC hobby battery) or a 2×18650 series pack. The servos and ESP32 should have separate power: servos connect directly to the battery, while the ESP32 gets regulated 3.3V through a step-down module (LM2596 or AMS1117-3.3).
  • IMU: MPU6050 (6-axis) or MPU9250 (9-axis) for body attitude sensing and stabilization.
  • Optional: Ultrasonic module (obstacle avoidance), OLED display (status), Bluetooth gamepad (remote control).

Technical Implementation Essentials

Inverse Kinematics Basics

Each leg of a quadruped robot can be modeled as a two-link mechanism (hip + knee). The joint angles are calculated from the foot’s target position using these formulas:

L1 = upper leg (thigh) length
L2 = lower leg (shin) length
x, z = foot target coordinates

c² = x² + z²
θ₂ = acos((L1² + L2² - c²) / (2 × L1 × L2))
θ₁ = atan2(z, x) - atan2(L2 × sin(θ₂), L1 + L2 × cos(θ₂))

On an ESP32, this computation completes in microseconds — all 8 legs’ calculations together take less than a few milliseconds.

Gait Control Fundamentals

Quadruped gait is essentially a cycle of “keeping balance with three legs while moving one.” Common gaits:

Gait TypeSpeedStabilityComplexityDescription
WalkLowHighLowTripod gait, 3 legs on ground, 1 leg moving — best for beginners
TrotMediumMediumMediumDiagonal legs move together (horse-like trot)
CrawlVery lowVery highLowOnly one leg lifted at a time — extremely stable
PaceMediumMediumMediumSame-side legs move together (camel-like pace)

For beginners, start with a walk (tripod gait): group diagonal legs into two sets (left-front + right-hind, right-front + left-hind). When one group lifts, the other supports.

ESP32 Programming Environment

PlatformIO is the recommended development environment. Core loop structure:

// Servo control and IK main loop
void loop() {
  // 1. Read current gait phase
  // 2. Compute foot target positions (based on gait pattern and phase)
  // 3. Run inverse kinematics for each joint angle
  // 4. Write PWM values to servos
  // 5. Read IMU orientation, adjust joint angles for balance
  delay(10); // ~100 Hz control rate
}

Key libraries:

  • ESP32Servo — hardware PWM for ESP32
  • MPU6050_tockn — IMU data readout
  • WiFi / WebServer — wireless control interface

Attitude Stabilization

Open-loop IK walking works, but the robot will fall over on uneven ground. Adding IMU feedback stabilization dramatically improves robustness.

The basic idea: read the body’s roll and pitch angles from the MPU6050 in real time, compare them with the target (0°), and apply PID compensation to each leg’s joint angles:

// Attitude stabilization (simplified)
float roll = mpu.getAngleX();    // roll angle
float pitch = mpu.getAngleY();   // pitch angle

float rollError = 0 - roll;      // target 0°
float pitchError = 0 - pitch;

// PID compensation = Kp × error + Ki × integral(error) + Kd × derivative(error)
float compensation[4][2];        // compensation per leg (hip/knee)
// Map roll/pitch errors to per-leg adjustments
// Add compensation to the angles from IK

In practice, PID tuning is an iterative process — start with Kp to get fast recovery from disturbances, add Kd to dampen oscillations, then Ki to eliminate steady-state error.

The Open-Source Ecosystem

Starting from sesame-robot, the broader quadruped ecosystem includes:

  • sesame-robot — lightweight ESP32-based quadruped, clean code, ideal for beginners
  • SpotMicro — the most classic open-source quadruped re-creation, Raspberry Pi platform
  • OpenDog — larger, more professional open-source quadruped with CNC metal structure
  • Stanford Pupper — 12-DOF dog robot designed at Stanford, excellent open-source codebase
  • POPI — French maker’s ESP32 quadruped with thorough design documentation
  • Argo Robot — sim-to-real transfer for reinforcement learning gait control

Budget and Getting Started

Starter Kit ($200–300 Budget)

ComponentModel/SpecQtyEst. Price
ControllerESP32-WROOM-321$5
ServosMG90S (metal gear)8~$32
3D PrintingPLA structural parts1 set~$10 (self-print) / ~$40 (service)
Battery2S 7.4V 1200mAh LiPo1$15
RegulatorLM2596 buck converter1$2
IMUMPU60501$3
Jumper wires / headersassorted1 set$5
BT gamepadoptional1$15
Screws / nutsM2/M3 assorted1 set$10
Total~$97–135 (excl. paid 3D printing)

Advanced Build ($400–500)

  • Controller upgrade: ESP32-S3 + optional Jetson Orin Nano co-processor (for vision)
  • Servo upgrade: LD-1501MG serial bus servos (8 × $12 = $96)
  • More sensors: ToF laser distance sensor + camera + OLED display
  • Structure: ABS printing + aluminum reinforcement

Step-by-Step Guide

  1. Run the simulation first: Clone the sesame-robot repo from GitHub, read and understand the IK code on your PC
  2. Print the parts: Download the STL files, print locally or use a cloud printing service
  3. Assemble the skeleton: Mount servos into 3D-printed parts, paying attention to servo neutral calibration
  4. Wiring and power: Use separate power paths — servos on battery, ESP32 on regulated supply
  5. Flash the firmware: Upload via PlatformIO, debug over serial
  6. Tune parameters: Adjust servo angle offsets, gait parameters, and PID values
  7. Walk test: Start with a slow walk gait, gradually increase speed

Closing Thoughts

The reason m0rg0t-anton’s post resonated so strongly isn’t because the technology was cutting-edge — it’s precisely the opposite: reproducibility. When more and more people can put together a walking robot dog on their desk for $200, quadruped robotics ceases to be the exclusive domain of MIT and Boston Dynamics.

This is the true power of open-source hardware: it tears down walls of knowledge and lets anyone with curiosity and hands-on ability stand on the shoulders of giants. From sesame-robot to SpotMicro to OpenDog, these projects feed not just a few robot enthusiasts — they nourish an entire generation of robotics education.

With an ESP32, a 3D printer, and a weekend, it’s time to start building. Quadruped robotics has never been this accessible.


References: Reddit r/robotics (u/m0rg0t-anton), GitHub sesame-robot repository, SpotMicro community docs, OpenDog Wiki, Stanford Pupper open-source codebase. Pricing as of June 2026. All prices in USD.