ESP32-Based Smart Home Safety System with Wi-Fi and Telegram Alerts
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to monitor environmental conditions and detect hazards such as gas leaks, smoke, flames, and motion. It uses an ESP32 microcontroller to read data from various sensors and display the information on a 16x2 I2C LCD. The system also sends alerts via Telegram and activates a buzzer, LEDs, a servo, and a fan in case of danger.
Component List
ESP32 Devkit V1
- Description: Microcontroller
- Pins: 3V3, GND, D15, D2, D4, RX2, TX2, D5, D18, D19, D21, RX0, TX0, D22, D23, EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, VIN
Resistor (200 Ohms)
- Description: Resistor
- Pins: pin1, pin2
Buzzer
- Description: Buzzer
- Pins: PIN, GND
Servo
- Description: Servo Motor
- Pins: GND, VCC, PWM
Fan
- Description: Cooling Fan
- Pins: GND, 5V
Sensor SHT113 Flame
- Description: Flame Sensor
- Pins: A0, D0, GND, VCC
MB102 Breadboard Power Supply Module 3.3V/5V
- Description: Power Supply Module
- Pins: VCC, GND, 3.3V, 5V
MQ-6 SENSOR LPG GAS
- Description: Gas Sensor
- Pins: VCC, GND, A0, D0
L298N DC Motor Driver
- Description: Motor Driver
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
Battery 12V
- Description: Power Source
- Pins: +, -
MQ-2
- Description: Smoke Sensor
- Pins: GND, VCC, ANALOG, Digital
IR Sensor
- Description: Infrared Sensor
- Pins: out, gnd, vcc
PIR Sensor
- Description: Motion Sensor
- Pins: VDD, SIG, GND
16x2 I2C LCD
- Description: LCD Display
- Pins: GND, VCC, SDA, SCL
LED: Two Pin (red)
- Description: Red LED
- Pins: cathode, anode
LED: Two Pin (green)
- Description: Green LED
- Pins: cathode, anode
KY-015 DHT11
- Description: Temperature and Humidity Sensor
- Pins: 5V, S, GND
Wiring Details
ESP32 Devkit V1
- D19: Connected to L298N DC motor driver IN4
- D21: Connected to 16x2 I2C LCD SDA and L298N DC motor driver IN3
- D22: Connected to 16x2 I2C LCD SCL and L298N DC motor driver IN2
- D23: Connected to L298N DC motor driver IN1
- D34: Connected to MQ-6 SENSOR LPG GAS A0
- D35: Connected to Sensor SHT113 Flame D0
- D32: Connected to IR sensor out
- D33: Connected to MQ-2 ANALOG
- D25: Connected to Resistor pin1
- D26: Connected to Resistor pin1
- D27: Connected to PIR sensor SIG
- D14: Connected to KY-015 DHT11 S
- D12: Connected to Servo PWM
- D13: Connected to Buzzer PIN
Resistor (200 Ohms)
- pin1: Connected to ESP32 Devkit V1 D25
- pin1: Connected to ESP32 Devkit V1 D26
Buzzer
- PIN: Connected to ESP32 Devkit V1 D13
- GND: Connected to MB102 Breadboard Power Supply Module 3.3V/5V GND
Servo
- GND: Connected to MB102 Breadboard Power Supply Module 3.3V/5V GND
- VCC: Connected to MB102 Breadboard Power Supply Module 3.3V/5V VCC
- PWM: Connected to ESP32 Devkit V1 D12
Fan
- GND: Connected to L298N DC motor driver OUT2
- 5V: Connected to L298N DC motor driver OUT1
Sensor SHT113 Flame
- A0: Not connected
- D0: Connected to ESP32 Devkit V1 D35
- GND: Connected to MB102 Breadboard Power Supply Module 3.3V/5V GND
- VCC: Connected to MB102 Breadboard Power Supply Module 3.3V/5V VCC
MB102 Breadboard Power Supply Module 3.3V/5V
- VCC: Connected to 16x2 I2C LCD VCC, KY-015 DHT11 5V, MQ-2 VCC, MQ-6 SENSOR LPG GAS VCC, IR sensor vcc, Sensor SHT113 Flame VCC, Servo VCC, PIR sensor VDD
- GND: Connected to 16x2 I2C LCD GND, LED: Two Pin (green) cathode, LED: Two Pin (red) cathode, Buzzer GND, KY-015 DHT11 GND, MQ-2 GND, MQ-6 SENSOR LPG GAS GND, IR sensor gnd, Sensor SHT113 Flame GND, Servo GND, PIR sensor GND
MQ-6 SENSOR LPG GAS
- VCC: Connected to MB102 Breadboard Power Supply Module 3.3V/5V VCC
- GND: Connected to MB102 Breadboard Power Supply Module 3.3V/5V GND
- A0: Connected to ESP32 Devkit V1 D34
- D0: Not connected
L298N DC Motor Driver
- OUT1: Connected to Fan 5V
- OUT2: Connected to Fan GND
- 12V: Connected to Battery 12V +
- GND: Connected to Battery 12V -
- 5V: Not connected
- OUT3: Not connected
- OUT4: Not connected
- 5V-ENA-JMP-I: Not connected
- 5V-ENA-JMP-O: Not connected
- +5V-J1: Not connected
- +5V-J2: Not connected
- ENA: Not connected
- IN1: Connected to ESP32 Devkit V1 D23
- IN2: Connected to ESP32 Devkit V1 D22
- IN3: Connected to ESP32 Devkit V1 D21
- IN4: Connected to ESP32 Devkit V1 D19
- ENB: Not connected
Battery 12V
- +: Connected to L298N DC motor driver 12V
- -: Connected to L298N DC motor driver GND
MQ-2
- GND: Connected to MB102 Breadboard Power Supply Module 3.3V/5V GND
- VCC: Connected to MB102 Breadboard Power Supply Module 3.3V/5V VCC
- ANALOG: Connected to ESP32 Devkit V1 D33
- Digital: Not connected
IR Sensor
- out: Connected to ESP32 Devkit V1 D32
- gnd: Connected to MB102 Breadboard Power Supply Module 3.3V/5V GND
- vcc: Connected to MB102 Breadboard Power Supply Module 3.3V/5V VCC
PIR Sensor
- VDD: Connected to MB102 Breadboard Power Supply Module 3.3V/5V VCC
- SIG: Connected to ESP32 Devkit V1 D27
- GND: Connected to MB102 Breadboard Power Supply Module 3.3V/5V GND
16x2 I2C LCD
- **GND