Skip to main content
Version: ACS CC

Hexapod

A six-legged walking robot with Bluetooth control, ToF obstacle detection, and IMU-based stability monitoring.

info

Author: Vladimir-Nicolae Olteanu
GitHub Project Link: https://github.com/UPB-PMRust-Students/acs-project-2026-Vldd28

Description

A six-legged "spider" robot built around the STM32 Nucleo-U545RE-Q. It walks using a tripod gait. Three legs always in contact with the ground — driven by twelve MG90S servos (two per leg: one for hip swing, one for leg lift). The robot accepts movement commands over Bluetooth from a phone, continuously samples a forward-facing time-of-flight sensor for obstacles, and reads an IMU to detect dangerous tilt angles. When obstacles are detected it stops or autonomously reroutes; when tilt exceeds a safe threshold it parks itself.

Motivation

I wanted a project that combined embedded systems, real-time control, and mechanical design without falling into the "blink an LED" or "Arduino tutorial" category. A hexapod is a sweet spot: the tripod gait makes the locomotion problem tractable on an STM32 (no dynamic balancing required), but coordinating twelve servos against sensor feedback, designing the leg geometry, and managing power delivery for high transient currents are all genuine engineering challenges. It also gives me hands-on experience with I2C, UART, sensor fusion, and PWM fundamentals that transfer to almost any embedded role.

Architecture

Diagram

Log

Week 27 April - 1 May

Started modeling the 3D parts and ordered the necessary hardware parts.

Hardware

The robot is built around an STM32 Nucleo-U545RE-Q (Cortex-M33 @ 160 MHz, 512 KB flash, 272 KB RAM, hardware FPU + DSP) with a 2S LiPo power system. Twelve MG90S metal-gear servos drive the six legs (two degrees of freedom per leg: coxa for swing, femur for lift). A PCA9685 16-channel I2C PWM driver handles all servo signals to keep the MCU's timers and CPU free for the gait state machine and sensor fusion.

For sensing, an MPU6050 6-axis IMU provides accelerometer + gyroscope data for tilt detection, and a VL53L0X time-of-flight laser distance sensor handles forward obstacle detection. Both share an I2C bus with the PCA9685. An HC-05 Bluetooth module on a UART link receives commands from a phone-based controller app.

Power flows from a 2S 7.4V 2200mAh LiPo, through a UBEC stepping down to 5V/5A for the servos, to the PCA9685's V+ rail. The Nucleo is powered via its VIN pin from the same 5V rail, with logic and servo grounds tied together. Servos and logic are on separate power paths to prevent servo current spikes from browning out the MCU.

The chassis and legs are 3D-printed in PLA (body) and PETG (tibias, for some compliance on impact). Body footprint is roughly 20 × 15 cm; standing height ~9 cm.

Schematics

Bill of Materials

DeviceUsagePrice
STM32 Nucleo-U545RE-QMain microcontroller (Cortex-M33, 160 MHz, FPU+DSP, built-in ST-LINK/V3)Provided by university
PCA9685 16-channel PWM driverI2C-controlled PWM generation for all 12 servos25 RON
MG90S metal-gear servo × 14Leg actuation (12 in use, 2 spares)253 RON
GY-521 MPU6050 IMU6-axis accelerometer + gyroscope for tilt detection and stability monitoring25 RON
VL53L0X ToF sensorForward-facing laser distance sensor for obstacle detection (range up to 2 m)17 RON
HC-05 Bluetooth moduleWireless serial link for phone-based command input27 RON
Gens Ace 2S 2200mAh 30C LiPo (XT60)Main power source (7.4V)87 RON
B3AC LiPo balance chargerSafe charging and cell balancing for the LiPo74 RON
UBEC 5V/5A buck converterSteps down 7.4V LiPo to a stable 5V rail for servos and logic[FILL IN — pending purchase]
Piezo buzzer + WS2812 LEDAudio + visual status feedback (connect, low battery, obstacle)~10 RON
Misc. (jumper wires, perfboard, M2/M3 screws, 22 AWG silicone wire, heat-shrink, XT60 connector, switch)Wiring and mechanical assembly~60 RON

Software

LibraryDescriptionUsage
embassy-stm32Hardware InterfaceBase library for project.