

The circuit in question appears to be a smart lock system that can be controlled via Wi-Fi. It uses an ESP32 Devkit V1 microcontroller to manage the communication and control logic. The system includes an OLED display for user interface, an RFID-RC522 module for access control, and a r307 fingerprint sensor for biometric verification. A TIP120 Darlington Transistor is used to drive a 12V Solenoid Lock, which acts as the physical locking mechanism. The circuit is powered by a 12V power supply, and a diode is used to protect against reverse polarity. A pushbutton is also included, possibly for manual control.
A power source for the circuit.
A small display for outputting information to the user.
Used to switch high current loads with a low current control signal from the ESP32.
A passive two-terminal electrical component that implements electrical resistance as a circuit element.
A microcontroller with Wi-Fi capabilities for controlling the circuit and communicating with external devices.
A fingerprint sensor module for biometric input.
Provides a stable 12V power source for the circuit.
An electromechanical lock controlled by the circuit.
An RFID reader/writer module for contactless communication using radio frequency.
A component that allows current to flow in one direction, used for reverse polarity protection.
A simple switch mechanism for control of a circuit.
+ to 12V power supply +- to 12V power supply -GND to ESP32 GNDVCC to ESP32 3V3SCL to ESP32 D22SDA to ESP32 D21BASE to Resistor pin1COLLECTOR to Diode anode and 12V Solenoid Lock -EMITTER to 12V power supply -pin1 to TIP120 BASEpin2 to ESP32 D153V3 to OLED VCC, r307 VCC, and RFID-RC522 VCC (3.3V)GND to 12V power supply -, TIP120 EMITTER, r307 GND, RFID-RC522 GND, and OLED GNDD15 to Resistor pin2D4 to RFID-RC522 RSTRX2 to r307 RXTX2 to r307 TXD5 to RFID-RC522 SDAD18 to RFID-RC522 SCKD19 to RFID-RC522 MISOD21 to OLED SDAD22 to OLED SCLD23 to RFID-RC522 MOSIVCC to ESP32 3V3RX to ESP32 RX2TX to ESP32 TX2GND to ESP32 GND+ to Diode cathode and 12V Solenoid Lock +- to ESP32 GND and TIP120 EMITTER+ to Diode cathode and 12V power supply +- to TIP120 COLLECTORVCC (3.3V) to ESP32 3V3RST to ESP32 D4GND to ESP32 GNDIRQ (Not connected)MISO to ESP32 D19MOSI to ESP32 D23SCK to ESP32 D18SDA to ESP32 D5anode to TIP120 COLLECTOR and 12V Solenoid Lock -cathode to 12V power supply + and 12V Solenoid Lock +Pin 3 (out) (Not connected)Pin 4 (out) (Not connected)Pin 1 (in) (Not connected)Pin 2 (in) (Not connected)#include <WiFi.h>
#include <WebServer.h>
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";
WebServer server(80);
// Define GPIO pin for the relay
const int relayPin = 15;
void setup() {
Serial.begin(115200);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH); // Lock is initially locked
// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
// Setup server routes
server.on("/unlock", handleUnlock);
server.begin();
Serial.println("HTTP server started");
}
void handleUnlock() {
digitalWrite(relayPin, LOW); // Unlock the door
delay(5000); // Keep it unlocked for 5 seconds
digitalWrite(relayPin, HIGH); // Lock again
server.send(200, "text/plain", "Door unlocked");
}
void loop() {
server.handleClient();
}
This code is designed to run on the ESP32 Devkit V1 microcontroller. It sets up a Wi-Fi connection and a web server that listens for an /unlock route. When this route is accessed, the ESP32 activates the relay connected to relayPin (GPIO 15), unlocking the door for 5 seconds before locking it again.