Automatic Watering System using FC-28 Moisture Sensor

Automatic irrigation is a concept of controlled watering of plants without any manual operations, so as to maintain a water level ideal for its cultivation.

For an automatic plant watering system, we can adopt various techniques, such as time-based water pump controlling, by sensing various parameters of the soil and surroundings, etc. Here in this project, watering is done by monitoring the instantaneous level of water content or moisture present in the soil.

FC – 28 sensor

Here an FC-28 moisture sensor is using for the measurement of the moisture level in the soil.

fc 28 soil sensor

An FC-28 consists of a sensor module and a sensor. The sensor module mainly has an LM393 comparator, potentiometer, indicator LED light – Power and Digital Output Indicator LEDs; commonly red for power indication and blue for digital output. The sensor is a pair of test probes which are placed or inserted into the soil.

The moisture level sensor works with the basic principle of electrical conductivity of water. Wet soil will have less resistance value than dry soil. Thereby more current flows through the soil. Similarly, dry soil will have poor electrical conductivity. From this, the corresponding moisture level can be obtained by the sensor module with respect to the electrical conductivity of the soil.

The FC-28 module has both digital and analog outputs.

The analog output AO of the FC-28 gives the direct analog value of sensor reading between 0 – 5V. The analog output value is proportional to the resistance of the soil. That is it will be high when the soil is dry and the value decreases as it gets wet.

The FC-28 module has a threshold adjust potentiometer for the digital output to preset the required threshold value. The sensor value will be compared with this threshold value by the LM393 comparator. When the sensor value is above the set threshold value the digital output DO will switch to a HIGH state (+5V). The output LED will light ON and OFF when the digital output has LOW and HIGH states respectively.

Standalone Fc-28 Soil moisture sensor without a microcontroller

Using the digital output, the FC – 28 sensors can be used as a standalone system to directly drive devices without any microcontrollers. For direct applications, the digital output can be used as an input signal to low power relays or transistors to operate any high power devices.

In here circuit a solenoid valve is using for water control. So the system automatically opens and close the water supply depending on soil condition.

The solenoid valve requires an external power supply. An NPN transistor is used as a switch to control the solenoid valve.


When the water level is low, the sensor value rises above the threshold value. Thus the DO of the sensor switch to HIGH state and the solenoid valve opens. As the water level increases the value comes below the threshold and the valve closes. The output LED lights as the water level reaches above than the preset level.

Automatic irrigation system using Arduino

Using arduino, additional features can be added to the system. The code can be expanded to use LCD display, indicators, alerting system or any other devices.

In arduino based system both digital and analog outputs of the sensor can be used as an input signal. While using with digital signal arduino can only read the input as a HIGH or LOW state.

Here the system is using the analog output of the module so the arduino can read instantaneous readings from the sensor.

FC-28 moisture sensor Arduino interface

FC 28 Sensor Arduino pin Configuration
FC 28 Pin Arduino Pin
Vcc Vcc
SIG  A0 Analog Read

The SIG out is the analog output which is connected to the analog input pin of the Arduino. Analog input reads the SIG output ranges from 0 to 5V and converts it to corresponding decimal values from 0 and 1023.

automatic plant water irrigation system using arduino

The Arduino continuously check the sensor reading and check it with condition function in the code. Here also the solenoid valve Opens and Close respectively as the water level in the soil decreases and increases.

automatic plant irrigation system fc28 atmega328  automatic watering system without microcontroller

An assembled circuit of the automatic irrigation system. The Arduino sketch runs with a standalone Atmega 328p microcontroller.

Arduino code for an automatic irrigation system

int sensorIN = A0;
int Value = 0;
int threshold = 70;//change threshold.

void setup() {
  pinMode(2, OUTPUT);

void loop() {
  Value = analogRead(sensorIN);
  Value = map(Value, 0, 1023, 0, 100);
  if (Value > threshold) {
    //Opens the valve.
    digitalWrite(2, HIGH);
  else {
    //Closes the valve.
    digitalWrite(2, LOW);

The threshold water level can be adjusted by changing the value of the variable “threshold” in the code.

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

2 Responses

  1. Artur Moises says:

    In “The output LED lights as the water level reaches above than the preset level.”, what’s the preset level?

Leave a Reply

Your email address will not be published. Required fields are marked *