ESP32-S3 Controlled Environmental Monitoring and Automation System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
The circuit in question is designed to interface various sensors and actuators with an ESP32-S3-DevKitC-1-N8R2 microcontroller. The sensors include gas sensors (MQ2, MQ135), a temperature sensor (DS18B20), a humidity sensor (DHT11), and a flame sensor (KY-026). Actuators in the circuit include a fan, a buzzer, and a 4-channel relay module controlling an air conditioner and a pump. The circuit is powered by a 220V power source, with the ESP32-S3-DevKitC-1-N8R2 microcontroller regulating the 5V and 3.3V supply for the sensors and actuators.
Component List
- MQ2 Gas Sensor: A sensor for detecting LPG, propane, hydrogen, and other combustible gases.
- MQ135 Gas Sensor: A sensor for detecting a wide range of gases, including NH3, NOx, alcohol, benzene, smoke, and CO2.
- ESP32-S3-DevKitC-1-N8R2: A microcontroller development board based on the ESP32-S3 chip, featuring Wi-Fi and Bluetooth capabilities.
- DS18B20 Temperature Sensor: A digital temperature sensor providing high precision and a wide range of temperature readings.
- DHT11 Humidity and Temperature Sensor: A basic, low-cost digital temperature and humidity sensor.
- KY-026 Flame Sensor: A sensor for detecting fire or other sources of a flame.
- Fan: An electric fan for air circulation or cooling.
- Buzzer: An electronic buzzer for audible alerts or alarms.
- Relay 4 Channel 5V: A 4-channel relay module for controlling high power devices such as the air conditioner and pump.
- Air Conditioner (AIRCONDITIONER): An air conditioning unit controlled via one of the relays.
- Power 220V (power 220v): The main power source for the circuit, providing 220V AC.
- Pump: A water pump controlled via one of the relays.
- Humidifier: A device that adds moisture to the air, powered by 5V.
Wiring Details
MQ2 Gas Sensor
- VCC: Connected to 5V from the ESP32-S3-DevKitC-1-N8R2.
- GND: Connected to GND on the ESP32-S3-DevKitC-1-N8R2.
- AOUT: Connected to pin 35 on the ESP32-S3-DevKitC-1-N8R2.
- DOUT: Not connected.
MQ135 Gas Sensor
- VCC: Connected to 5V from the ESP32-S3-DevKitC-1-N8R2.
- GND: Connected to GND on the ESP32-S3-DevKitC-1-N8R2.
- A0: Connected to pin 42 on the ESP32-S3-DevKitC-1-N8R2.
- D0: Not connected.
ESP32-S3-DevKitC-1-N8R2
- GND: Common ground for various components.
- 5Vin: Provides 5V to MQ2, MQ135, Fan, Relay Module, and Humidifier.
- 3v3: Provides 3.3V to DHT11 and DS18B20.
- Pins 15, 13, 35, 42, 17, 7, 6, 5, 38, 36: Various GPIOs connected to sensors and relay module.
DS18B20 Temperature Sensor
- OUTPUT: Connected to pin 15 on the ESP32-S3-DevKitC-1-N8R2.
- VCC 3.3V-5V DC: Connected to 3.3V on the ESP32-S3-DevKitC-1-N8R2.
- GND: Connected to GND on the ESP32-S3-DevKitC-1-N8R2.
DHT11 Humidity and Temperature Sensor
- DATA: Connected to pin 13 on the ESP32-S3-DevKitC-1-N8R2.
- VCC: Connected to 3.3V on the ESP32-S3-DevKitC-1-N8R2.
- GND: Connected to GND on the ESP32-S3-DevKitC-1-N8R2.
KY-026 Flame Sensor
- A0: Not connected.
- GND: Connected to GND on the ESP32-S3-DevKitC-1-N8R2.
- VCC: Connected to 3.3V on the ESP32-S3-DevKitC-1-N8R2.
- D0: Connected to pin 36 on the ESP32-S3-DevKitC-1-N8R2.
Fan
- 5V: Connected to 5V from the ESP32-S3-DevKitC-1-N8R2.
- GND: Connected to GND on the ESP32-S3-DevKitC-1-N8R2.
Buzzer
- POSITIVE: Connected to pin 38 on the ESP32-S3-DevKitC-1-N8R2.
- NEGATIVE: Connected to GND on the ESP32-S3-DevKitC-1-N8R2.
Relay 4 Channel 5V
- VCC: Connected to 5V from the ESP32-S3-DevKitC-1-N8R2.
- GND: Connected to GND on the ESP32-S3-DevKitC-1-N8R2.
- IN1, IN2, IN3, IN4: Connected to pins 7, 17, 6, and 5 on the ESP32-S3-DevKitC-1-N8R2 respectively.
- COM1, COM2, COM3: Connected to the hot wire of the 220V power source.
- NO1: Connected to the air conditioner.
- NO3: Connected to the pump.
- NC1, NC2, NC3, NC4: Not connected.
Air Conditioner (AIRCONDITIONER)
- +: Connected to NO1 on the Relay Module.
- -: Connected to the neutral wire of the 220V power source.
Power 220V (power 220v)
- hot wire: Connected to COM1, COM2, COM3 on the Relay Module.
- neutral wire: Connected to the air conditioner and pump.
Pump
- +: Connected to NO3 on the Relay Module.
- -: Connected to the neutral wire of the 220V power source.
Humidifier
- 5V: Connected to 5V from the ESP32-S3-DevKitC-1-N8R2.
- GND: Connected to GND on the ESP32-S3-DevKitC-1-N8R2.
Documented Code
No code has been provided for the microcontroller. The documentation of the code would typically include a description of the functionality implemented, setup and loop functions for Arduino-based microcontrollers, or main function for other platforms, along with any interrupt service routines or additional functions. It would also include comments explaining the purpose of each section of the code and how it interacts with the connected hardware components.