I need help making an esp32 door lock
Posted: Wed Sep 17, 2025 12:59 pm
I need to make a door lock that opens using RFID and QR. I've made a drawing and a list of where all the wires should go. Could someone help me figure out if this works, what could be improved, or what's missing?
The list:
Product specifications
ESP32 Dev Kit 4 (controller)
This controls everything
This runs on 5V
Programmed via Arduino IDE
Scanner
12V – Wiegand and UART
All wires to ESP32
WG-D0 to GPIO18
WG-D1 to GPIO19
TTL-TX to GPIO16
TTL-RX to GPIO17
GND to GND
All wires to battery
Red wire from 12V to +
Black wire from GND to –
Open button
Black wire from GND to – of the button
Red wire from GPIO14 to + of the button
12V to 5V USB Micro Adapter
Black wire to –
Red wire to +
USB-C to ESP32
Relay + slot
Relay 5V – slot 12V
All wires to ESP32
VCC to 5V
INL to GPIO25
GND to GND
All wires to the terminal
Red wire from COM to +
Red wire from NO to the terminal
Black wire from the terminal to –
Solar panel
*How much does it need?*
Red cable to + on the solar charge controller
Black cable to - on the solar charge controller
Solar charge controller
Red cable to + on the solar charge controller
Black cable to - on the solar charge controller
Battery 12V
QR scanner
How does UART work?
Create a QR code with text or URL
Scan the QR code with the correct text or URL and the gate will open.
You can create your own text and URLs.
How does Wiegand work?
You need a library (Wiegand).
It recognizes D0 & D1 pulses.
Data is converted into an ID, which I can use.
The list:
Product specifications
ESP32 Dev Kit 4 (controller)
This controls everything
This runs on 5V
Programmed via Arduino IDE
Scanner
12V – Wiegand and UART
All wires to ESP32
WG-D0 to GPIO18
WG-D1 to GPIO19
TTL-TX to GPIO16
TTL-RX to GPIO17
GND to GND
All wires to battery
Red wire from 12V to +
Black wire from GND to –
Open button
Black wire from GND to – of the button
Red wire from GPIO14 to + of the button
12V to 5V USB Micro Adapter
Black wire to –
Red wire to +
USB-C to ESP32
Relay + slot
Relay 5V – slot 12V
All wires to ESP32
VCC to 5V
INL to GPIO25
GND to GND
All wires to the terminal
Red wire from COM to +
Red wire from NO to the terminal
Black wire from the terminal to –
Solar panel
*How much does it need?*
Red cable to + on the solar charge controller
Black cable to - on the solar charge controller
Solar charge controller
Red cable to + on the solar charge controller
Black cable to - on the solar charge controller
Battery 12V
QR scanner
How does UART work?
Create a QR code with text or URL
Scan the QR code with the correct text or URL and the gate will open.
You can create your own text and URLs.
How does Wiegand work?
You need a library (Wiegand).
It recognizes D0 & D1 pulses.
Data is converted into an ID, which I can use.