ESP32-Based Smart Irrigation System with Solar Power and Wi-Fi Connectivity
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit design that includes various sensors, actuators, and an ESP32 microcontroller. The circuit is designed to interface with multiple components such as an I2C LCD screen, pushbuttons, LEDs, a relay module, and various sensors including soil moisture, rain, ultrasonic, and temperature/humidity sensors. The circuit also includes a solar charge controller and a TP-Link router for connectivity.
Component List
I2C LCD 16x2 Screen
- Pins: SCL, SDA, VCC (5V), GND, VDD, VO, RS, RW, E, D0, D1, D2, D3, D4, D5, D6, D7, BLA, BLK
- Description: A 16x2 character LCD screen with I2C interface.
YL-83 Module LM393
- Pins: A0, D0, GND, VCC, -, +
- Description: A soil moisture sensor module.
Pushbutton
- Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
- Description: A simple pushbutton switch.
HC-SR04 Ultrasonic Sensor
- Pins: VCC, TRIG, ECHO, GND
- Description: An ultrasonic distance sensor.
LED: Two Pin (red)
- Pins: cathode, anode
- Description: A red LED.
LED: Two Pin (green)
- Pins: cathode, anode
- Description: A green LED.
LED: Two Pin (yellow)
- Pins: cathode, anode
- Description: A yellow LED.
YL-69 Sonda
- Pins: +, -
- Description: A soil moisture sensor probe.
2ch relay
- Pins: NC, COM, NO, VCC, IN2, IN1, GND
- Description: A 2-channel relay module.
12V Battery (mini)
- Pins: -, +
- Description: A 12V mini battery.
DHT22
- Pins: +, Out, -
- Description: A temperature and humidity sensor.
Mini Diaphragm Water Pump
- Pins: Positive (+), Negative (-)
- Description: A small water pump.
Plastic Solenoid Valve
- Pins: pin1, pin2
- Description: A plastic solenoid valve.
NPK Soil Sensor (mini)
- Pins: VCC, GND, A, B
- Description: A mini NPK soil sensor.
ESP32 (30 pin)
- 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
- Description: A 30-pin ESP32 microcontroller.
RAIN SENSOR
- Pins: AO, DO, GRD, VCC
- Description: A rain sensor module.
Solar Charge Controller
- Pins: Solar +, Solar -, Battery +, Battery -, Load +, Load -
- Description: A solar charge controller.
Solar Panel
- Pins: +, -
- Description: A solar panel.
TP-Link Router
- Pins: Power, POE, LAN
- Description: A TP-Link router for network connectivity.
Wiring Details
I2C LCD 16x2 Screen
- VCC (5V): Connected to ESP32 Vin
- GND: Connected to ESP32 GND
- SCL: Connected to ESP32 D22
- SDA: Connected to ESP32 D21
YL-83 Module LM393
- VCC: Connected to ESP32 Vin
- GND: Connected to ESP32 GND
- A0: Connected to ESP32 D33
- +: Connected to YL-69 Sonda +
- -: Connected to YL-69 Sonda -
Pushbutton
- Pin 1 (in): Connected to ESP32 D5
- Pin 2 (in): Connected to ESP32 D5
- Pin 3 (out): Connected to GND
- Pin 4 (out): Connected to GND
HC-SR04 Ultrasonic Sensor
- VCC: Connected to ESP32 Vin
- GND: Connected to ESP32 GND
- TRIG: Connected to ESP32 D12
- ECHO: Connected to ESP32 D13
LED: Two Pin (red)
- anode: Connected to ESP32 D32
- cathode: Connected to GND
LED: Two Pin (green)
- anode: Connected to ESP32 D14
- cathode: Connected to GND
LED: Two Pin (green)
- anode: Connected to ESP32 D27
- cathode: Connected to GND
LED: Two Pin (yellow)
- anode: Connected to ESP32 D26
- cathode: Connected to GND
LED: Two Pin (yellow)
- anode: Connected to ESP32 D25
- cathode: Connected to GND
YL-69 Sonda
- +: Connected to YL-83 Module LM393 +
- -: Connected to YL-83 Module LM393 -
2ch relay
- VCC: Connected to ESP32 Vin
- GND: Connected to ESP32 GND
- IN1: Connected to ESP32 D4
- IN2: Connected to ESP32 D2
- NO: Connected to Mini Diaphragm Water Pump Positive (+)
- NO: Connected to Plastic Solenoid Valve pin2
- COM: Connected to ESP32 Vin
- COM: Connected to ESP32 Vin
12V Battery (mini)
- +: Connected to Solar Charge Controller Battery +
- -: Connected to Solar Charge Controller Battery -
DHT22
- +: Connected to ESP32 Vin
- -: Connected to ESP32 GND
- Out: Connected to ESP32 D19
Mini Diaphragm Water Pump
- Positive (+): Connected to 2ch relay NO
- Negative (-): Connected to GND
Plastic Solenoid Valve
- pin1: Connected to GND
- pin2: Connected to 2ch relay NO
NPK Soil Sensor (mini)
- VCC: Connected to ESP32 Vin
- GND: Connected to ESP32 GND
- A: Connected to ESP32 VP
- B: Connected to ESP32 D23
ESP32 (30 pin)
- Vin: Connected to I2C LCD 16x2 Screen VCC (5V)
- GND: Connected to GND
- D5: Connected to Pushbutton Pin 1 (in)
- D22: Connected to I2C LCD 16x2 Screen SCL
- D21: Connected to I2C LCD 16x2 Screen SDA
- D19: Connected to DHT22 Out
- D14: Connected to LED: Two Pin (green) anode
- D27: Connected to LED: Two Pin (green) anode
- D26: Connected to LED: Two Pin (yellow) anode
- D25: Connected to LED: Two Pin (yellow) anode
- D32: Connected to LED: Two Pin (red) anode
- D33: Connected to YL-83 Module LM393 A0
- D12: Connected to HC-SR04 Ultrasonic Sensor TRIG
- D13: Connected to HC-SR04 Ultrasonic Sensor ECHO
- D4: Connected to 2ch relay IN1
- D2: Connected to 2ch relay IN2
- VP: Connected to NPK Soil Sensor (mini) A
- D34: Connected to RAIN SENSOR AO
- D35: Connected to RAIN SENSOR DO
RAIN SENSOR
- VCC: Connected to ESP32 Vin
- GRD: Connected to GND
- AO: Connected to ESP32 D34
- DO: Connected to ESP32 D35
Solar Charge Controller
- Solar +: Connected to Solar Panel +
- Solar -: Connected to Solar Panel -
- Battery +: Connected to 12V Battery (mini) +
- Battery -: Connected to 12V Battery (mini) -
- Load +: Connected to TP-Link Router Power
Solar Panel
- +: Connected to Solar Charge Controller Solar +
- -: Connected to Solar Charge Controller Solar -
TP-Link Router
- Power: Connected to Solar Charge Controller Load +
Documented Code
ESP32 (30 pin)