Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

ESP32-Based Security System with RFID, PIR Sensor, and Laser Modules

Image of ESP32-Based Security System with RFID, PIR Sensor, and Laser Modules

Circuit Documentation

Summary

This circuit integrates various components to perform a set of functions that likely involve sensing, actuation, user input, and display capabilities. The circuit includes sensors like a PIR sensor for motion detection and a laser emitter-receiver pair for beam-break detection. An ESP32 microcontroller serves as the central processing unit, interfacing with a keypad, an OLED display, an RFID reader, and an I/O expander. Actuation is handled by a relay module and an electric lock, while a buzzer and LEDs provide user feedback. Power management is achieved through solar panels, a charge controller, UPS battery, and buck converters. The circuit is designed to be powered by a centralized power supply.

Component List

Sensors

  • KY-008 Laser Emitter: A module that emits a laser beam.
  • PIR Sensor: A motion sensor that detects changes in infrared levels caused by movement.
  • Laser Receiver Module: A module that detects the presence of the laser beam from the KY-008 emitter.

Microcontroller

  • ESP32 (30 pin): A powerful microcontroller with Wi-Fi and Bluetooth capabilities.

User Input

  • 4X4 Membrane Matrix Keypad: A 16-button keypad for user input.

Expansion Module

  • PCF8575 IO Expander: An I2C I/O expander that provides additional digital inputs/outputs.

Communication Module

  • RFID-RC522: An RFID reader/writer module for contactless communication.

Output Devices

  • Buzzer: An audible signaling device.
  • LED: Two Pin (green): A green light-emitting diode.
  • LED: Two Pin (red): A red light-emitting diode.

Passive Components

  • Resistor: Two resistors with a resistance of 220 Ohms, likely used for LED current limiting.

Actuators

  • KY-019 Relay Module 1 Channel: A module that controls high power devices with a low power signal.
  • Electric Lock: An electromechanical lock.

Power Management

  • Solar Panel: A photovoltaic panel that converts sunlight into electrical energy.
  • AC Source: An alternating current power source.
  • Solar Charge Controller: A device that manages the power going into the battery bank from the solar array.
  • UPS BATTERY: An uninterruptible power supply battery.
  • Buck Converter: Two modules that step down voltage from a higher level to a lower level.
  • Centralized Power Supply: A power supply unit that provides DC power.

Display

  • OLED Display 2.42": A small display for visual output.

Miscellaneous

  • Custom 1: A custom component with VCC and GND connections.
  • Electric Lock: A lock that can be controlled electrically.

Wiring Details

KY-008 Laser Emitter

  • SIG connected to PCF8575 IO Expander P03
  • 5V connected to Buck Converter OUT+
  • GND connected to Buck Converter OUT-

PIR Sensor

  • VDD connected to Buck Converter OUT+
  • SIG connected to ESP32 D35
  • GND connected to Buck Converter OUT-

Laser Receiver Module

  • VCC connected to Buck Converter OUT+
  • OUTPUT connected to PCF8575 IO Expander P01
  • GROUND connected to Buck Converter OUT-

ESP32 (30 pin)

  • D34 connected to OLED Display SDA
  • D35 connected to PIR Sensor SIG
  • D32 connected to 4X4 Membrane Matrix Keypad C3
  • D33 connected to 4X4 Membrane Matrix Keypad C2
  • D25 connected to 4X4 Membrane Matrix Keypad C1
  • D26 connected to 4X4 Membrane Matrix Keypad R4
  • D27 connected to 4X4 Membrane Matrix Keypad R3
  • D14 connected to 4X4 Membrane Matrix Keypad R2
  • D12 connected to 4X4 Membrane Matrix Keypad R1
  • D13 connected to 4X4 Membrane Matrix Keypad C4
  • GND connected to multiple components (common ground)
  • Vin connected to OLED Display VCC and KY-019 Relay Module 5V
  • D23 connected to OLED Display SCK
  • D22 connected to PCF8575 IO Expander SCL
  • D21 connected to PCF8575 IO Expander SDA
  • D19 connected to KY-019 Relay Module S
  • D18 connected to RFID-RC522 SCK
  • D5 connected to RFID-RC522 SDA
  • D4 connected to RFID-RC522 RST
  • D2 connected to RFID-RC522 MISO
  • D15 connected to RFID-RC522 MOSI
  • 3V3 connected to PCF8575 IO Expander VCC and RFID-RC522 VCC (3.3V)

4X4 Membrane Matrix Keypad

  • C3 connected to ESP32 D32
  • C2 connected to ESP32 D33
  • C1 connected to ESP32 D25
  • R4 connected to ESP32 D26
  • R3 connected to ESP32 D27
  • R2 connected to ESP32 D14
  • R1 connected to ESP32 D12
  • C4 connected to ESP32 D13

PCF8575 IO Expander

  • P03 connected to KY-008 Laser Emitter SIG
  • P01 connected to Laser Receiver Module OUTPUT
  • SCL connected to ESP32 D22
  • SDA connected to ESP32 D21
  • GND connected to common ground
  • VCC connected to ESP32 3V3
  • P16 connected to buzzer PIN
  • P15 connected to Resistor pin1 (bef891b4)
  • P14 connected to Resistor pin1 (b6e7e599)

RFID-RC522

  • SCK connected to ESP32 D18
  • SDA connected to ESP32 D5
  • RST connected to ESP32 D4
  • MISO connected to ESP32 D2
  • MOSI connected to ESP32 D15
  • GND connected to common ground
  • VCC (3.3V) connected to ESP32 3V3

Buzzer

  • PIN connected to PCF8575 IO Expander P16
  • GND connected to common ground

LED: Two Pin (green)

  • Cathode connected to common ground
  • Anode connected to Resistor pin2 (bef891b4)

LED: Two Pin (red)

  • Cathode connected to common ground
  • Anode connected to Resistor pin2 (b6e7e599)

Resistor

  • Pin1 connected to PCF8575 IO Expander P15 (bef891b4) and P14 (b6e7e599)
  • Pin2 connected to LED anodes (green and red)

KY-019 Relay Module 1 Channel

  • S connected to ESP32 D19
  • 5V connected to ESP32 Vin
  • GND connected to common ground
  • NC not connected in this documentation
  • COM connected to Buck Converter IN+ (080418f8)
  • NO connected to Electric Lock VCC

Solar Panel

  • + connected to Solar Charge Controller Solar Cell +
  • - connected to Solar Charge Controller Solar Cell -

AC Source

  • - connected to Centralized Power Supply N
  • + connected to Centralized Power Supply L

Solar Charge Controller

  • Solar Cell + connected to Solar Panel +
  • Solar Cell - connected to Solar Panel -
  • Battery + connected to UPS BATTERY VCC
  • Battery - connected to UPS BATTERY GND
  • Load + connected to Custom 1 vcc
  • Load - connected to Custom 1 gnd

UPS BATTERY

  • GND connected to Solar Charge Controller Battery -
  • VCC connected to Solar Charge Controller Battery +

Buck Converter

  • IN+ connected to Custom 1 vcc and KY-019 Relay Module COM
  • IN- connected to Custom 1 gnd and Electric Lock GND
  • OUT+ connected to various components for power supply
  • OUT- connected to common ground

Centralized Power Supply

  • L connected to AC Source +
  • N connected to AC Source -
  • Com not connected in this documentation
  • DC - connected to Custom 1 gnd
  • dc - connected to Custom 1 gnd
  • dc + connected to Custom 1 vcc

Electric Lock

  • GND connected to Buck Converter IN- (080418f8)
  • VCC connected to KY-019 Relay