StackChan: Build an Open-Source Talking ESP32-S3 Desk Robot

A robot that sits on your desk, looks up when you touch it, talks back, and can be reprogrammed by its owner is a surprisingly rare thing. StackChan is exactly that: an open-source desktop robot built on Espressif’s ESP32-S3 and the M5Stack CoreS3 platform, with published hardware drawings, readable firmware and a shell you can print yourself.

Two things set it apart from a sealed toy. The software is open — hardware drawings, firmware source and 3D-printable shell models are public, and the community shares firmware and decoration designs through a public platform. And the AI layer is replaceable: the bundled assistant can be pointed at different large language models, including DeepSeek, Qwen, Doubao and Kimi, so the robot is not tied to one vendor’s cloud.

StackChan ESP32-S3 desktop robot turning its head and changing expression on the touch screen
▲ StackChan turns its head and switches expressions on the 2.0-inch touch screen. Source: M5Stack StackChan (open-source project)

Inside the Hardware: Sensors, Speech and Motion

The robot’s brain is an ESP32-S3 with a dual-core 240 MHz processor, 8 MB of PSRAM and 16 MB of flash. Everything else hangs off that chip:

  • Display — a 2.0-inch 320×240 capacitive touch screen. Every expression is drawn here.
  • Vision — a 0.3 MP camera plus a proximity sensor, which is what lets the robot notice a face or a hand.
  • Sensing — a 9-axis IMU, an infrared transmitter and receiver, and an ambient light sensor.
  • Touch — a three-zone touch panel, plus a full NFC module for cards and tags.
  • Audio — dual microphones and a 1 W speaker for hands-free conversation.
  • Motion — two servos: 360° continuous horizontal rotation and 90° vertical tilt.
  • Lighting — 12 RGB LEDs used for eyes, moods and status.
  • Storage and power — a microSD slot for offline assets and a 550 mAh battery charged over USB-C.
StackChan ESP32-S3 hardware specifications: 2.0-inch touch screen, 0.3 MP camera, 9-axis IMU, dual microphones, two servos and a 550 mAh battery
What is inside StackChan: ESP32-S3 with 8 MB PSRAM and 16 MB flash, a 2.0-inch 320×240 touch screen, 0.3 MP camera, 9-axis IMU, dual microphones, two servos and 12 RGB LEDs. Source: M5Stack StackChan official specifications

The interface set — USB-C, I²C, UART and GPIO — plus the wider M5Stack ecosystem of expansion units is what turns this from a fixed gadget into a platform.

StackChan ESP32-S3 desktop robot three views: expression screen, servo hinge and the electronics inside
▲ Three views of the StackChan body: the expression screen, the head hinge driven by two servos, and the electronics inside. Source: M5Stack StackChan (open-source project)

Expressions, Head Movement and Touch Feedback

The expression system is the part people notice first. Touch the back of the robot or tap its head and it looks up and answers with a face — then it adds a real physical response: the head turns, follows a hand, tilts. Motion and expression together are what make it read as a small character rather than a screen with a speaker.

Expressions are not limited to the factory set. Faces are rendered from image assets that users can replace, and community members publish themed shells and costumes — from historical headdresses to sports helmets — that clip onto the same body.

StackChan ESP32-S3 robot showing animated screen expressions and RGB eye lighting
▲ Animated faces and the 12 RGB LEDs give StackChan its character. Source: M5Stack StackChan (open-source project)
StackChan ESP32-S3 robot with community-made costumes including a headdress, helmet and crown
▲ Community designs clip onto the same body — headdresses, helmets and crowns. Source: M5Stack StackChan (open-source project)

AI, Voice and Smart-Home Control

Speech is the primary interface. The robot connects to a large language model and answers natural-language questions without any programming: ask about science, chat, set a reminder, have it read text aloud, or ask it to describe what the camera sees.

The more interesting part is what happens when it is connected to a home automation system such as Home Assistant. A single sentence can start a work mode, switch off the television or dim the lights — and the same link supports a sentinel mode that watches the room while you are away.

StackChan ESP32-S3 sentinel mode streaming its camera to the phone while watching the room
▲ Connected to a home automation system, StackChan can watch the room and stream its camera to the phone. Source: M5Stack StackChan (open-source project)

The Companion App: Avatars, Motion, MCP and Nearby

The mobile app covers the settings that do not belong on a 2-inch screen: device management, device naming, the AI agent persona, MCP (Model Context Protocol) tools, chat history and unbinding. A dedicated avatar screen exposes the face parameters directly — left eye, right eye, x, y, rotation and weight — so you can dial in an expression and see it on the robot immediately.

Two features stand out. The camera can be viewed live from the phone, which turns the robot into a small remote companion. And a “nearby” screen discovers other StackChan robots in range, showing them as a mesh of named devices.

StackChan ESP32-S3 companion app avatar and motion controls: left eye, right eye, x, y, rotation and weight
▲ The companion app exposes face parameters — left eye, right eye, x, y, rotation and weight — and previews them on the robot. Source: M5Stack StackChan (open-source project)
StackChan ESP32-S3 app screens: avatar, monitoring camera, motion, MCP settings and device pairing
▲ The app manages avatars, motion, MCP tools, chat history and device binding. Source: M5Stack StackChan (open-source project)
StackChan ESP32-S3 Nearby screen listing several robots connected in a mesh network
▲ The Nearby screen discovers other StackChan robots in range and lists them by name. Source: M5Stack StackChan (open-source project)

The Open Firmware: Three Ways to Code

The firmware is deliberately layered so that you can enter at whichever level matches your skills.

1. Block coding with UiFlow 2

Drag blocks, compile online and push to the device. Face tracking, voice dialogue and expression displays can be assembled without writing a line of code — the fastest path for beginners and classrooms.

2. Arduino and C/C++

When you need deterministic behaviour, Arduino gives full control over motors, sensors and expression timing.

3. JavaScript modules

The firmware is JavaScript-driven. Drop a module into the user module directory and the robot loads it, giving your code direct access to faces, speech, servos and sensors.

Underneath, the firmware is organised in clear layers:

  • User modules (firmware/mods/) — your own behaviour files
  • Renderers and speeches — simple-face, dog-face and decorator faces that stack visual effects; local TTS, cloud TTS and custom generated voices
  • Network services — Wi-Fi, MCP tools and app connectivity
  • Servo drivers — SG90, RS30X and Dynamixel drivers, selected by configuration
  • Hardware — the ESP32-S3 CoreS3 with camera, IMU, touch panel and LEDs
StackChan ESP32-S3 open firmware architecture: JavaScript modules, UiFlow block coding and Arduino support
StackChan firmware is layered and JavaScript-driven: user modules, renderers and speeches, network services and servo drivers — coded with UiFlow blocks, Arduino or JavaScript modules. Source: StackChan open-source project documentation
StackChan ESP32-S3 UiFlow 2 block programming interface with drag-and-drop blocks
▲ UiFlow 2 lets beginners assemble face tracking, voice dialogue and expressions from blocks, then compile online and push to the robot. Source: M5Stack StackChan (open-source project)

A First JavaScript Module, Step by Step

Getting a development environment running takes four commands. Clone the project, move into the firmware directory, install dependencies, then let the setup tool detect and configure the board:

git clone <stack-chan repository>
cd stack-chan/firmware
npm install
npm run setup -- --device=esp32
npm run doctor

npm run doctor verifies that the toolchain, board and connection are healthy before you waste time debugging code that never reached the robot.

A module is a JavaScript class. This one shows a face, waits, changes expression and speaks:

export default class MyFirstMod {
  constructor(robot) {
    this.robot = robot;
  }
  async onStart() {
    await this.robot.showFace('happy');
    await this.robot.sleep(2000);
    await this.robot.showFace('surprised');
    await this.robot.say('Hello, I am your StackChan!');
  }
}

Save it under firmware/mods/ and the firmware picks it up on the next flash.

Servo Tuning, Custom Faces and Performance

Three details separate a working build from a good one.

  • Servo configuration. Different servos need different pulse ranges. An SG90 typically uses a 500 µs minimum pulse, a 2500 µs maximum pulse and a 0–180° range; RS30X and Dynamixel units need their own values. Get these wrong and you get jitter, buzzing or a head that cannot reach its endpoints.
  • Custom faces. Face assets are images — 320×240 PNG is the native fit for the display. Keep them at that size and the renderer stays fast.
  • Performance. In a JavaScript firmware on a microcontroller, three habits matter: release resources you no longer need, keep slow work asynchronous so the main loop is never blocked, and wrap hardware calls in error handling so one failed sensor read cannot freeze the robot.

Building and Customising Your Own

StackChan is designed to be physically modified as well as reprogrammed. The project publishes hardware drawings, firmware source and shell models, so an owner can print a new body, re-house the electronics or design a themed variant. Community builds show how far this goes: the same electronics have been wrapped into a humanoid “StackMan” character with a chest display, and into the rolling desktop form most people picture first.

A public sharing platform collects firmware, 3D-printable decoration files and GitHub projects, which means most of the work of a new build has already been done by someone else.

Community-built StackChan ESP32-S3 variant with a humanoid StackMan body and chest display
▲ Community builders re-house the same electronics in new bodies — this humanoid StackMan variant adds a chest display. Source: M5Stack StackChan (open-source project)
StackChan ESP32-S3 app live camera preview on the phone
▲ The app can preview the robot camera live. Source: M5Stack StackChan (open-source project)

AI-Assisted Development in Practice

Because the firmware is JavaScript, an AI coding assistant can do a surprising amount of the work. A realistic brief looks like this:

“I have a StackChan robot. I want it to stare at a red ball and turn its head to follow the ball as it moves. I don’t know robotics and I don’t write code — figure it out yourself. Only tell me what to do when I actually have to plug something in, power it on or press a button. Make it work.”

The assistant handles the repository, the module and the flashing instructions; the human handles the cable and the power switch. That workflow is not a gimmick — it is the practical reason a JavaScript-driven robot is a better learning platform than a closed one.

StackChan ESP32-S3 desktop robot on a desk next to a laptop running an AI coding assistant
▲ Because the firmware is JavaScript, an AI coding assistant can write most of a behaviour module — the owner only handles the cable and the power switch. Source: M5Stack StackChan (open-source project)

Where StackChan Fits

  • Desk companion. It sits on a desk, tracks movement, reacts to touch and talks. The camera view turns it into a small remote presence when you are away.
  • Programming education. Block coding gets a first result in minutes; Arduino and JavaScript give the same hardware a much longer runway.
  • Home automation front end. With Home Assistant it becomes a voice terminal with a face for scenes, lights and sentinel duties.
  • Maker platform. Open drawings, open firmware and printable shells make it a base for costume builds, art installations and interactive exhibits.

Getting Started Checklist

  1. Choose the hardware bundle that matches your goal — a ready-to-run unit, or a kit if you want to assemble and re-house it.
  2. Flash the current firmware and complete the first-run Wi-Fi setup from the app.
  3. Print or download a shell if you plan to customise the body.
  4. Start with blocks (UiFlow 2) to confirm the hardware works, then move to Arduino or a JavaScript module.
  5. Back up your module and face assets before an OTA update.

Bottom Line

StackChan is interesting less because of any single sensor and more because of how the layers fit together: a real ESP32-S3 robot with servos, camera, screen and voice, wrapped in firmware you can read and rewrite, at a price that does not require a lab budget. Whether you want a talking desk companion, a classroom tool or a base for your own build, the ceiling is set by what you are willing to write — and increasingly, by what you can get an AI assistant to write for you.

Ready to start? Take a look at the M5Stack StackChan AI Desktop Robot in the AIXTOY store, or browse our other ESP32-S3 self-balancing desktop robot build guide and the Microduck open-source robot coverage, plus our four open-source desktop robot projects comparison.

M5Stack StackChan AI desktop robot at AIXTOY

M5Stack StackChan AI Desktop Robot

From $159.71

Open-source ESP32-S3 desk companion with a 2.0″ touch screen, camera, dual microphones, two servos and 12 RGB LEDs — ready to talk, react and be reprogrammed.

Tags:

More on AI Toys

Your Shopping cart

Close

Your Cart

Your Cart

You're 100.00$ away from Free Gift
🎁
$
🚚
100.00$ Free Gift
200.00$ 10% Discount
300.00$ Free Shipping

Your Cart is Empty

Start Shopping
Payment Details
Sub Total 0.00$