Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-CAM Face Recognition Door Lock System

View and Edit Project In Cirkit DesignerImage of ESP32-CAM Face Recognition Door Lock System

Circuit Documentation

Summary

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.

Component List

12V Solenoid Lock

ESP32 - CAM

ProtoSnap - Pro Mini - FTDI

1-Channel Relay (5V 10A)

12v Battery

Wiring Details

12V Solenoid Lock

ESP32 - CAM

ProtoSnap - Pro Mini - FTDI

1-Channel Relay (5V 10A)

12v Battery

Documented Code

ESP32 - CAM Code

/*
 * 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.)