Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

ESP32-Controlled Automated Watering System with Soil Moisture Sensing

Image of ESP32-Controlled Automated Watering System with Soil Moisture Sensing

Circuit Documentation

Summary of the Circuit

This circuit is designed to monitor soil moisture levels and control a water pump based on the moisture data. It uses an ESP32 microcontroller to read data from a capacitive soil moisture sensor and control a relay, which in turn switches a 5V mini water pump on or off. The ESP32 is powered by a 3.3V supply, and the relay and water pump are powered by a separate 5V adapter.

Component List

ESP32 - 38 pins

  • Description: A microcontroller with WiFi and Bluetooth capabilities and a wide range of GPIO pins.
  • Purpose: Acts as the central processing unit of the circuit, reads soil moisture data, and controls the relay.

Capacitive Soil Moisture Sensor V1.2

  • Description: A sensor that measures the moisture level in the soil via capacitance.
  • Purpose: Provides soil moisture data to the ESP32 for processing.

KF-301 Relay

  • Description: An electromechanical switch that can be controlled by a digital signal.
  • Purpose: Allows the ESP32 to control the power to the water pump.

5V Mini Water Pump

  • Description: A small pump that operates on 5V DC power.
  • Purpose: Pumps water to the soil when activated by the relay.

5V Adapter

  • Description: A power supply that converts AC mains power to 5V DC.
  • Purpose: Provides power to the relay and the water pump.

Wiring Details

ESP32 - 38 pins

  • 3V3: Power supply to the Capacitive Soil Moisture Sensor V1.2.
  • GND: Common ground with the Capacitive Soil Moisture Sensor V1.2 and KF-301 Relay.
  • 5V: Power supply to the KF-301 Relay.
  • G17: Digital output to control the KF-301 Relay signal.
  • G16: Analog input to read the output from the Capacitive Soil Moisture Sensor V1.2.

Capacitive Soil Moisture Sensor V1.2

  • VCC: Connected to the 3V3 pin of the ESP32.
  • GND: Connected to the GND pin of the ESP32.
  • AOUT: Analog output connected to the G16 pin of the ESP32.

KF-301 Relay

  • Power: Connected to the 5V pin of the ESP32.
  • Ground: Connected to the GND pin of the ESP32.
  • Signal: Controlled by the G17 pin of the ESP32.
  • C (Common): Connected to the 5V output of the 5V Adapter.
  • NO (Normally Open): Connected to the positive pin of the 5V Mini Water Pump.

5V Mini Water Pump

  • Positive Pin: Connected to the NO pin of the KF-301 Relay.
  • Negative Pin: Connected to the GND pin of the 5V Adapter.

5V Adapter

  • 5V: Provides power to the C pin of the KF-301 Relay.
  • GND: Provides ground to the negative pin of the 5V Mini Water Pump.

Documented Code

Since no code was provided, this section is left blank. The expected code would typically initialize the GPIO pins on the ESP32, read the analog value from the soil moisture sensor, and control the relay based on the moisture level.


Please note that the actual implementation of the code would be necessary to provide a complete documentation of the circuit's functionality. The code would include setup routines, the main loop, and possibly interrupt service routines or other modular functions for reading the sensor and controlling the relay.