ESP32 IoT - Text/Voice Access Control App via WIFI

Agentic Coding / 2026-10-18

← Back to Hub

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.

ESP32 Web Gate Key application architecture diagram
The ESP32 Web Gate Key application architecture diagram.

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.

1 step-down converter, 1 ESP32, and 1 relay module
One step-down converter, one ESP32, and one relay — the three components that make up the entire application.

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.

The web interface of the ESP32 Web Gate Key application
The web interface once the application is up and running.

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.

ESP32 Web Control App integrated into the swing gate control board
The ESP32 Web Control App integrated into the swing gate control board.
Gate opened after correct text key was submitted
After setup and when the correct "Text Key" is passed to the ESP32 Web Control App — gate opened successfully.

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:

WebGateKey Open via text key.
WebGateKey Open via text key shortcut trigger via Siri.