If youāve ever wondered whether your plants actually need water or youāre just watering them out of habitāyouāre not alone. One of the most common mistakes in gardening is incorrect watering, and thatās exactly where a soil moisture sensor becomes incredibly useful.
In this project, weāll build a simple yet practical soil moisture monitoring system using an Arduino Uno. This setup helps you measure the moisture level in soil in real time and gives you a clear understanding of when watering is required.
What makes this project interesting is that it introduces both analog sensing (for detailed readings) and digital detection (for quick decisions)ātwo important concepts in embedded systems that are widely used in real-world automation like smart irrigation and greenhouse monitoring.
Ā
Components Required
- Arduino Uno board
- FC-28 Soil Moisture Sensor (resistive type)
- 16Ć2 LCD Display with I2C module
- Breadboard
- Jumper wires
- USB cable (for programming and power)
- Optional external power supply
Ā
Soil Moisture Sensor Overview and Pinout
The FC-28 soil moisture sensor works by measuring how easily electricity flows through the soil. Since water improves conductivity, wet soil allows more current to pass, while dry soil resists it.
The sensor is made up of two sections: a probe that goes into the soil and a control module that processes the signal. The module uses a comparator ICāLM393āto generate stable outputs.
Ā
Understanding the Pins

- VCC ā Supplies power (3.3Vā5V)
- GND ā Ground connection
- AO (Analog Output) ā Provides continuous voltage variation based on moisture
- DO (Digital Output) ā Gives HIGH or LOW based on a set moisture threshold
This dual-output design allows flexibility depending on how detailed or simple you want your project to be.
Ā
Project Overview / Working Principle
Think of the soil sensor as a variable resistor placed inside the soil. Its resistance changes depending on how much water is present.
- When the soil is wet, resistance drops and conductivity increases
- When the soil is dry, resistance increases and conductivity decreases
The sensor module converts this behavior into electrical signals. The Arduino reads these signals and interprets them either as a range (analog) or a condition (digital).
- Ā
- Analog Mode: Useful when you want to display exact moisture levels or percentages
- Ā
- Digital Mode: Ideal when you only care about whether soil is ādryā or āwetā
Ā
Ā
Hardware Setup and Connections
Letās connect everything step by step while also understanding the difference between analog and digital usage.
Start by powering the sensor module. Connect the VCC pin to the 5V pin of the Arduino and GND to GND. This powers both the sensor probe and the onboard circuitry.
Ā
Using Analog Mode
If you want continuous moisture readings:
Ā

- Connect the AO pin of the sensor to A0 on the Arduino
In this mode, the Arduino reads a range of values (typically 0ā1023). You can convert these values into percentages and display them on the LCD. This is useful when you want precise monitoringāfor example, showing āSoil Moisture: 65%ā.
Ā
Using Digital Mode
If your goal is simplerālike triggering watering only when soil becomes dry:

- Connect the DO pin of the sensor to any digital pin on the Arduino
Hereās where it gets interestingāthe sensor module has a small potentiometer. By rotating it, you can set the moisture threshold. Once the soil crosses this threshold:
- Output becomes HIGH (dry condition)
- Output becomes LOW (sufficient moisture)
This mode is perfect for automation systems where you just need a yes/no decision.
Ā
LCD Connection
To make the system user-friendly, connect the I2C LCD:
- SDA ā Arduino SDA pin
- SCL ā Arduino SCL pin
This display can show live readings, status messages, or alerts like āWater Neededā.
Once everything is wired, power the system and verify the readings.
Ā
Conclusion
This project is a great example of how simple electronics can solve practical, everyday problems. It not only helps you monitor soil moisture but also introduces important embedded concepts like analog sensing, threshold detection, and sensor calibration.
You can take this further by adding a relay module to control a water pump, or even connect it to the cloud for remote monitoring.
For complete step-by-step instructions and code, check the full guide here:
https://playwithcircuit.com/soil-moisture-sensor-arduino-tutorial/









