I need help making an esp32 door lock

ChosselLuc
Posts: 3
Joined: Wed Sep 17, 2025 12:53 pm

I need help making an esp32 door lock

Postby ChosselLuc » 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.
Attachments
Schermafbeelding 2025-09-17 144634.png
Schermafbeelding 2025-09-17 144634.png (655.27 KiB) Viewed 1221 times

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: I need help making an esp32 door lock

Postby ahsrabrifat » Wed Sep 17, 2025 5:37 pm

Your scanner requires 12V, but the ESP32 only accepts 5V. You’ll need a buck converter (12V → 5V) to feed the ESP32 (not a USB micro adapter unless it’s rated properly). The relay must also match your logic: If it’s a 5V relay module, then power it from the buck’s 5V output.

ChosselLuc
Posts: 3
Joined: Wed Sep 17, 2025 12:53 pm

Re: I need help making an esp32 door lock

Postby ChosselLuc » Thu Sep 18, 2025 10:44 am

Your scanner requires 12V, but the ESP32 only accepts 5V. You’ll need a buck converter (12V → 5V) to feed the ESP32 (not a USB micro adapter unless it’s rated properly). The relay must also match your logic: If it’s a 5V relay module, then power it from the buck’s 5V output.
Okay, thanks for the explanation. I'll use a 12V to 5V buck converter and connect it to the 5V supply. However, the relay is already connected to the 5V supply. Is that possible, or not a good idea? Would I be better off using a 3V relay?

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: I need help making an esp32 door lock

Postby ahsrabrifat » Fri Sep 19, 2025 5:57 pm

Powering the 5V relay from the same 5V buck that feeds the ESP32 is fine. The buck converter simply produces a 5V rail. Any number of 5V devices (ESP32 via USB, a 5V relay module, QR module if 5V TTL, etc.) can share that rail if the buck can supply the total current simultaneously. All devices must share a common ground with the ESP32 and the buck.

microfoundry
Posts: 4
Joined: Tue Dec 19, 2023 3:06 pm

Re: I need help making an esp32 door lock

Postby microfoundry » Sun Sep 21, 2025 3:15 am

If you haven't seen this project, please take a look at ESP32 RFID. It seems to be a very complete project with a nice interface.

-Terry

ChosselLuc
Posts: 3
Joined: Wed Sep 17, 2025 12:53 pm

Re: I need help making an esp32 door lock

Postby ChosselLuc » Tue Sep 23, 2025 12:09 pm

Powering the 5V relay from the same 5V buck that feeds the ESP32 is fine. The buck converter simply produces a 5V rail. Any number of 5V devices (ESP32 via USB, a 5V relay module, QR module if 5V TTL, etc.) can share that rail if the buck can supply the total current simultaneously. All devices must share a common ground with the ESP32 and the buck.
i have this now.
Attachments
TEKENING DEURSLOT - ACCU V3.png
TEKENING DEURSLOT - ACCU V3.png (1.3 MiB) Viewed 1140 times

Who is online

Users browsing this forum: PerplexityBot, PetalBot and 2 guests