This circuit is designed as part of a door lock system that utilizes face recognition technology. The system comprises an ESP32-CAM module responsible for face recognition, a 1-Channel Relay module to control a 12V Solenoid Lock, and a ProtoSnap - Pro Mini - FTDI for additional interfacing. The solenoid lock is powered by a 12V battery. When a recognized face is detected by the ESP32-CAM, it signals the relay to activate the solenoid lock, thereby unlocking the door.
-
(Ground), +
(Vcc)5V
, GND
, IO12
, IO13
, IO15
, IO14
, IO2
, IO4
, VOT
, VOR
, VCC
, IO0
, IO16
, 3V3
GND
, CTS
, VCC
, TXO
, RXI
, DTR
NC
(Normally Closed), signal
, C
(Common), power
, NO
(Normally Open), ground
-
(Ground), +
(Vcc)C
(Common) pin of the 1-Channel Relay.+
pin of the 12v Battery.VCC
pin of the ProtoSnap - Pro Mini - FTDI and power
pin of the 1-Channel Relay.ground
pin of the 1-Channel Relay.signal
pin of the 1-Channel Relay.RXI
pin of the ProtoSnap - Pro Mini - FTDI.TXO
pin of the ProtoSnap - Pro Mini - FTDI.5V
pin of the ESP32 - CAM.VOT
pin of the ESP32 - CAM.VOR
pin of the ESP32 - CAM.-
pin of the 12V Solenoid Lock.IO4
pin of the ESP32 - CAM.5V
pin of the ESP32 - CAM.-
pin of the 12v Battery.NO
(Normally Open) pin of the 1-Channel Relay.+
pin of the 12V Solenoid Lock./*
* This Arduino Sketch is part of a door lock system using face recognition.
* The ESP32-CAM module performs face recognition and controls a relay
* to operate a 12V Solenoid Lock. When a recognized face is detected, the
* relay activates the solenoid lock to unlock the door.
*/
const int relayPin = 4; // Relay signal pin connected to ESP32-CAM IO4
void setup() {
Serial.begin(115200); // Initialize Serial communication at 115200 baud rate
pinMode(relayPin, OUTPUT); // Set relay pin as output
digitalWrite(relayPin, LOW); // Ensure relay is off initially
Serial.println("ESP32-CAM initialized.");
}
void loop() {
bool faceRecognized = false; // Placeholder for face recognition result
// Add face recognition logic here
if (faceRecognized) {
digitalWrite(relayPin, HIGH); // Activate relay to unlock door
delay(5000); // Keep the door unlocked for 5 seconds
digitalWrite(relayPin, LOW); // Deactivate relay to lock door
}
delay(100); // Short delay to avoid rapid toggling
}
(Note: The code for the other microcontrollers is similar and follows the same logic as the ESP32-CAM code. The actual face recognition logic is not included in the placeholder and should be implemented accordingly.)