A tiny ESP32-C3 AI companion. It listens, thinks, and chats using your AI key β
then pulls goofy faces when you leave it alone. Flash it from your browser. No IDE. No drivers.
β‘Β Β Flash your Mochi Β Β·Β πΒ Wiring Β Β·Β π§ Β How it works Β Β·Β πΒ Start
Mochi is a palm-sized robot built around a Waveshare ESP32-C3-Zero. Hold the touch button, ask it anything β the time, the weather, the news, a random question β and it answers out loud through a little speaker. The OLED is its face: it watches you while listening, gets a thoughtful look while it thinks, and its mouth moves while it talks.
Leave it alone and it just... blinks, glances around, and cycles through silly expressions to keep you company. There's even a pure face-toy mode if you just want the cuteness without the chatter.
The face above is the real animation logic from the firmware β idle β listening β thinking β talking.
| π idle | π listening | π thinking | π£οΈ talking |
|---|---|---|---|
| blinks & looks around | wide eyes, alert | eyes up, dots | mouth lip-syncs audio |
|
Push-to-talk to ask anything. Speech in, speech out β a real little voice assistant. |
Bring OpenAI, Groq, OpenRouter, Together, or Gemini. Paste your key, switch any time. |
Blinks, gazes, and goofy moods when idle. Toggle a pure face-toy mode. |
|
The bot hosts its own WiFi page to enter credentials β like setting up a smart bulb. |
LiPo + TP4056 charger + slide switch. A pocket companion that runs off a battery. |
One clean Arduino sketch, parameterised faces, swappable pins. Fork it, make it yours. |
flowchart LR
A([ποΈ You speak]) --> B[INMP441 mic<br/>I2S]
B --> C{{ESP32-C3}}
C -->|stream audio| D[Speech-to-Text]
D --> E[Your AI provider<br/>LLM reply]
E --> F[Text-to-Speech]
F -->|stream audio| C
C --> G[MAX98357A amp<br/>I2S]
G --> H([π Mochi talks])
C -.drives.-> I[(π OLED face<br/>listen-think-talk)]
style C fill:#3a3f4b,color:#fff
style E fill:#e89a8b,color:#fff
style I fill:#f3c9a8,color:#2b2622
Because the ESP32-C3 is a small single-core chip, the heavy lifting β speech-to-text, the language model, and text-to-speech β runs on your chosen provider's servers. The C3 captures your voice, streams it up, plays the reply back, and animates the face locally. Setup happens over a captive-portal WiFi page the bot serves itself, so there's no app to install.
| Part | Role | Interface |
|---|---|---|
| Waveshare ESP32-C3-Zero | brain + WiFi | β |
| SSD1306 0.96" OLED | the face & status | I2C |
| INMP441 mic | hears you | I2S in |
| MAX98357A + 2W speaker | talks back | I2S out |
| 3Γ TTP223 touch buttons | talk / next-face / mode | digital |
| LiPo + TP4056 | portable power | 3.7V |
| slide switch | on / off | β |
Everything runs at 3.3V. Default pins live in config.h β easy to change.
|
OLED (I2C)
Mic β INMP441 (I2S)
|
Speaker β MAX98357A (I2S)
Touch buttons (TTP223)
|
β οΈ Reserved on the C3-Zero β don't use:GPIO9(BOOT),GPIO10(onboard RGB LED),GPIO12β17(onboard flash). The pins above already avoid all of them. π Interactive pin diagram on the project site β
Full step-by-step: hardware/WIRING.md
|
git clone https://github.com/YOUR-USERNAME/dasai-mochi-bot
cd dasai-mochi-bot
# PlatformIO
pio run # compile
pio run -t upload # flash over USBβ¦or open the sketch in Arduino IDE (board: ESP32C3 Dev Module). |
| Provider | Get a key | Notes |
|---|---|---|
| Groq β | console.groq.com/keys | fast, generous free tier, Llama 3.x β best default |
| OpenAI | platform.openai.com/api-keys | GPT models, paid |
| OpenRouter | openrouter.ai/keys | one key, many models |
| Together | api.together.xyz | open models, free tier |
| Gemini | aistudio.google.com/apikey | Google, free tier |
π Your key is entered on the device's own setup page and stored only in the ESP32's flash. It's sent only to the provider you chose, over HTTPS. It never touches this repo.
dasai-mochi-bot/
ββ firmware/dasai_mochi_bot/ π§ the Arduino sketch
β ββ dasai_mochi_bot.ino main loop Β· provisioning Β· conversation
β ββ config.h pins & tunables (edit to rewire)
β ββ providers.h multi-provider LLM table
β ββ faces.{h,cpp} π the silly-face engine
β ββ llm_client.{h,cpp} chat + speech-to-text over HTTPS
β ββ audio_io.{h,cpp} I2S mic capture + speaker playback
β ββ portal_page.h on-device WiFi/key setup page
ββ docs/ π GitHub Pages site (flasher + diagram)
β ββ index.html landing Β· browser flasher Β· pin diagram
β ββ assets/mochi-face.svg the animated face (also used above)
β ββ firmware/manifest.json ESP Web Tools manifest
ββ hardware/WIRING.md π full wiring guide
ββ platformio.ini
ββ README.md
- Commit the prebuilt
merged.binso the web flasher goes live - Wake-word ("Hey Mochi") instead of push-to-talk
- More face moods + per-mood sound effects
- Battery level shown on the RGB LED
- 3D-printable shell in
/hardware
Browser flashing by ESP Web Tools (ESPHome / Nabu Casa) Β· animated banner by readme-typing-svg Β· inspired by the open-source XiaoZhi AI ESP32 chatbot community.
MIT β see LICENSE. Build one, fork it, make it weirder.