Interfacing Soil Moisture Sensor with Arduino

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

  1. Arduino Uno board
  2. FC-28 Soil Moisture Sensor (resistive type)
  3. 16Ɨ2 LCD Display with I2C module
  4. Breadboard
  5. Jumper wires
  6. USB cable (for programming and power)
  7. 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/

License
All Rights
Reserved
licensBg
0