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

ESP32-Based Environmental Monitoring and Access Control System with RFID and Servo Actuation

View and Edit Project In Cirkit DesignerImage of ESP32-Based Environmental Monitoring and Access Control System with RFID and Servo Actuation

Circuit Documentation

Summary

The circuit is designed to interface various sensors and input devices with an ESP32 microcontroller for monitoring and control purposes. It includes environmental sensors (DHT22 for temperature and humidity, MQ-3 and MQ-5 for gas detection), a servo motor for actuation, RFID reader for identification, pushbuttons for user input, and an LCD display for output. The ESP32 serves as the central processing unit, running embedded code to interact with the connected devices, process sensor readings, and control the servo based on predefined conditions.

Component List

DHT22

MQ-3 Breakout

ESP32 - 38 pins Expansion Board

MQ-5

Servo

Pushbutton

Resistor

LCD I2C Display

RFID-RC522

Wiring Details

DHT22

MQ-3 Breakout

MQ-5

Servo

Pushbuttons

Resistor

LCD I2C Display

RFID-RC522

Documented Code

The embedded code for the ESP32 microcontroller is written in C++ and is used to control the circuit's functionality. The code includes libraries for interfacing with the LCD, RFID, DHT sensor, and servo motor. It defines pin assignments, initializes devices, and contains the main loop that handles RFID card reading, button debouncing, and mode selection. The code also includes functions for handling RFID card detection, checking authorized UIDs, running modes based on the detected chemical, adjusting the servo position, and handling button presses.

// Code is omitted for brevity. Please refer to the provided code input for the full source.

The code is structured into functions to improve readability and maintainability. It uses conditional statements to make decisions and control the flow of the program based on sensor readings and user inputs. The servo's position is adjusted according to the current mode and chemical detected, demonstrating a simple control system that could be expanded for more complex applications.