Connecting to sources…

How to build Shanmao AI desktop humanoid (Otto-based): the whole process

194 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

PartQty
Body · Otto_body · PLA / Resin1
Head · Otto_head · PLA / Resin1
Legs · Otto_leg · PLA / Resin2
Feet · Otto_foot · PLA / Resin2

Bill of materials · 3D-printed part

PartQty
Body · Otto_body · PLA / Resin1
Head · Otto_head · PLA / Resin1
Legs · Otto_leg · PLA / Resin2
Feet · Otto_foot · PLA / Resin2
Version · Release dateDescription
---
v1.0 · 2025-4-9Initial version
v1.1 · 2025-4-16Added head-2828 speaker with antenna
v1.2 · 2025-4-26body supports 2828 speaker, supports 1
v1.3 · 2025-5-15Reduced 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.

  • Follow the Otto replication tutorial

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.

  • 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.

  • Verify automatic board version detection

    Start the firmware; it configures GPIO15 and GPIO16 as inputs with internal pulldowns. The CAM board configuration is selected when both pins remain stably high after continuous sampling; otherwise the no-camera configuration is selected.

  • Enable automatic camera detection
  • Configure Otto in Xiaozhi

    Configure the Xiaozhi backend identity with the supplied Otto role description, including four servo-controlled limbs, basic movement, special actions, hand actions, and emotion-based behavior.

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.

  • 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.

  • Set action speed and amplitude

    Use speed 1200–1500 for precise low-speed motion, 900–1200 for recommended daily motion, and 500–800 for high-speed performance. Use amount 10–30 for small movements, 30–60 for standard movements, and 60–120 for exaggerated movements.

  • Configure Charging-State Detection

    For the camera version, connect a USB host such as a computer; the firmware immediately reports charging when `usb_serial_jtag_is_connected()` is true. GPIO21 is unavailable for separate charging detection because it is used for camera D2.

  • Detect Charger by Battery Voltage

    With a non-enumerating USB charger, the firmware compares 2-second fast-average and 10-second slow-average battery voltages, switching charging or discharging after two consecutive sampling periods change by more than 25 mV.

  • Calculate Battery Level

    Use the ADC-calibrated battery voltage and the six-point OCV-SOC curve to calculate the battery level. The charging icon updates about 2 seconds after the charger is connected or removed; if the robot starts with a nearly full battery already connected to the charger, the voltage-only method may not distinguish the state immediately.

  • 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.

  • Develop Troubleshooting Skills

    Be able to identify and resolve basic hardware and software problems.

  • Set Up and Test AI Features

    Allow 0-1 hours to set up and test the AI features.

Use it

  • Control Otto with WeChat

    Scan the QR code shown in the document and use the WeChat mini program to control the Otto robot.

  • Invoke the unified action tool

    Invoke every movement through the `self.otto.action` tool and specify the movement with the `action` parameter.

  • Walk

    Call the `walk` action with `steps`, `speed`, `direction`, and `arm_swing`.

  • Turn

    Call the `turn` action with `steps`, `speed`, `direction`, and `arm_swing`.

  • Jump

    Call the `jump` action with `steps` and `speed`.

  • Swing left and right

    Call the `swing` action with `steps`, `speed`, and `amount`.

  • Moonwalk

    Call the `moonwalk` action with `steps`, `speed`, `direction`, and `amount`.

  • Bend the body

    Call the `bend` action with `steps`, `speed`, and `direction`.

  • Shake the leg

    Call the `shake_leg` action with `steps`, `speed`, and `direction`.

  • Move up and down

    Call the `updown` action with `steps`, `speed`, and `amount`.

  • Whirlwind leg

    Call the `whirlwind_leg` action with `steps`, `speed`, and `amount`.

  • Sit

    Call the `sit` action; it requires no parameters.

  • Showcase

    Call the `showcase` action; it requires no parameters and chains multiple actions.

  • Return to the home position

    Call the `home` action through `self.otto.action` to return the robot to its initial position.

  • Raise the hands

    Call the `hands_up` action with `speed` and `direction`; it requires hand servos.

  • Lower the hands

    Call the `hands_down` action with `speed` and `direction`; it requires hand servos.

  • Wave the hand

    Call the `hand_wave` action with `direction`; it requires hand servos.

  • Windmill arms

    Call the `windmill` action with `steps`, `speed`, and `amount`; it requires hand servos.

  • Takeoff

    Call the `takeoff` action with `steps`, `speed`, and `amount`; it requires hand servos.

  • Fitness

    Call the `fitness` action with `steps`, `speed`, and `amount`; it requires hand servos.

  • Greeting

    Call the `greeting` action with `direction` and `steps`; it requires hand servos.

  • Shy

    Call the `shy` action with `direction` and `steps`; it requires hand servos.

  • Radio calisthenics

    Call the `radio_calisthenics` action; it requires no parameters and hand servos.

  • Magic circle

    Call the `magic_circle` action; it requires no parameters and hand servos.

  • Set the action name

    Set the required `action` parameter to a name 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 action last longer.

  • Set the action speed

    Set `speed` from 100 to 3000, with a default of 700; smaller values are faster. Most actions use 500–1500 milliseconds, while special actions can differ, such as whirlwind leg at 100–1000 and takeoff at 200–600.

  • Set the 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; for hand actions, 1 means left hand, -1 means right hand, and 0 means both hands only for hands_up and hands_down.

  • Set the action amount

    Set `amount` from 0 to 170, with a default of 30. Larger values produce greater movement amplitude.

  • Set the arm swing

    Set `arm_swing` from 0 to 170, with a default of 50. It applies only to walk and turn, and 0 disables arm swinging.

  • Raise Both Hands

    Call self.otto.action with action hands_up, speed 500, and direction 1.

  • Wave a Hand

    Call self.otto.action with action hand_wave and direction 1. This action requires a hand servo.

  • Stop All Actions

    Call self.otto.stop with no arguments to stop all actions immediately.

  • Get Motion Status

    Call self.otto.get_status to return either "moving" or "idle".

  • Get IP Address

    Call self.otto.get_ip to retrieve the device's IP address.

  • Get Battery Level

    Call self.battery.get_level to retrieve the battery level.

  • Get Device Status

    Call self.get_device_status to retrieve status information such as volume, network, and battery.

  • Set Speaker Volume

    Call self.audio_speaker.set_volume with volume set to 70. The permitted volume range is 0 to 100.

  • Reboot Device

    Call self.reboot with no arguments to reboot the device.

  • Run Normal Servo Sequence

    Call self.otto.servo_sequences with a normal sequence that moves the servos step by step.

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

Documents