Circuit Documentation
Summary
This circuit is designed to monitor environmental conditions using various sensors and respond to specific events. It reads temperature and humidity from a DHT11 sensor, checks for fire using a Flame sensor, and monitors LPG gas levels using an MQ-6 sensor. The readings are displayed on an LCD screen. Based on sensor inputs, the circuit controls LEDs, a servo motor, a buzzer, and a fan. Additionally, it sends alerts via a GSM module.
Component List
ESP32 (30 pin)
- Description: Microcontroller with Wi-Fi and Bluetooth capabilities.
- Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3
LED: Two Pin (red)
- Description: Red LED.
- Pins: cathode, anode
LED: Two Pin (green)
- Description: Green LED.
- Pins: cathode, anode
Buzzer
- Description: Piezoelectric buzzer.
- Pins: PIN, GND
Servo
- Description: Servo motor.
- Pins: GND, VCC, PWM
MQ-6 SENSOR LPG GAS
- Description: LPG gas sensor.
- Pins: VCC, GND, A0, D0
Fan
- Description: DC fan.
- Pins: GND, 5V
SIM900A
- Description: GSM module for sending SMS alerts.
- Pins: GND, DB9-3 (RXD), DB9-2 (TXD), 5V, 3VR, 5VR, 3VT, 5VT, VCC, Ring, RESTART, RESET, STATUS
Sensor SHT113 Flame
- Description: Flame sensor.
- Pins: A0, D0, GND, VCC
KY-015 DHT11
- Description: Temperature and humidity sensor.
- Pins: 5V, S, GND
MB102 Breadboard Power Supply Module 3.3V/5V
- Description: Power supply module for breadboards.
- Pins: VCC, GND, 3.3V, 5V
16x2 I2C LCD
- Description: LCD display with I2C interface.
- Pins: GND, VCC, SDA, SCL
Wiring Details
ESP32 (30 pin)
- D35 connected to A0 of MQ-6 SENSOR LPG GAS
- D25 connected to cathode of LED: Two Pin (green)
- D26 connected to D0 of MQ-6 SENSOR LPG GAS
- D27 connected to cathode of LED: Two Pin (red)
- D22 connected to SCL of 16x2 I2C LCD
- TX0 connected to DB9-2 (TXD) of SIM900A
- RX0 connected to DB9-3 (RXD) of SIM900A
- D21 connected to SDA of 16x2 I2C LCD
- D19 connected to D0 of Sensor SHT113 Flame
- D18 connected to PWM of Servo
- D5 connected to 5V of Fan
- D2 connected to PIN of Buzzer
- D15 connected to S of KY-015 DHT11
LED: Two Pin (red)
- anode connected to VCC of MB102 Breadboard Power Supply Module 3.3V/5V
- cathode connected to D27 of ESP32 (30 pin)
LED: Two Pin (green)
- anode connected to VCC of MB102 Breadboard Power Supply Module 3.3V/5V
- cathode connected to D25 of ESP32 (30 pin)
Buzzer
- PIN connected to D2 of ESP32 (30 pin)
- GND connected to GND of MB102 Breadboard Power Supply Module 3.3V/5V
Servo
- GND connected to GND of MB102 Breadboard Power Supply Module 3.3V/5V
- VCC connected to VCC of MB102 Breadboard Power Supply Module 3.3V/5V
- PWM connected to D18 of ESP32 (30 pin)
MQ-6 SENSOR LPG GAS
- VCC connected to VCC of MB102 Breadboard Power Supply Module 3.3V/5V
- GND connected to GND of MB102 Breadboard Power Supply Module 3.3V/5V
- A0 connected to D35 of ESP32 (30 pin)
- D0 connected to D26 of ESP32 (30 pin)
Fan
- GND connected to GND of MB102 Breadboard Power Supply Module 3.3V/5V
- 5V connected to D5 of ESP32 (30 pin)
SIM900A
- GND connected to GND of MB102 Breadboard Power Supply Module 3.3V/5V
- DB9-3 (RXD) connected to TX0 of ESP32 (30 pin)
- DB9-2 (TXD) connected to RX0 of ESP32 (30 pin)
- 5V connected to VCC of MB102 Breadboard Power Supply Module 3.3V/5V
Sensor SHT113 Flame
- D0 connected to D19 of ESP32 (30 pin)
- GND connected to GND of MB102 Breadboard Power Supply Module 3.3V/5V
- VCC connected to VCC of MB102 Breadboard Power Supply Module 3.3V/5V
KY-015 DHT11
- 5V connected to VCC of MB102 Breadboard Power Supply Module 3.3V/5V
- S connected to D15 of ESP32 (30 pin)
- GND connected to GND of MB102 Breadboard Power Supply Module 3.3V/5V
MB102 Breadboard Power Supply Module 3.3V/5V
- VCC connected to VCC of 16x2 I2C LCD
- GND connected to GND of 16x2 I2C LCD
- VCC connected to anode of LED: Two Pin (red)
- VCC connected to anode of LED: Two Pin (green)
- VCC connected to VCC of MQ-6 SENSOR LPG GAS
- VCC connected to VCC of Servo
- VCC connected to VCC of Sensor SHT113 Flame
- VCC connected to 5V of KY-015 DHT11
- GND connected to GND of MQ-6 SENSOR LPG GAS
- GND connected to GND of Buzzer
- GND connected to GND of Servo
- GND connected to GND of Sensor SHT113 Flame
- GND connected to GND of KY-015 DHT11
- GND connected to GND of 16x2 I2C LCD
- GND connected to GND of SIM900A
- GND connected to GND of Fan
16x2 I2C LCD
- GND connected to GND of MB102 Breadboard Power Supply Module 3.3V/5V
- VCC connected to VCC of MB102 Breadboard Power Supply Module 3.3V/5V
- SDA connected to D21 of ESP32 (30 pin)
- SCL connected to D22 of ESP32 (30 pin)
Code Documentation
/*
* This Arduino sketch reads temperature and humidity from a DHT11 sensor
