Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-Based Smart Irrigation System with Wi-Fi Control and Soil Moisture Sensors

View and Edit Project In Cirkit DesignerImage of ESP32-Based Smart Irrigation System with Wi-Fi Control and Soil Moisture Sensors

Circuit Documentation

Summary

This document provides a detailed overview of an irrigation system circuit. The system is designed to automate the watering process using various sensors, relays, and actuators controlled by an ESP32 microcontroller. The system includes soil moisture sensors, a DHT22 temperature and humidity sensor, a real-time clock (RTC), a water pump, and solenoid valves. The ESP32 microcontroller is programmed to read sensor data, control the water pump and valves, and communicate with a server for remote monitoring and control.

Component List

  1. Splicing connector WAGO 221

    • Description: A splicing connector used for connecting multiple wires.
    • Pins: Port 1, Port 2, Port 3, Port 4, Port 5
  2. 12V Power Supply

    • Description: Provides 12V DC power to the circuit.
    • Pins: +, -
  3. DCDC 12V/5V 3A

    • Description: Converts 12V DC to 5V DC.
    • Pins: 12V (+), GND, 5V (+), Vin (+), Vin (-)
  4. 3.3V Converter

    • Description: Converts 5V DC to 3.3V DC.
    • Pins: GND, Vout, Vin
  5. ESP32 (30 pin)

    • Description: A microcontroller with WiFi 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
  6. Water Pump

    • Description: A pump used to move water through the irrigation system.
    • Pins: Positive, Negative
  7. 4 Channel Relay Module

    • Description: A relay module used to control high-power devices.
    • Pins: N.O. 4, COM 4, N.C. 4, N.O. 3, COM 3, N.C. 3, N.O. 2, COM 2, N.C. 2, N.O. 1, COM 1, N.C. 1, Pin 13, Pin 14, Pin 15, Pin 16, Pin 17, Pin 18, Pin 19, Pin 20, Pin 21, Pin 22, Pin 23, Pin 24, VCC+, VCC- (GND), IN 1, IN 2, IN 3, IN 4
  8. Plastic Solenoid Valve

    • Description: A valve used to control the flow of water.
    • Pins: Pin1, Pin2
  9. SparkFun gator:soil

    • Description: A soil moisture sensor.
    • Pins: VCC, GND, SIG
  10. DHT22

    • Description: A temperature and humidity sensor.
    • Pins: GND, VCC, DAT
  11. RTC-DS1302

    • Description: A real-time clock module.
    • Pins: Vcc, GND, CLK, DAT, RST
  12. Float Switch

    • Description: A switch used to detect the presence of water.
    • Pins: GND, Digital Pin

Wiring Details

Splicing connector WAGO 221

12V Power Supply

DCDC 12V/5V 3A

3.3V Converter

ESP32 (30 pin)

Water Pump

4 Channel Relay Module

Plastic Solenoid Valve

SparkFun gator:soil

DHT22

RTC-DS1302

Float Switch

Documented Code

ESP32 (30 pin) Code

#include <Arduino.h>
#include <WiFi.h>
#include <WiFiMulti.h>
#include <WiFi