Case Study
Modular Smart Switch System
Engineered a scalable, Wi-Fi-enabled smart relay module featuring custom opto-isolated PCBs, Over-The-Air (OTA) updates, and a modular master/slave architecture designed to safely retrofit behind existing home wall switches.
The Challenge
Developing consumer-facing IoT hardware requires bridging the gap between low-voltage digital logic and high-voltage AC mains safely. The challenge was to design an invisible retrofit switch that did not just rely on the cloud, but also offered zero-latency local manual control. It required engineering a scalable hardware architecture that could expand from a single 5A switch to a multi-gang 10Aโ20A system while fitting inside a standard, space-constrained electrical wall box.
Technical Deep Dive
Hardware Architecture
- Custom PCB Design: Migrated from a DevKit V1 proof of concept to a custom surface-mount board using the ESP32-WROOM-32D with an integrated CP2102 UART.
- Electrical Isolation: Integrated optocoupler-based relay drivers to provide strict galvanic isolation and safety between the ESP32 and mains voltage.
- Modular Expansion: Designed a stackable master/slave topology allowing the main ESP32 controller to interface with multiple standalone relay slave modules.
Firmware & Control
- Local Fallback Logic: Engineered hardware/software debounce mechanisms using 0.1 ยตF capacitors for physical button inputs, ensuring lights function instantly even during Wi-Fi outages.
- Cloud & IoT Stack: Developed a flexible communication stack supporting MQTT, ESP Rainmaker, and custom web dashboards for remote smartphone control.
- UX & Deployment: Integrated captive-portal auto-discovery for easy Wi-Fi onboarding and Over-The-Air (OTA) capabilities for seamless firmware updates.
Results
- Pre-Production MVP: Successfully progressed from a breadboard prototype to a reliable, custom-PCB minimum viable product.
- High-Voltage Safety: Passed high-voltage isolation and durability testing, ensuring the module is safe for residential electrical box installation.
- Modular Flexibility: Proved the scalability of the master/slave architecture, allowing the system to easily adapt to different load requirements from 5A to 10A and 20A.