How to build Stack-chan: the whole process
177 steps to build Stack-chan, from buying parts, printing and assembly to software, calibration and training, with the bill of materials, shop links and the official so…
Assembled M5StackChan $99, $125 with remote (M5Stack store); JP¥18,590 incl. tax at Switch Science. DIY reference: CoreS3 $59.90 and StackChan Body $55 (M5Stack store), SCS0009 servo JP¥1,738 (Switch Science); the repo puts SG90 at about JP¥500 and RS304MD at about JP¥3,000. Printing, PCB, battery and shipping excluded
Buy parts
- Choose the StackChan K151 bundle
Purchase the K151 bundle, which includes the StackChan unit with CoreS3 pre-installed, carrying bag or box, USB Type-C cable, extension cable, hex keys, expression sticker, and printed manual.
- Choose the remote controller kit
Purchase the K151-R bundle, which includes the StackChan unit with CoreS3 pre-installed, a remote controller assembled from a Hat Mini JoyC and StickC-Plus, carrying bag or box, USB Type-C cable, extension cable, hex keys, expression sticker, and printed manual.
- Prepare the case and electronics
Prepare the 3D-printed Shell, Feet, Bracket, and Battery backpack, along with an M5Stack Core, Stack-chan board, two servos, a 3.7V battery with a PH 2-pin cable, and screws.
- Prepare the host PC and required components
Prepare a Windows, Mac, or Linux host PC; the tested environment is Ubuntu 24.04. Also prepare an M5Stack Basic/Core2/CoreS3, a USB Type-C cable, git, and Node.js.
- Buy a preassembled Stack-chan
The standard M5StackChan AI Desktop Robot (K151) package is enough to get started; the joystick remote controller is optional.
- Choose the servo type
Choose two servos: PWM (SG90) is low cost at about 500 yen and leaves PortC available; serial (RS304MD) costs about 3,000 yen and supports speed limits and current angle reading, but PortC is unavailable.
Print and make
- Print the STL case files
Print the STL files in each directory using the recommended orientation shown below.
- Order the SMD PCB
Use the Gerber Files, BOM (Bill of Materials), and CPL (Component Placement List) to order SMD (Surface Mount Device) PCBs from PCB manufacturers such as JLCPCB.
Assemble
- Install the Leg Servo Gear
Insert the small cross-shaped gear_xl330 into the servo with id=1 and align the gear protrusions with the holes on the XL330.
- Attach the Upper Foot
Insert it into feet_top with the notched protrusion facing forward, then secure it from the back with M2.5x6mm tapping screws.
- Slide the Bottom Foot
Slide feet_bottom into place.
- Install the Neck Servo Gear
Like the leg servo, insert gear_xl330 into the servo with id=2.
- Secure the Neck Servo
Secure it with M2.5x6mm tapping screws.
- Attach the Servo Horn
Attach the horn.
- Attach the Servo Cables
Attach the servo cables.
- Join Upper and Lower Servos
Use bracket_XL330_f to combine the upper and lower servos.
- Secure Upper and Lower Servos
Use bracket_XL330_b to secure the upper and lower servos.
- Connect the Board and Servos
Connect the circuit board and servos with cables.
- Slide the Horn into the Shell
Slide the horn into the shell.
- Secure the Board and Shell
Secure the circuit board and shell at 4 points with 2x4mm pan tapping screws.
- Insert the M5Stack Body
Insert the M5Stack body.
- Assemble the printed parts and electronics
Assemble the robot using the printed Shell, Feet, Bracket, and Battery backpack, the M5Stack Core, Stack-chan board, two servos, 3.7V battery, and the specified screws.
- Snap Servos Into Bracket
Snap two servos into the bracket.
- Insert Battery Into Backpack
Insert the battery into the backpack.
- Hook Battery Pack Into Bracket
Insert the battery pack into the bracket by hooking the claws.
- Fix Feet and Shell With Screws
Fix the feet and shell using one M2-8mm screw for each.
- Connect Servo and Battery Cables
Connect the servo and battery cables to the board, and double-check that every connector is oriented correctly.
- Assign Serial Servo Axes
For serial servos, ID 1 is for the foot side on the pan axis, and ID 2 is for the face side on the tilt axis.
- Connect SCS0009 Signal Line
For the SCS0009, connect the signal line, shown as the white cable, to the write pin.
- Fix Board Onto Robot
Fix the board onto the robot using four M2-4mm screws.
- Stack M5Stack On Robot
Stack the M5Stack on the robot.
- Optionally Fix M5Stack
To fix the M5Stack, use the two lower holes and two M3-15mm screws to secure it in place.
- Connect the M5Stack to your PC
Connect the M5Stack to the PC using USB.
Software
- Install CoquiTTS
Install CoquiTTS with pip install TTS. If installation does not work well on Windows, use a TTS-Server running on another Linux environment over the network.
- Start the TTS-Server
Start the TTS-Server on port 8080 with the tts_models/ja/kokoro/tacotron2-DDC model.
- Configure server host and port
Use --host for the TTS-Server hostname or IP address and --port for its port. These values are normally read from host/app/manifest_local.json, but command-line values take precedence; specify them in one of the two places.
- Set the speech pitch shift
Use --shift to set the pitch shift from 0.5 to 2, where 1 leaves the CoquiTTS output unchanged. If omitted, SynthProps.shift from the input file is used, or 1.5 if that is also undefined; an enabled shift produces a 44.1KHz output sampling rate.
- Specify input and output paths
Use --input for the input file; when omitted, speeches.js in the current directory is used if present, otherwise ./host/modules/audio/assets/sounds/speeches_ja.js. Use --output for the output directory; when omitted, an assets directory beside the input is used if present, otherwise the input file's directory.
- Generate Coqui speech files
Run generate-speech-coqui from the stack-chan/firmware directory with the example input and output paths. When specifying options, add -- after the command as shown.
- Install and launch VOICEVOX
Download and install the Windows, MAC, or Linux version from the VOICEVOX website. After installation, launch VOICEVOX so its running engine will be used for speech generation.
- List VOICEVOX characters
When no value is specified, all characters are displayed and the process exits. When a SpeakerId is specified, only the character with that Id is displayed.
- Set the VOICEVOX host
Specify the hostname or IP address of the VOICEVOX engine. If omitted, the default is 127.0.0.1.
- Set the VOICEVOX port
Specify the port number of the VOICEVOX engine. If omitted, the default is 50021.
- Select a VOICEVOX character
Specify the character to speak with its SpeakerId. If omitted, the default is SpeakerId:1 Zundamon (Amaama).
- Set speaking speed
Specify the speaking speed from 0.5 to 2. The default value when omitted is 1.
- Adjust voice pitch
Adjust the pitch of the voice from -0.15 to 0.15. The default value when omitted is 0.
- Set voice intonation
Specify the strength of the voice intonation from 0 to 2. The default value when omitted is 1.
- Set audio sampling rate
Specify the sampling rate of the output audio file. The default value when omitted is 11025 (11.025KHz).
- Specify the speech input file
Specify the input file name. If omitted, it defaults to speeches.js in the current directory when present; otherwise it defaults to ./host/modules/audio/assets/sounds/speeches_ja.js, assuming execution in the ~/stack-chan/firmware directory.
- Specify the output directory
Specify the output directory. If omitted, it defaults to the assets directory under the input file's directory when it exists; otherwise it defaults to the same directory as the input file.
- Generate VOICEVOX speech files
Run the example command in the ~/stack-chan/firmware directory to read the monologue speeches_monologue.js file and place the output in the monologue assets directory. When specifying options, add “ -- ” after the command as shown in the example.
- Enter Download Mode
Connect StackChan to a computer with a USB Type-C data cable; using the base port is recommended to avoid accidents caused by motor movement. Hold RST for 3 seconds, release it when the adjacent indicator LED turns green, and confirm that the LED turns off to indicate download mode.
- Download the StackChan World app
Download StackChan World from the iOS App Store, Android Play Store, or Android APK package. The app supports iOS and Android.
- Launch the app and sign in
After installing the app, launch it and log in. Register for an M5Stack account if needed; use the same account as UiFlow, M5Burner, and the M5Stack Forum.
- Power on StackChan
Connect a power source to the bottom USB-C port, or short-press the power button on the left side. The screen will display the welcome page.
- Continue to device pairing
After the servo test finishes, tap Next twice, displayed as “Next - Next.” Then open the StackChan World app on your phone.
- Scan for a nearby StackChan
Tap Add a new StackChan in the app. The phone scans for nearby devices broadcasting Bluetooth pairing requests and displays them in a list.
- Select the matching StackChan
Select the listed device whose ID matches the MAC address shown on the StackChan screen. Follow the app instructions to begin configuration.
- Configure device and AI settings
Set Device name, Name, Conversation language, AI model, Voice, speech rate and pitch, User speech recognition speed, Personality, and Memory. Enter the 2.4 GHz Wi-Fi name and password; 5 GHz is unsupported, and the currently connected Wi-Fi name can be filled in automatically after authorization.
- Finish binding and setup
After all settings are completed, StackChan restarts automatically. The device binding and setup are then complete.
- Download apps from App Center
Open App Center to download online applications, including a pipe-jumping mini game, an IMU stabilizer, and a universal IR learning remote.
- Update StackChan firmware
The device checks for firmware updates online, automatically downloads and installs them, and then restarts.
- Open StackChan mobile app settings
Access settings for multi-device management, device name, AI Agent profile, MCP, conversation history, device unbinding, and other options.
- Install M5Burner on your computer
Download M5Burner for Windows using the win-x64 ZIP, for macOS using the mac-x64 DMG, or for Linux using the linux-x64 ZIP.
- Download the latest official firmware
Open M5Burner, search for StackChan, select Only Official, and click Download to retrieve the latest firmware version.
- Connect StackChan to the computer
Connect the computer and StackChan with a USB-C cable. Use the base USB-C port for data transfer to avoid accidental movement, then press the power button once to turn on the device.
- Allow macOS USB access
If macOS displays a permission prompt, allow it so the computer can communicate with StackChan.
- Flash the factory firmware
Click Burn, select the port corresponding to StackChan, and click Start. Wait until the progress bar shows that the flashing process is complete.
- Write the host firmware first
The host provides Stack-chan's basic operation. Write it before writing or installing any mods.
- Install a user mod
A user application is the mod. An installed mod replaces the product default behavior and receives the runtime context through `onContextCreated`.
- Create host and mod manifests
Give both the host and mod a `manifest.json`, JavaScript module source code, and resources such as images and audio. Declare module names and locations under `modules` and referenced configurations under `config`.
- Include other manifest files
A manifest file can include other manifest files. Add the included manifest files with the `include` field.
- Build and flash the standard host
Build and flash the standard M5StackChan CoreS3 host without `sudo`. Release mode is the default; pass `--mode=debug` or `--mode=instrument` explicitly when needed.
Calibrate and test
- Begin the servo test
On the welcome page, tap Start. Place StackChan on a firm, stable surface without touching it, then tap Start again.
- Complete the servo movement test
StackChan moves left, right, and up in sequence, then returns to its initial position. The screen must end perpendicular to the base and centered between the two feet.
- Configure Wi-Fi channels and receiver IDs
Place the receiver and sender on the same Wi-Fi channel. Set a nonzero receiver ID, set the sender's target ID to the receiver's ID for individual control, or set it to 0 to broadcast to all receivers; multiple receivers can share one ID for group control.
- Configure StackChan's on-device settings
In Setup, configure Wi-Fi network, screen brightness, speaker volume, time zone, servo calibration, RGB strip test, account unbinding, firmware update, and other device settings.
- Calibrate the servo home position
Enter the calibration screen, gently rotate the device to its initial position with the screen perpendicular to the base and centered between the two feet, then tap Set Current Position As Home. Rotate it away from the initial position and tap Move To Home; if it returns, tap Done to complete calibration.
- Identify the StackChan USB port
Expand the port list in M5Burner, disconnect StackChan, and note which port disappears. Reconnect the device to confirm its corresponding port.
- Enter StackChan download mode
If the device port does not appear, press and hold RST for 3 seconds. Release the button when the adjacent indicator turns green, indicating download mode.
- Configure StackChan in the mobile app
Open the StackChan World mobile app to configure StackChan for first use.
- Grant Bluetooth pairing permissions
If “Add a new StackChan” shows pairing instructions instead of nearby devices, check that the app has Bluetooth access and other required permissions.
- Retry the pairing process
After granting the required permissions, retry pairing in the StackChan World app.
- Use a supported 2.4 GHz network
Connect StackChan to a 2.4 GHz Wi-Fi network. Do not use a 5 GHz network or a network with web-based login authentication.
- Switch networks and retry
If connectivity is poor, speech is intermittent or choppy, or the green listening LED does not light, switch to a different network and try again.
- Confirm AI Agent mode
Check that StackChan has entered AI Agent mode before attempting voice wake-up.
- Move closer and increase volume
Move closer to StackChan, follow the demonstrated pronunciation, and increase the device volume to attempt wake-up.
- Tap the screen to wake
Tap the screen once to wake StackChan. When wake-up succeeds normally, the top LED lights green.
- Select the XL330 USB Connection
Open Options and select the USB connected to the XL330.
- Scan and Find the XL330
Click Scan; the XL330 will appear on the left, ready for communication.
- Select XL330 from the List
Select XL330 from the list on the left.
- Change ID and Baud Rate
Click each ID and Baud Rate item, select '1000000bps' from the bottom-right dropdown, and press Save to apply the parameters.
- Connect Servos One by One
Connect the servos one by one when changing the ID, because multiple servos with the same ID cannot be connected.
- Edit local configuration
Modify `stack-chan/firmware/host/app/manifest_local.json` for local settings. Its `config` object starts empty so private IP addresses, API keys, and bench-specific servo settings are not committed.
- Add settings under config
Write the documented settings under the `config` key in the manifest file. Refer to the Moddable official documentation for all configuration items.
- Select the correct servo driver
A build without local driver settings may select the default serial servo driver. Set `config.driver.type` explicitly when the hardware uses a different driver.
- List additional manifest paths
Under the `include` key, specify paths for other manifest files in list format.
- Check the default pitch limits
The `m5stackchan` driver defaults to a 5–85° pitch range, corresponding to `rotation.p` from −85° to −5°; a neutral request for `rotation.p = 0` is clamped to the 5° lower limit. Verify mechanical clearance before changing the defaults, because extreme pitch angles can stall the servo and cause permanent damage.
- Select the CoreS3-specific configuration
Choose "M5StackChan CoreS3" when using its specific servo, power, and LED configuration.
- Confirm flashing is complete
The Stack-chan firmware is installed when flashing is complete.
- Change settings for another servo
To use a different type of servo, refer to the document about changing Stack-chan settings from the browser.
- Test the Development Environment
Run npm run doctor; on success, it displays the Moddable SDK version and esp32 under supported target devices.
- Change Device Preferences
Change the device preferences with the Stack-chan browser tools.
Data and training
- Check EZData availability
EZData is not available yet.
- Capture benchmark statistics
Use it
- Try a MOD in the gallery
Choose a MOD from the MOD Gallery, then try it in the simulator or on the M5StackChan device.
- Use the robot context APIs
Use the capability-oriented context APIs to control faces, motion, input, audio, camera, and connectivity.
- Choose a supported motor configuration
Run Stack-chan with Feetech, FUTABA, DYNAMIXEL, or PWM servo motor configurations.
- Select a speech service
Generate Stack-chan speech through Stack-chan Voice, VOICEVOX, ElevenLabs, or OpenAI.
- Use the native WebRTC backend
The native WebRTC conversation backend is available in standard CoreS3 and M5StackChan CoreS3 builds. Follow the linked activation and acceptance document.
- Open the browser-based robot tools
Use the browser to access firmware installation, BLE preferences, the MOD Gallery, block editor, face editor, and WebAssembly simulator.
- Select the interface language
Use the firmware and web interface in Japanese, English, or Simplified Chinese.
- Open the MOD Gallery
Open the Stack-chan MOD Gallery to find published MODs.
- Search and choose a MOD
Search MODs by name or capability, then run one in the simulator or on a device.
- Review capabilities and targets
Check the capabilities and supported targets displayed on the MOD card.
- Inspect source before installation
If a MOD uses an external service or network access, inspect its linked source code before installation.
- Check installation compatibility
At installation, the Gallery automatically checks the target chip, XS version, and firmware compatibility.
- Browse the example source code
Browse the source code in the examples directory for learning APIs, testing, and local development.
- Power On StackChan
Single-click the power button next to the USB-C port on the left side.
- Power Off StackChan
Press and hold the power button next to the USB-C port on the left side.
- Reset or Reboot StackChan
Single-click the RST reset button next to the microSD card slot on the bottom side.
- Choreograph StackChan's dance
In the mobile app's Bluetooth mode, use the Dance function to set music, movement rotation angles, and lighting colors for StackChan's dance.
- Avoid continuous screen tapping
Do not tap the screen continuously because continuous taps may accidentally exit wake-up mode.
- Browse the MOD Gallery
Find published MODs and mini apps in the MOD Gallery.
- Run or Install a MOD
Choose a MOD, then run it in the simulator or install it on a device.
Parts
- M5Stack controller: CoreS3 is standard; release firmware also supports M5Stack Basic and Core2
- Two servos: SG90 (PWM), or Feetech SCS0009 or RS30X (serial, case v0); case v1.0 uses two DYNAMIXEL XL330
- Stack-chan board: two PWM or two serial servo channels, PortB, external 5V and battery charging
- 3.7V Li-Po with PH 2‑pin lead (400 and 640 mAh tested) and M2 screws
- 3D-printed shell, feet, bracket and battery backpack (STEP/STL published)
- Assembled M5StackChan: CoreS3 plus body (550 mAh battery, two feedback servos for 360° continuous pan and 90° tilt, 12 RGB LEDs, IR, three-zone touch, NFC)
Tools
- 3D printer or a printing service (JLCPCB and DMM.make given as examples)
- Chrome or Edge and a data-capable USB cable (web flashing)
- Serial servo ID setup: Feetech URT1 (listed as discontinued at Switch Science) or ROBOTIS U2D2 + SMPS2Dynamixel + 5V supply
Skills
- Blockly or JavaScript/TypeScript (Moddable) for MODs
- Serial servo ID and centre-angle setup
- Optional: Arduino, UiFlow2, PlatformIO, ESP-IDF (M5StackChan factory route)
Software
- stack-chan firmware v2.0.1 (Moddable SDK 10.0.2) and the MOD Gallery
- Browser tools: installer, preferences, Blockly editor, face editor, simulator, MediaPipe BLE tracking
- M5Stack factory firmware (AI Agent powered by XiaoZhi) and the StackChan World app
- Community AI Stack-chan 2 (MIT): VOICEVOX speech with Google Cloud STT or OpenAI Whisper; not updated since 2024