ESP32-Based Smart Irrigation System with Humidity and Water Level Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to monitor soil humidity and water levels, control a water pump, and provide visual feedback using an RGB LED. The system is controlled by an ESP32 microcontroller, which interfaces with various sensors and actuators.
Component List
Mini Water Pump
- Pins: VCC, GND
- Description: A small water pump used to irrigate plants.
- Purpose in Circuit: Controlled by a relay to turn on/off based on sensor inputs.
Humidity YL-69
- Pins: A0, D0, GND, VCC
- Description: A soil moisture sensor.
- Purpose in Circuit: Measures soil humidity and sends data to the ESP32.
KY-016 RGB LED
- Pins: B, G, R, GND
- Description: An RGB LED module.
- Purpose in Circuit: Provides visual feedback based on sensor readings.
9V Battery
- Pins: -, +
- Description: A 9V battery power source.
- Purpose in Circuit: Powers the water pump through the relay.
KY-019 Relay Module 1 Channel
- Pins: S, 5V, GND, NC, COM, NO
- Description: A single-channel relay module.
- Purpose in Circuit: Controls the water pump based on signals from the ESP32.
Water Level Sensor
- Pins: SIG, VCC, GND
- Description: A sensor to measure water levels.
- Purpose in Circuit: Sends water level data to the ESP32.
ESP32
- Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, VIN, 3V3, D15, D2, D4, RX2, TX2, D5, D18, D19, D21, RX0, TX0, D22, D23, BOOT
- Description: A microcontroller with Wi-Fi and Bluetooth capabilities.
- Purpose in Circuit: Central control unit that processes sensor data and controls the relay and RGB LED.
Wiring Details
Mini Water Pump
- VCC connected to COM of the KY-019 Relay Module.
- GND connected to - of the 9V Battery.
Humidity YL-69
- A0 connected to D33 of the ESP32.
- GND connected to GND of the ESP32.
- VCC connected to VIN of the ESP32.
KY-016 RGB LED
- R connected to D25 of the ESP32.
- G connected to D26 of the ESP32.
- B connected to D27 of the ESP32.
- GND connected to GND of the ESP32.
9V Battery
- - connected to GND of the Mini Water Pump.
- + connected to NO of the KY-019 Relay Module.
KY-019 Relay Module 1 Channel
- S connected to D32 of the ESP32.
- 5V connected to VIN of the ESP32.
- GND connected to GND of the ESP32.
- COM connected to VCC of the Mini Water Pump.
- NO connected to + of the 9V Battery.
Water Level Sensor
- SIG connected to D35 of the ESP32.
- GND connected to GND of the ESP32.
- VCC connected to VIN of the ESP32.
ESP32
- D32 connected to S of the KY-019 Relay Module.
- D33 connected to A0 of the Humidity YL-69.
- D35 connected to SIG of the Water Level Sensor.
- D25 connected to R of the KY-016 RGB LED.
- D26 connected to G of the KY-016 RGB LED.
- D27 connected to B of the KY-016 RGB LED.
- GND connected to GND of the Humidity YL-69, KY-016 RGB LED, KY-019 Relay Module, and Water Level Sensor.
- VIN connected to VCC of the Humidity YL-69, KY-019 Relay Module, and Water Level Sensor.
Documented Code
ESP32 Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
9V Battery Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and the code used in the microcontrollers.