The Second IoT Adventure — Lessons from a Fried ESP32
This is the second IoT project, once again heavily assisted by AI. The first project provided a wealth of inexpensive learning opportunities — understanding the core concepts, figuring out how many different modules are required, and grasping the fundamental principles of embedded hardware. However, that initial project also ended with a fried ESP32 module. So this time around, extra caution was exercised, especially when connecting the control unit to the gate control board.
Three Modules, One Mission
The project involves three key components: a step-down converter, an ESP32 microcontroller, and a relay module. The step-down converter takes the external 12V power source and reduces it to 5V to safely power the ESP32 control unit. The ESP32 then processes the authentication logic and passes the control signal to the relay, which in turn delivers the trigger command to the gate control board.
Design Phase — Understanding the Relay
During the design phase, a significant amount of effort went into understanding how relays actually work — specifically whether the relay is a high-voltage or low-voltage trigger type, and the distinction between dry contacts and wet contacts when interfacing the ESP32 with the gate control board. Another critical consideration was whether a parallel connection to the control board would cause any issues, and whether any preventive measures were required to avoid current flowing back into either of the parallel-connected control units.
Software — AI-Powered and Configurable
The solution uses the step-down converter to obtain power, which feeds the ESP32. The ESP32 then processes authentication logic via a web interface, comparing either a stored text key or a voice sample against submitted credentials. If the match exceeds a defined threshold, the system releases the trigger signal to open the gate.
The software implementation was once again done with AI assistance — simply by describing the idea and specifying that it should be fully configurable: supporting key updates, different key types (text or voice), and ensuring that the text-based approach uses a GET method with query parameters for easy future integration. The software portion came together quickly and cleanly. There is one planned enhancement remaining: migrating the web communication from HTTP to HTTPS and updating the code accordingly so that voice can be recorded and compared directly via a mobile browser.
Hardware Integration — Wiring the Relay to the Gate
For the hardware portion, the final step was to connect the NO (Normally Open) and COM (Common) terminals from the relay to the gate control board's TRIGGER and GND pins. After verifying that it is indeed a dry contact configuration, it was confirmed that a parallel connection is entirely feasible without risk of interference.
It Works — What's Next?
It is genuinely exciting to see everything working as expected. The next step is to integrate these control appliances into the Home app for seamless smart-home control.
Demo Videos
Below are two short demonstration videos showing the system in action: