Circuit Documentation
Summary
This circuit integrates various components including sensors, a microcontroller, a display, a relay module, and power management modules to create a complex system. The primary controller is an ESP32 microcontroller, which interfaces with a PIR sensor, a laser emitter and receiver, an RFID module, a keypad, a buzzer, LEDs, and an IO expander. Power management is handled by buck converters, a solar panel with a charge controller, and a centralized power supply. The circuit likely serves a security or access control function, given the presence of the PIR sensor for motion detection, the RFID module for access control, and the solenoid lock for physical barrier control.
Component List
Sensors
- KY-008 Laser Emitter: Emits a laser beam for detection purposes.
- PIR Sensor: Detects motion through changes in infrared levels.
- Laser Receiver Module: Receives the laser signal emitted by the KY-008.
Microcontroller
- ESP32 (30 pin): A powerful microcontroller with Wi-Fi and Bluetooth capabilities.
Input Devices
- 4X4 Membrane Matrix Keypad: Allows user input through a 16-button interface.
Expansion Module
- PCF8575 IO Expander: Expands the number of IO pins available to the microcontroller.
Communication Module
- RFID-RC522: Reads RFID tags for identification and access control.
Output Devices
- Buzzer: Emits an audible alert.
- LEDs (Green and Red): Visual indicators for status or alerts.
- KY-019 Relay Module 1 Channel: Controls power to the solenoid lock.
- OLED Display 2.42": Displays information to the user.
Power Management
- Buck Converters: Step down voltage to required levels.
- Solar Panel: Provides renewable energy.
- Solar Charge Controller: Manages the charging of batteries from the solar panel.
- UPS Battery: Provides uninterrupted power supply.
- Centralized Power Supply: Distributes power to various components.
- AC Source: Supplies alternating current power.
Actuator
- 12V Solenoid Lock: Acts as a locking mechanism controlled by the relay.
Passive Components
- Resistors: Limits current to LEDs.
- Diodes: Prevents reverse current flow.
Wiring Details
KY-008 Laser Emitter
- SIG to IO Expander P03
- 5V to Buck Converter OUT+
- GND to Buck Converter OUT-
PIR Sensor
- VDD to Buck Converter OUT+
- SIG to ESP32 D13
- GND to Buck Converter OUT-
Laser Receiver Module
- VCC to Buck Converter OUT+
- OUTPUT to IO Expander P01
- GROUND to Buck Converter OUT-
ESP32 (30 pin)
- D34 to RFID-RC522 SCK
- D35 to Keypad C4
- D32 to Keypad C3
- D33 to Keypad C2
- D25 to Keypad C1
- D26 to Keypad R4
- D27 to Keypad R3
- D14 to Keypad R2
- D12 to Keypad R1
- D13 to PIR Sensor SIG
- GND to various GND connections
- Vin to Relay Module 5V
- D23 to OLED Display SCK
- D22 to IO Expander SCL
- D21 to IO Expander SDA
- D19 to Relay Module S
- D18 to OLED Display SDA
- D5 to RFID-RC522 SDA
- D4 to RFID-RC522 RST
- D2 to RFID-RC522 MISO
- D15 to RFID-RC522 MOSI
- 3V3 to RFID-RC522 VCC (3.3V) and IO Expander VCC
4X4 Membrane Matrix Keypad
- R1 to ESP32 D12
- R2 to ESP32 D14
- R3 to ESP32 D27
- R4 to ESP32 D26
- C1 to ESP32 D25
- C2 to ESP32 D33
- C3 to ESP32 D32
- C4 to ESP32 D35
PCF8575 IO Expander
- GND to various GND connections
- VDD to Buck Converter OUT+
- P00-P07, P10-P17 to various connections as per the circuit design
- INT not connected
- SCL to ESP32 D22
- SDA to ESP32 D21
- VCC to ESP32 3V3
RFID-RC522
- VCC (3.3V) to ESP32 3V3
- RST to ESP32 D4
- GND to various GND connections
- IRQ not connected
- MISO to ESP32 D2
- MOSI to ESP32 D15
- SCK to ESP32 D34
- SDA to ESP32 D5
Buzzer
- PIN to IO Expander P16
- GND to various GND connections
LEDs (Green and Red)
- Green LED cathode to various GND connections
- Green LED anode to Resistor (connected to IO Expander P15)
- Red LED cathode to various GND connections
- Red LED anode to Resistor (connected to IO Expander P14)
Resistor
- Resistor (for Green LED) between IO Expander P15 and Green LED anode
- Resistor (for Red LED) between IO Expander P14 and Red LED anode
KY-019 Relay Module 1 Channel
- S to ESP32 D19
- 5V to ESP32 Vin
- GND to various GND connections
- NC not connected
- COM to Buck Converter IN+
- NO to 12V Solenoid Lock VCC
12V Solenoid Lock
- VCC to Relay Module NO
- GND to Buck Converter IN-
Solar Panel
- + to Diode anode (connected to Solar Charge Controller Solar Cell +)
- - to Solar Charge Controller Solar Cell -
AC Source
- + to Centralized Power Supply L
- - to Centralized Power Supply N
Solar Charge Controller
- Solar Cell + to Diode cathode (connected to Solar Panel +)
- Solar Cell - to Solar Panel -
- Battery + to Diode anode (connected to UPS Battery VCC)
- Battery - to UPS Battery GND
- Load + to Custom 1 vcc
- Load - to Custom 1 gnd
UPS Battery
- GND to Solar Charge Controller Battery -
- VCC to Diode cathode (connected to Solar Charge Controller Battery +)
Diode
- Anode to Solar Panel + or Solar Charge Controller Battery +
- Cathode to Solar Charge Controller Solar Cell + or UPS Battery VCC
Buck Converter
- IN+ to Custom 1 vcc or Centralized Power Supply dc +
- IN- to Custom 1 gnd or Centralized Power Supply dc -
- OUT+ to various VCC connections
- OUT- to various GND connections
OLED Display 2.42"
- GND to various GND connections
- VCC to ESP32 Vin
- SCK to ESP32 D23
- SDA to ESP32 D18
- RES, DC, CS not connected
Custom 1
- vcc to Centralized Power Supply dc + and Solar Charge Controller Load +
- gnd to Centralized Power Supply dc - and Solar Charge Controller Load -
Centralized Power Supply
- L to AC Source +
- N to AC Source -
- com not connected
- DC - to Custom 1 gnd
- dc - to Custom 1 gnd
- dc + to Custom 1 vcc
Documented Code
No code was provided for the microcontroller or any other programmable components in the circuit. The documentation of the code would typically include a description of the functionality implemented, the setup and loop functions for an Arduino-based microcontroller like the ESP32, and any functions or libraries used to interface with the components. Since no code is available, this section cannot be completed.