ESP32 Voice-Activated Smart Relay Node
Friday, August 28, 2026
A standalone, voice-responsive smart relay unit engineered around the ESP32 microcontroller and the INMP441 omnidirectional I2S digital microphone. The device provides edge-level acoustic sensing, converting voice commands and acoustic triggers into isolated relay switching actions for home appliances and industrial loads. Designed as a self-contained IoT node, it integrates an onboard 18650 lithium power management system, DC-DC boost regulation, and a custom 3D-printed acoustic enclosure.
Key Technical Features
- High-Fidelity I2S Digital Audio: Employs the INMP441 MEMS microphone over an I2S digital bus, eliminating analog signal degradation, electromagnetic interference, and pre-amp noise.
- Real-Time Edge Signal Processing: The ESP32 continuously samples audio buffers, executing digital filtering and Root Mean Square (RMS) energy threshold analysis for instant switching.
- Galvanically Isolated Switching: Driven by a single-channel 5V electromechanical relay capable of switching both AC mains (up to 250V AC / 10A) and high-current DC loads safely.
- Autonomous Power Architecture: Powered by an onboard 18650 Li-ion cell paired with a TP4056 USB-C charging/protection circuit and an XL6009 DC-DC boost converter delivering stable 5V rail voltage.
- Custom Acoustic Enclosure: Dual-section 3D-printed chassis featuring an isolated upper acoustic resonance chamber with protective sound baffles and lower power-stage isolation.
Hardware Architecture
Core Processing & Audio Input
- ESP32 Dev Module: 240 MHz dual-core Xtensa LX6 processor handling digital I2S sampling, pattern recognition, and GPIO actuation.
- INMP441 MEMS Microphone: Low-noise, bottom-ported omnidirectional microphone outputting 24-bit digital audio over standard I2S protocol.
Switching & Power Management
- 5V Relay Module (Tongling JQC-3FF-S-Z): Opto-isolated relay interface handling load switching with onboard status LEDs.
- 18650 Li-Ion Cell (3.7V / 3300mAh): High-capacity rechargeable power source for untethered wireless deployment.
- TP4056 Charge & Protection Board: Type-C charging port with over-charge, over-discharge, and short-circuit cutoff.
- XL6009 Boost Converter: Stepped-up regulated 5V DC output supplying the relay coil and logic circuits.
GPIO Pin Allocation
GPIO 25: INMP441WS(Word Select / Left-Right Clock)GPIO 32: INMP441SCK(Serial Clock)GPIO 33: INMP441SD(Serial Data In)GPIO 26: Relay Control Signal (IN)GPIO 2: Red Acoustic Detection / Trigger LEDGPIO 4: Green Relay State Indicator LED

Firmware Implementation
The firmware utilizes the native ESP32 I2S driver to sample mono 32-bit audio buffers. It processes raw PCM samples through an RMS calculation engine, comparing amplitude against dynamic thresholds to trigger the relay while enforcing a lockout window to prevent false double-triggers.
