ESP32-Based Smart Weather Station with Ultrasonic Sensors and Gas Detection
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to monitor environmental conditions using various sensors and display the data on an LCD. It includes an ESP32 microcontroller, ultrasonic sensors, a rain sensor, a gas sensor, a buzzer, LEDs, pushbuttons, and servos. The system can detect rain, measure distances, detect gas, and control a servo motor based on sensor inputs. The data is displayed on a 16x2 I2C LCD.
Component List
ESP32 Wroom Dev Kit
- Pins: 3V3, EN, VP, VN, GPIO 34, GPIO 35, GPIO 32, GPIO 33, GPIO 25, GPIO 26, GPIO 27, GPIO 14, GND, GPIO 13, SD2, SD3, CMD, V5, GPIO 23, GPIO 22, TXD, RXD, GPIO 21, GPIO 19, GPIO 18, GPIO 5, GPIO 17, GPIO 16, GPIO 4, GPIO 0, GPIO 2, GPIO 15, SD1, SD0, CLK
- Description: Microcontroller used to control the circuit and process sensor data.
HC-SR04 Ultrasonic Sensor
- Pins: VCC, TRIG, ECHO, GND
- Description: Used to measure distance.
YL-83 Rain Sensor - Detection Board
- Pins: POS, NEG
- Description: Used to detect rain.
Rain/Snow Sensor - Board
- Pins: 1, 2, A0 (Analog), D0 (Digital), GND, VCC (5V)
- Description: Used to detect rain or snow.
MQ-2 Gas Sensor
- Pins: GND, VCC, ANALOG, Digital
- Description: Used to detect gas.
Pushbutton
- Pins: Pin 2, Pin 1, Pin 3, Pin 4
- Description: Used to control the servo motor.
Buzzer Module
- Pins: GND, Vcc, I/O
- Description: Used to alert when gas is detected.
LED: Two Pin (blue)
- Pins: cathode, anode
- Description: Used as an indicator.
Resistor (220 Ohms)
- Pins: pin1, pin2
- Description: Used to limit current for LEDs.
Resistor (10k Ohms)
- Pins: pin1, pin2
- Description: Used for pull-up/pull-down configurations.
Servo
- Pins: GND, VCC, PWM
- Description: Used to control mechanical movement.
16x2 I2C LCD
- Pins: GND, VCC, SDA, SCL
- Description: Used to display sensor data.
MB102 Breadboard Power Supply Module 3.3V/5V
- Pins: VCC, GND, 3.3V, 5V
- Description: Provides power to the circuit.
Wiring Details
ESP32 Wroom Dev Kit
GND connected to:
- GND of HC-SR04 Ultrasonic Sensor
- GND of Rain/Snow Sensor - Board
- GND of MQ-2 Gas Sensor
- GND of 16x2 I2C LCD
- GND of MB102 Breadboard Power Supply Module
- GND of Buzzer Module
- GND of Servo
V5 connected to:
- VCC of HC-SR04 Ultrasonic Sensor
- VCC of Rain/Snow Sensor - Board
- VCC of MQ-2 Gas Sensor
- VCC of 16x2 I2C LCD
- VCC of Buzzer Module
GPIO 14 connected to:
- Pin 4 of Pushbutton
- pin1 of Resistor (220 Ohms)
GPIO 27 connected to:
- Pin 4 of Pushbutton
GPIO 15 connected to:
- pin1 of Resistor (10k Ohms)
GPIO 34 connected to:
- ANALOG of MQ-2 Gas Sensor
GPIO 35 connected to:
- A0 (Analog) of Rain/Snow Sensor - Board
GPIO 32 connected to:
- TRIG of HC-SR04 Ultrasonic Sensor
GPIO 33 connected to:
- TRIG of HC-SR04 Ultrasonic Sensor
GPIO 25 connected to:
- ECHO of HC-SR04 Ultrasonic Sensor
GPIO 26 connected to:
- ECHO of HC-SR04 Ultrasonic Sensor
GPIO 13 connected to:
- PWM of Servo
GPIO 22 connected to:
- SCL of 16x2 I2C LCD
GPIO 21 connected to:
- SDA of 16x2 I2C LCD
GPIO 2 connected to:
- I/O of Buzzer Module
HC-SR04 Ultrasonic Sensor
VCC connected to:
- V5 of ESP32 Wroom Dev Kit
GND connected to:
- GND of ESP32 Wroom Dev Kit
TRIG connected to:
- GPIO 32 of ESP32 Wroom Dev Kit
- GPIO 33 of ESP32 Wroom Dev Kit
ECHO connected to:
- GPIO 25 of ESP32 Wroom Dev Kit
- GPIO 26 of ESP32 Wroom Dev Kit
YL-83 Rain Sensor - Detection Board
POS connected to:
- 2 of Rain/Snow Sensor - Board
NEG connected to:
- 1 of Rain/Snow Sensor - Board
Rain/Snow Sensor - Board
VCC (5V) connected to:
- V5 of ESP32 Wroom Dev Kit
GND connected to:
- GND of ESP32 Wroom Dev Kit
A0 (Analog) connected to:
- GPIO 35 of ESP32 Wroom Dev Kit
2 connected to:
- POS of YL-83 Rain Sensor - Detection Board
1 connected to:
- NEG of YL-83 Rain Sensor - Detection Board
MQ-2 Gas Sensor
VCC connected to:
- V5 of ESP32 Wroom Dev Kit
GND connected to:
- GND of ESP32 Wroom Dev Kit
ANALOG connected to:
- GPIO 34 of ESP32 Wroom Dev Kit
Pushbutton
Pin 4 connected to:
- GPIO 14 of ESP32 Wroom Dev Kit
- GPIO 27 of ESP32 Wroom Dev Kit
Pin 1 connected to:
- Pin 1 of another Pushbutton
Pin 3 connected to:
- pin1 of Resistor (220 Ohms)
Buzzer Module
Vcc connected to:
- V5 of ESP32 Wroom Dev Kit
GND connected to:
- GND of ESP32 Wroom Dev Kit
I/O connected to:
- GPIO 2 of ESP32 Wroom Dev Kit
LED: Two Pin (blue)
cathode connected to:
- pin2 of Resistor (220 Ohms)
anode connected to:
- pin2 of Resistor (220 Ohms)
Resistor (220 Ohms)
pin1 connected to:
- GPIO 14 of ESP32 Wroom Dev Kit
- GPIO 15 of ESP32 Wroom Dev Kit
pin2 connected to:
- cathode of LED: Two Pin (blue)
- anode of LED: Two Pin (blue)
Resistor (10k Ohms)
- pin1 connected to:
- GPIO 15 of ESP32 Wroom Dev Kit
Servo
GND connected to:
- GND of ESP32 Wroom Dev Kit
VCC connected to:
- VCC of MB102 Breadboard Power Supply Module
PWM connected to:
- GPIO 13 of ESP32 Wroom Dev Kit
16x2 I2C LCD
GND connected to:
- GND of ESP32 Wroom Dev Kit
VCC connected to:
- V5 of ESP32 Wroom Dev Kit
SDA connected to:
- GPIO 21 of ESP32 Wroom Dev Kit
SCL connected to:
- GPIO 22 of ESP32 Wroom Dev Kit
MB102 Breadboard Power Supply Module 3.3V/5V
VCC connected to:
- VCC of Servo
GND connected to:
- GND of