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

ESP32-Based Wi-Fi Connected Soil Moisture Monitoring System

Image of ESP32-Based Wi-Fi Connected Soil Moisture Monitoring System

Circuit Documentation

Summary

This circuit consists of an ESP32 microcontroller and a Capacitive Soil Moisture Sensor V1.2. The ESP32 is used to read the analog output from the soil moisture sensor and can be programmed to process or transmit this data. The soil moisture sensor measures the moisture content in the soil and outputs an analog voltage corresponding to the moisture level.

Component List

ESP32 38 PINS

  • Description: A powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities.
  • Pins: GND, 23, 22/SCL, 1, 2, 21/SDA, 19, 18, 5, 17/TX2, 16/RX2, 4, 0, 15, D1, D0, CLK, 3V3, EN, VP, VN, 34, 35, 32, 33, 25, 26, 27, 14, 12, 13, D2, D3, 11, 5V/VIN
  • Purpose in Circuit: To read the analog output from the soil moisture sensor and process or transmit the data.

Capacitive Soil Moisture Sensor V1.2

  • Description: A sensor that measures the moisture content in the soil and outputs an analog voltage.
  • Pins: GND, VCC, AOUT
  • Purpose in Circuit: To measure the soil moisture level and provide an analog output to the ESP32.

Wiring Details

ESP32 38 PINS

  • GND: Connected to GND of the Capacitive Soil Moisture Sensor V1.2
  • 3V3: Connected to VCC of the Capacitive Soil Moisture Sensor V1.2
  • VP: Connected to AOUT of the Capacitive Soil Moisture Sensor V1.2

Capacitive Soil Moisture Sensor V1.2

  • GND: Connected to GND of the ESP32 38 PINS
  • VCC: Connected to 3V3 of the ESP32 38 PINS
  • AOUT: Connected to VP of the ESP32 38 PINS

Code

There is no code provided for this circuit. The ESP32 can be programmed to read the analog value from the soil moisture sensor and process or transmit the data as needed. Below is a sample code snippet that reads the analog value from the sensor:

// Sample code to read analog value from Capacitive Soil Moisture Sensor

const int sensorPin = VP; // Pin connected to AOUT of the sensor

void setup() {
  Serial.begin(115200); // Initialize serial communication
}

void loop() {
  int sensorValue = analogRead(sensorPin); // Read the analog value from the sensor
  Serial.println(sensorValue); // Print the sensor value to the serial monitor
  delay(1000); // Wait for a second before reading again
}

This code initializes the serial communication and reads the analog value from the sensor pin (VP). The value is then printed to the serial monitor every second.