This is an old revision of the document!
A TinyML-powered toy bird that listens for its name, looks at you, and reacts to your presence.
Miguel is an interactive smart toy bird built around an Arduino Nano ESP32. He uses two INMP441 MEMS microphones for directional sound detection, a TinyML model trained to recognize his name, and a servo motor to turn his head toward you when called. When he hears “Miguel”, he looks your way and croaks back using a DY-SV17F audio module and a small speaker. Two GY-530 VL53L0X laser rangefinder sensors arranged in a V shape monitor his line of sight, allowing him to reorient his head if you move out of view.
The entire system runs off a portable 5V USB power bank, making Miguel fully self-contained and wireless.
The project is structured around three main behaviours:
When triggered, Miguel also plays a pre-recorded croak sound through the DY-SV17F audio module connected to a small speaker, giving him a lively, reactive personality.
+-----------------------------+
| Arduino Nano ESP32 |
| |
[INMP441 MIC Left] --+-->| I2S SD (GPIO 8) |
[INMP441 MIC Right] --+ | I2S SCK (GPIO 6) (shared) |
(L/R: GND / 3V3) | I2S WS (GPIO 7) |
| |
| PWM (GPIO 9) --+--> [SG92R Servo] <--+
| | (signal only) | 5V direct
[GY-530 VL53L0X Left] --->| I2C SDA (GPIO 11) | |
[GY-530 VL53L0X Right]--->| I2C SCL (GPIO 12) | [USB Splitter]
(XSHUT: GPIO 2/3) | | |
| UART TX (GPIO 5) -->| [DY-SV17F] --> [Speaker]
+-----------------------------+
| 5V (USB)
[USB Splitter]
|
[5V USB Power Bank]
(8x 18650 Li-ion, dual USB out)
| Component | Model | Role |
|---|---|---|
| Microcontroller | Arduino Nano ESP32 | Main brain — runs TinyML model and all control logic |
| Microphone (x2) | INMP441 | Stereo I2S MEMS microphones for directional audio capture |
| Servo Motor | SG92R | Rotates Miguel's head toward detected sound/presence |
| Audio Module | DY-SV17F | Standalone audio playback triggered via UART |
| Laser Sensors (x2) | GY-530 VL53L0X | ToF rangefinders in V-shape for presence detection |
| Power Supply | 5V 1A/2A Dual USB Power Bank (8x 18650) | Portable, rechargeable power for all components |
INMP441 Microphones (I2S)
Both microphones share the same three signal lines (SD, SCK, WS). They alternate on the data line based on the WS clock — one drives data when WS is low, the other when WS is high. The L/R pin on each mic selects which slot it uses.
| INMP441 Pin | ESP32 Pin | Both mics |
|---|---|---|
| VDD | 3.3V | both |
| GND | GND | both |
| SD | GPIO 8 | both wired to same pin — they time-multiplex |
| SCK | GPIO 6 | both |
| WS | GPIO 7 | both |
| L/R (Left mic) | GND | drives data when WS = 0 (left channel) |
| L/R (Right mic) | 3.3V | drives data when WS = 1 (right channel) |
GY-530 VL53L0X Sensors (I2C)
| VL53L0X Pin | ESP32 Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | GPIO 11 |
| SCL | GPIO 12 |
| XSHUT (Left) | GPIO 2 |
| XSHUT (Right) | GPIO 3 |
SG92R Servo
The servo is powered directly from the USB splitter because the board cannot supply enough current for it to operate (3.3v vs 5V). Only the PWM signal wire connects to the board.
| Servo Wire | Connected To |
|---|---|
| Signal (orange) | GPIO 9 (PWM) on ESP32 |
| Power (red) | 5V directly from USB splitter |
| GND (brown) | Common GND |
DY-SV17F Audio Module
| DY-SV17F Pin | ESP32 Pin |
|---|---|
| TX | GPIO 4 (RX) |
| RX | GPIO 5 (TX) |
| VCC | 5V |
| GND | GND |
| SPK+ / SPK- | Speaker terminals |
The keyword spotting model was trained using Edge Impulse on recordings of the word “Miguel” in various conditions (distances, accents, background noise levels).
Direction of the incoming voice is estimated by comparing the amplitude (RMS) of the signal captured by each microphone in the same time window. If the left mic has a higher RMS, Miguel turns left; if the right mic dominates, he turns right.
The two laser sensors are mounted at the front of Miguel in a V shape (angled ~30° outward from center). They continuously measure distance. If one of the sensors suddenly read beyond a threshold (meaning the person stepped away), Miguel pans his head slowly to the left or right to find you.
The DY-SV17F module stores WAV files on a micro SD card and is controlled via serial UART commands. When Miguel hears his name, the ESP32 sends a play command: