How to build Shanmao AI desktop humanoid (Otto-based): the whole process
204 steps to build Shanmao AI desktop humanoid (Otto-based), from buying parts, printing and assembly to software, calibration and training, with the bill of materials, …
The BOM page estimates CN¥200–500 depending on sourcing and part quality; OSHWHub says about CN¥150; kit price not checked. 3D printer excluded
Bill of materials · 3D Printed Parts
| Part | Qty |
|---|---|
| Body · Otto_body · PLA / Resin | 1 |
| Head · Otto_head · PLA / Resin | 1 |
| Legs · Otto_leg · PLA / Resin | 2 |
| Feet · Otto_foot · PLA / Resin | 2 |
Bill of materials · 3D-printed part
| Part | Qty |
|---|---|
| Body · Otto_body · PLA / Resin | 1 |
| Head · Otto_head · PLA / Resin | 1 |
| Legs · Otto_leg · PLA / Resin | 2 |
| Feet · Otto_foot · PLA / Resin | 2 |
| Version · Release date | Description |
| --- | |
| v1.0 · 2025-4-9 | Initial version |
| v1.1 · 2025-4-16 | Added head-2828 speaker with antenna |
| v1.2 · 2025-4-26 | body supports 2828 speaker, supports 1 |
| v1.3 · 2025-5-15 | Reduced leg length to prevent arm cable snagging; modified |
Buy parts
- Learn Basic Circuit Concepts
Understand simple circuit concepts such as positive and negative poles and voltage.
- Recognize Basic Electronic Components
Recognize basic electronic components including resistors, capacitors, and sensors.
- Use a Multimeter
Use a multimeter for basic voltage and continuity measurements.
- Learn the ESP32 Board
Learn the basic structure and pin definitions of an ESP32 development board.
- Learn Wi-Fi Configuration
When studying the source code, learn the basics of Wi-Fi network configuration.
- Understand APIs and Requests
When studying the source code, understand API keys and basic HTTP and WebSocket request concepts.
- Learn LLM API Usage
When studying the source code, learn the basic use of large-model APIs.
- Prepare a Development Computer
Prepare a Windows, Mac, or Linux computer for programming and downloading programs.
- Prepare a USB Type-C Cable
Prepare a USB Type-C data cable to connect the ESP32 development board to the computer.
- Prepare a Multimeter
Prepare a multimeter for circuit testing and troubleshooting.
- Prepare Materials and Prints
Allow 1-5 days to purchase materials, make the PCB, and 3D print parts.
- Review the Bill of Materials
After confirming the basic requirements, review the /docs/bom bill of materials and prepare the required materials.
- Buy the complete robot DIY kit
The complete kit contains all required components and has already been programmed.
- Buy the ready-to-use robot
Choose the finished robot, which can be used immediately after delivery.
- Purchase components separately
Use the provided reference links if purchasing components yourself.
- View the v1.0 electronic components
View the v1.0 electronic components through the provided LCSC open-source link.
- Purchase the V1.1 electronic components
Except for the 6 mm-high boot button from Taobao, all matched components can be ordered with one click from LCSC; use the Taobao links above for unmatched parts.
- Buy the Official DIY Kit
Buy the Shanmaoxia robot DIY kit from the official store.
- View the Lichuang Components
View the Otto robot electronic components on the Lichuang open-source page.
- Purchase V1.1 Components
Use V1.1; order matched components through Lichuang and unmatched parts through the Taobao links above. The boot button has a 6mm height.
- Confirm the Total Budget
The estimated total cost of the Otto DIY robot is approximately ¥200–¥500, depending on the purchasing channel and component quality.
- Obtain the Otto Hardware Design
Print and make
- Learn 3D Printing Basics
Understand the basic principles of 3D printing.
- Download and Process STL Files
If printing the enclosure yourself, learn to download and process STL files.
- Use JLC 3D Printing
The document recommends JLC 3D printing.
- Paint Printed Parts
Spray-paint or color printed parts in any colors you prefer.
- Open the PCB Order Guide
Open the PCB ordering guide and use it to order the V1.1 PCB.
- Download the Print Models
Click the print-model link to download all STL/CAD files.
- Choose Part Versions and Quantities
The 3MF files are incomplete, so download and print the latest STL/CAD files. Body has versions with and without arms; both arms and legs use leg. Print four leg parts and two grip parts for the version with arms, or two leg parts for the version without arms.
- Order the PCB using the tutorial
Proceed to the PCB ordering tutorial in the documentation.
- Download the 3D-printing models
Download the STL/CAD printing models from MakerWorld.
- Print the latest body and parts
Print the latest version: the version with arms uses 4 leg parts and 2 grip parts, while the version without arms uses 2 leg parts.
Assemble
- Prepare all components
Prepare all components needed for assembly by referring to the bill of materials.
- Prepare assembly tools
Prepare diagonal cutters and an M2 screwdriver.
- Clean the workbench
Prepare a clean workbench before starting assembly.
- Check printed parts
Check whether all 3D-printed parts are complete.
- Remove support material
Remove the support material from the 3D-printed parts.
- Clear all holes
Ensure that all holes in the printed parts are clear.
- Install the leg servos
Install the servos on both sides; on the two-row three-pin connector, connect the outer brown servo wire (negative) using the upper-leg, lower-foot arrangement.
- Disconnect servo wires
Disconnect the servo wires and reconnect them after the body assembly is complete.
- Secure the leg servos
Use the two large screws included with the servo to secure it.
- Trim the servo cross arm
Trim the servo cross arm by cutting approximately half off each of its two longer ends.
- Install the cross arm
Install the trimmed cross arm onto the leg.
- Align the leg direction
Keep the cylindrical protrusion on each leg facing the screen side and the legs pointing straight forward; avoid inward or outward toes where possible, though a slight angle is acceptable.
- Secure and tighten the leg
Secure the leg and tighten the fixing screw.
- Install the Foot Servo Rocker Arm
Install the rocker arm in the shown shape vertically upward, and tighten the screws.
- Secure the Foot
Secure the foot in place.
- Route the Foot Servo Wire
Route the foot servo wire through the body.
- Install the Foot
Install the foot onto the robot.
- Install Foot Servo Screws
Install the screws that secure the foot servo.
- Secure the Speaker
Secure the speaker using the slot for its wire.
- Install Internal Components
Install the servo wires, speaker, battery, and antenna.
- Install the Mainboard
Install the mainboard in place.
- Check External Controls
Make sure the screen, Type-C charging port, and switch are all correctly installed.
- Install the Head Top Cover
Install the head top cover; its front protrusion presses the circuit board firmly.
- Handle Components Carefully
Handle the components carefully during assembly to prevent damage.
- Tighten Screws Firmly
Make sure all screws are tightened, but do not overtighten them.
- Check Servo Orientation
Check the installation orientation of the servos.
- Prepare a Phillips Screwdriver
Prepare a screwdriver set with a small Phillips screwdriver for assembly.
- Prepare Wire Cutters and Strippers
Prepare wire cutters and wire strippers for handling wires and connections.
- Prepare Soldering Tools
If soldering the circuit board yourself, prepare a soldering iron set with a heat gun or heating platform.
- Develop Hands-on Skills
Be able to assemble electronic components and mechanical parts according to the instructions.
- Solder the Robot Circuit Board
Optionally allow 2-4 hours to solder the circuit board.
- Assemble the Robot Hardware
Allow 1-2 hours to assemble the robot hardware.
- Assemble the kit using the video
Assemble it yourself following the video tutorial; assembly takes about 40 minutes.
Software
- Prepare the development environment and hardware
Prepare VS Code or Cursor, the official Espressif ESP-IDF extension, ESP-IDF v6.0.2, Git, a data-capable USB Type-C cable, and an Otto Robot mainboard with the battery installed. The project mainline recommends stable v6.0 or later, with v6.0.2 preferred.
- Clone the source and open the project
Clone the xiaozhi-esp32 repository, enter its directory, and open the directory in the editor.
- Install the toolchain and verify the version
When using the ESP-IDF extension for the first time, complete the toolchain installation according to the extension prompts. Confirm that the editor status bar shows ESP-IDF v6.0.2.
- Select the ESP32-S3 target chip
Click the target chip name in the editor's bottom status bar and select `esp32s3` from the popup list.
- Wait for configuration and open menuconfig
During the first project configuration, ESP-IDF downloads dependencies and generates build files, which may take a while. After configuration completes, click the gear button at the bottom to open the SDK Configuration Editor (menuconfig).
- Find the Target Board setting
In the SDK Configuration Editor, expand **Xiaozhi Assistant** and locate the **Target Board** setting.
- Select the Otto Robot board
Open the board list and select **Otto Robot**. If the option is absent, confirm that the target chip selected in step 1 is `esp32s3`.
- Enable WebSocket Support
Search for `websocket` at the top of the SDK configuration editor and check **Component config → HTTP Server → WebSocket server support**; some source versions enable it automatically, so do not change it if it is already checked.
- Save SDK Configuration
Click **Save** in the upper-right corner and wait for the configuration to finish writing.
- Build Otto Robot Firmware
- Connect Device and Select Port
- Flash Firmware and View Logs
Click the **Flash** button at the bottom of the editor, select **UART** when the flashing method appears, and wait for the terminal to report that flashing is complete. When troubleshooting startup problems, open the ESP-IDF serial monitor to view the logs.
- Reflash official firmware
To restore the official firmware, return to the firmware flashing page and flash the latest version again.
- Run Automatic Hardware Detection
Start the firmware; it configures GPIO15 and GPIO16 as inputs with internal weak pulldowns and selects the CAM-board configuration when both remain high after continuous sampling.
- Run Automatic Camera Detection
- Configure Otto's Xiaozhi Role
Configure the Xiaozhi role as a cute bipedal robot with four servo-controlled limbs: left leg, right leg, left foot, and right foot. Add the listed basic movements, special actions, and hand actions; hand actions are available only when hand servos are configured.
- Use the Local WebSocket
- Find Otto's IP Address
Confirm that Otto is connected to WiFi and obtain its IP address through the mini program or serial logs.
- Open a WebSocket Tool
Open a WebSocket debugging tool such as websocket.org/echo or the browser console.
- Connect to Otto
Connect to `ws://192.168.x.x:8080/ws`; the ending `/ws` is required.
- Send a JSON Command
Send a JSON command; the response returns directly on the same connection.
- Initialize the Protocol
On the first connection, initialize the JSON-RPC 2.0 protocol with protocol version `2024-11-05` and an incrementing `id`.
- Get the Tool List
Request the available tools with an empty `params` object and an incrementing JSON-RPC `id`.
- Open the Xiaozhi service
Use a browser to visit xiaozhi.me and open the Xiaozhi service.
- Register and sign in
Register an account in the Xiaozhi service, then sign in.
- Add and bind the device
Add the robot device and complete the binding by following the page prompts.
- Set the robot role
Set the robot's role, such as by entering its introduction.
- Choose a model type
Select the robot's large-model type in the service.
- Choose the role voice
Select the voice for the speaking role in the service.
- Paste the example role prompt
Copy and paste the provided OttoRobot example role prompt, which lists actions 1 through 16 and requests a random action command before each response according to the robot's mood.
- Flash the required firmware
Before using the WeChat Mini Program, flash firmware version otto2.0.4-2 or later onto the robot.
- Download the Tuya app
Download the Tuya app from the app marketplace.
- Use an ESP32 Development Environment
Become familiar with the ESP-IDF framework or the Arduino ESP32 environment.
- Compile and Upload ESP32 Code
Be able to compile a program and upload it to an ESP32 development board.
- Prepare the ESP-IDF Environment
Optionally use the official ESP32 ESP-IDF development environment.
- Learn Basic C/C++ Programming
Optionally learn to understand and modify C/C++ code.
- Install the Development Environment
Optionally spend 1-2 hours installing the development environment.
- Flash Firmware and Configure
Allow 0-1 hours to flash the firmware and complete configuration.
Calibrate and test
- Turn On the Robot
OttoRobot must be reconfigured whenever it enters a new Wi-Fi network. First turn on the robot.
- Wait for the Robot Hotspot
Wait for the robot to create a hotspot named `xiaozhi-XXXX`.
- Connect to the Robot Hotspot
Connect a phone to the `xiaozhi-XXXX` hotspot without a password.
- Enter Home Wi-Fi Details
After connecting to the hotspot, the web page opens automatically. Enter the home Wi-Fi name and password, then submit to finish configuration.
- Open the Xiaozhi Dashboard
Open a browser and visit `xiaozhi.me`.
- Register and Sign In
Register a Xiaozhi account and sign in.
- Add and Bind the Robot
Add the robot device in the dashboard and complete the binding by following the on-page instructions.
- Configure Dashboard Options
In the dashboard, configure the role setting, large-model type, and voice character sound.
- Restart the Device
Restart the robot device after completing the dashboard configuration.
- Set the OttoRobot Example Role
Copy and paste the example identity, motion abilities, and personality traits from this section into the role setting; the hand motions are available only when hand servos are configured.
- Choose Motion Speed and Amount
Use speed = 1200-1500 for low speed, 900-1200 for medium speed, and 500-800 for high speed. Use amount = 10-30 for small motion, 30-60 for medium motion, and 60-120 for large motion.
- Set Action Repetitions
Use steps to set the number of steps or repetitions in an action. A larger value makes the action last longer.
- Set Action Speed
Set speed within the range 500-1500. A smaller value makes the action execute faster.
- Set Action Direction
For movement actions, direction = 1 means left or forward and direction = -1 means right or backward. For hand actions, 1 means left hand, -1 means right hand, and 0 means both hands.
- Set Motion Amplitude
Set amount or arm_swing between 0 and 170 degrees. A larger value creates greater motion, and arm_swing = 0 means no arm swing.
- Configure Hand Servos
The hand actions marked with \* are available only after hand servos have been configured.
- Troubleshoot Wi-Fi Connection
Check that the Wi-Fi name and password are correct, ensure sufficient Wi-Fi signal strength, and try restarting the robot.
- Troubleshoot Voice Recognition
Keep background noise low, increase your speaking volume, and check that the wake word is correct.
- Troubleshoot Abnormal Actions
Check that the battery has sufficient charge, ensure the robot is in a stable state, and try restarting the robot.
- Set Otto Motion Parameters
- Set the Required Action Name
Set action to the name of a supported motion from the supported action list.
- Set the Number of Steps
Set steps from 1 to 100, with a default of 3. Larger values make the motion last longer.
- Set the Motion Speed
Set speed from 100 to 3000, with a default of 700; smaller values are faster. Most motions take 500-1500 milliseconds, while whirlwind_leg uses 100-1000 and takeoff uses 200-600.
- Set the Motion Direction
Set direction to -1, 0, or 1, with a default of 1. For walk and turn, 1 means forward or left and -1 means backward or right; for bend, shake_leg, and moonwalk, 1 means left and -1 means right.
- Set the Motion Amplitude
Set amount from 0 to 170, with a default of 30. Larger values produce greater motion amplitude.
- Set the Arm-Swing Amplitude
Set arm_swing from 0 to 170, with a default of 50. It is used only by walk and turn, and 0 disables arm swinging.
- Read Servo Trims
Call `self.otto.get_trims` with no arguments to retrieve the servo trim values.
- Set One Servo Trim
Call `self.otto.set_trim` to save one servo trim permanently. `servo_type` accepts `left_leg`, `right_leg`, `left_foot`, `right_foot`, `left_hand`, or `right_hand`; `trim_value` ranges from `-50` to `50`.
- Get the robot IP address
Ask the robot for its IP address.
- Enter the IP and configure control
Enter the robot's IP address in the WeChat Mini Program to control, calibrate, and customize actions. The phone and robot must be on the same network.
- Configure a new Wi-Fi network
Configure OttoRobot's network again whenever it enters a new Wi-Fi network environment.
- Start Bluetooth provisioning
- Add the Tuya device
Connect the phone to 2.4G Wi-Fi and enable Bluetooth, then discover and add the device from the top-right of the Tuya app. After entering the app interface, control the robot by voice or through the app.
- Troubleshoot Missing Otto Robot
Confirm that the target chip is `esp32s3`, then close and reopen the SDK configuration editor.
- Troubleshoot Component Download Stall
The first build requires an internet connection to download dependencies; check the network and retry, and confirm that the ESP-IDF extension uses stable version v6.0 or newer.
- Troubleshoot Missing Serial Port
Use a USB cable and USB port confirmed to support data transfer; during the first flash, hold **BOOT** while powering on. Windows users must also confirm that the serial port driver is installed correctly.
- Check cables and restart
Disconnect the power, check that the camera and other ribbon cables are properly connected, then power on again and view the serial log.
- Initialize servo positions
Turn on the switch to initialize the servos to 90 degrees; keep the servo gears unchanged during installation, with the arms initially pointing down at 45 degrees.
- Troubleshoot Stationary Servos
Restart the robot, check the wiring, confirm that the power supply is working, and verify that the program was flashed correctly.
- Fix Structural Instability
Check whether the screws are tightened and confirm that the 3D-printed parts are not deformed.
Data and training
- Walk Forward
Run the `walk` action for 3 steps at speed 700 in direction 1.
- Raise Hands
The raise-hands action requires hand servos.
Use it
- Control Otto with WeChat Mini Program
Scan the displayed QR code and use the WeChat Mini Program to control the Otto robot.
- Invoke the Otto Action Tool
Call every motion through the unified self.otto.action tool and select the motion by its action name.
- Perform the Walk Motion
Use walk for walking and provide steps, speed, direction, and arm_swing.
- Perform the Turn Motion
Use turn to rotate and provide steps, speed, direction, and arm_swing.
- Perform the Jump Motion
Use jump to jump and provide steps and speed.
- Perform the Swing Motion
Use swing for side-to-side swaying and provide steps, speed, and amount.
- Perform the Moonwalk Motion
Use moonwalk for the moonwalk motion and provide steps, speed, direction, and amount.
- Perform the Bend Motion
Use bend to bend the body and provide steps, speed, and direction.
- Perform the Leg-Shaking Motion
Use shake_leg to shake the leg and provide steps, speed, and direction.
- Perform the Up-and-Down Motion
Use updown for vertical movement and provide steps, speed, and amount.
- Perform the Whirlwind Leg Motion
Use whirlwind_leg for the whirlwind leg motion and provide steps, speed, and amount.
- Perform the Sitting Motion
Use sit to sit down; it requires no parameters.
- Perform the Showcase Motion
Use showcase to perform a sequence of multiple motions; it requires no parameters.
- Reset Otto to Home
Use home to reset the robot to its initial position. It requires no parameters and is called as {"action": "home"}.
- Raise the Hands
Use hands_up to raise the hands and provide speed and direction. This action requires hand servos.
- Lower the Hands
Use hands_down to lower the hands and provide speed and direction. This action requires hand servos.
- Perform the Hand-Wave Motion
Use hand_wave to wave and provide direction. This action requires hand servos.
- Perform the Windmill Motion
Use windmill for the windmill motion and provide steps, speed, and amount. This action requires hand servos.
- Perform the Takeoff Motion
Use takeoff for the takeoff motion and provide steps, speed, and amount. This action requires hand servos.
- Perform the Fitness Motion
Use fitness for the fitness motion and provide steps, speed, and amount. This action requires hand servos.
- Perform the Greeting Motion
Use greeting to greet and provide direction and steps. This action requires hand servos.
- Perform the Shy Motion
Use shy for the shy motion and provide direction and steps. This action requires hand servos.
- Perform Radio Calisthenics
Use radio_calisthenics for radio calisthenics; it requires no parameters but does require hand servos.
- Perform the Magic Circle Motion
Use magic_circle for the love-themed magic circle motion; it requires no parameters but does require hand servos.
- Check for Hand Servos
Actions marked with * are available only when hand servos are configured.
- Try Otto Voice Commands
Use commands for walking, turning, jumping, dancing, sitting, waving, raising hands, exercise, and stopping.
- Continue Receiving Commands
- Wave the hand
Wave the robot's hand using the hand servo.
- Stop all motion
Immediately stop all robot actions.
- Get motion status
Get the robot's motion status, which returns "moving" or "idle".
- Get the IP address
Get the robot's IP address.
- Get battery level
Get the robot's battery level.
- Get device status
Get device status information such as volume, network, and battery.
- Set the volume
Set the speaker volume to a value from 0 to 100.
- Reboot the device
Reboot the device.
- Run a normal servo sequence
Move the servos step by step: set ll to 110 and rl to 70 at speed 800, then set both to 90 at speed 800.
- Oscillate both arms
Oscillate the arms with lh and rh amplitude 30, both centered at 90, right-hand phase 180, period 500, and count 5.0.
- Oscillate a side-to-side wave
Oscillate with ll and rl amplitude 20, both centered at 90, right-arm phase 180, period 600, and count 5.0.
- Power On the Robot
The power control and charging port are underneath the robot. The battery level may be inaccurate, so charge it promptly to prevent unexpected shutdown.
- Wake the Robot with a Voice Phrase
Parts
- ESP32‑S3‑WROOM‑N16R8 (Espressif module recommended)
- Six SG90 9g servos (metal gears recommended; buy a spare)
- 1.54-inch 240×240 LCD, MAX98357A amp with a 2828 4Ω 3W speaker, ICS‑43434 microphone (or INMP441)
- 103450 2000 mAh Li-ion (V1.1 accepts an 18650 2200 mAh pack)
- Main PCB ordered from JLC and 3D-printed body, head, two legs and two feet (PLA or resin)
Tools
- 3D printer
- Soldering iron (the site has a soldering guide)
- Data-capable USB‑C cable
Skills
- SMD soldering
- Web flashing, or building the Otto Robot board with ESP‑IDF v6.0.2
- XiaoZhi persona and MCP service setup
Software
- txp666/xiaozhi-esp32 firmware (Otto Robot board)
- xiaozhi.me console and the Shanmao MCP service platform