Project Overview: A Masterclass in Hexapod Robotics
The Hex-Hex Fruit is more than just a toy; it is a sophisticated mobile robotics platform built from the ground up over the course of a year. Utilizing the powerful ESP32 microcontroller and 18 high-torque serial bus servos, this six-legged robot is designed for high-agility movement and real-time self-balancing on uneven terrain.
The project is a comprehensive blend of mechanical design (laser-cut wood and heat-bent acrylic), custom hardware integration, and complex Inverse Kinematics (IK) software.
Mechanical side: Form Meets Function
The chassis is a hybrid design using laser-cut wood for the core structural frame and organic glass (acrylic) for the legs.
- Leg Construction: Each leg is composed of three servos, providing three degrees of freedom (3-DOF) per leg. The organic glass components were bent into a curved shape using an industrial heat gun, which provides a spring-like resilience to the structure.
- Step Check System: To implement "ground feel," each foot is equipped with a microswitch. A spring-loaded metal rod triggers the switch when the leg touches the ground, allowing the software to realize that a stable step has been taken. This is essential for traversing irregular surfaces.


Hardware Engineering: Serial Bus Communication
One of the most technical aspects of Hex-Hex Fruit is the use of Serial Bus Servos (LewanSoul LX-16A). Unlike standard PWM servos, these servos communicate via a half-duplex UART bus. Each servo has a unique ID, allowing the ESP32 to command all 18 servos through a single data wire.
To facilitate this, the project uses a 74HC126 Buffer / Line Driver and a transistor-based NOT gate to handle the rapid switching between Transmit (TX) and Receive (RX) modes on the single-wire bus. This allows the ESP32 to not only send position commands but also read back temperature, voltage, and actual position data from the servos.
Power & Management
With 18 full-metal gear servos, the power requirements are significant.
- Battery Array: Four 18650 Li-ion batteries provide a 7.4V (nominal) supply.
- Dual Rail System: The 7.4V rail directly powers the high-torque servos, while a DC-DC buck converter steps the voltage down to 5V to provide a clean, stable supply for the ESP32 and the MPU-6050 IMU.
Software Architecture & Self-Balancing
The firmware, written in C++ and managed via PlatformIO, implements a sophisticated flight-controller-like logic:
- Inverse Kinematics (IK): Translates X, Y, Z coordinates for each foot into the specific angles required for each of the 18 servos.
- PID Balancing: Using data from the MPU-6050, the robot calculates its pitch and roll. A PID (Proportional-Integral-Derivative) loop adjusts the leg positions in real-time to keep the mainframe perfectly horizontal, even when the robot is standing on a slope.
- Bluetooth Interface: A custom mobile app allows for manual movement, gait switching, and real-time battery monitoring.


Conclusion
Hex-Hex Fruit represents the pinnacle of DIY hobbyist robotics. It breaks down the massive problem of hexapod locomotion into manageable modules: mechanics, power, communication bus, and control logic. For any student or engineer interested in advanced robotics, this project provides a world-class reference for building multi-legged machines.