FC 28 LM393 Soil Moisture Sensor Module with Arduino


In this tutorial we learn how to use of FC 28 LM393 Soil Moisture Sensor Module with Arduino, Monitoring soil moisture is crucial for efficient plant growth and irrigation management. The FC-28 Soil Moisture Sensor, when combined with an Arduino Uno, provides a cost-effective and reliable solution for measuring soil moisture levels. In this tutorial, we will guide you through the process of setting up the FC-28 Soil Moisture Sensor with Arduino, understanding its working principle, and creating a basic soil moisture monitoring system.

Hardware Required

You will require the following Hardware Components for interfacing FC 28 LM393 Soil Moisture Sensor Module with Arduino.

Components#Buy From Amazon
Arduino UNO1Buy Now
Soil Moisture Sensor Module1Buy Now
Jumper WiresFewBuy Now
Breadboard1Buy Now

Understanding the FC-28 Soil Moisture Sensor

The FC-28 Soil Moisture Sensor is a simple yet effective module designed to measure the moisture content in the soil. It operates on the principle of electrical conductivity, where the resistance between two electrodes on the sensor changes with variations in soil moisture levels. By measuring this resistance, we can determine the moisture content in the soil.

Pinout of FC-28 Soil Moisture Sensor


Pin Configuration of FC-28 Soil Moisture Sensor

Pin NameDescription
VCCThe Vcc pin powers the module, typically with +5V
GNDPower Supply Ground
DODigital Out Pin for Digital Output.
AOAnalog Out Pin for Analog Output

Circuit Setup

  1. Connect the VCC pin of the FC-28 sensor to the 5V pin on the Arduino Uno.
  2. Connect the GND pin of the sensor to the GND pin on the Arduino Uno.
  3. Connect the A0 pin of the sensor to any analog input pin on the Arduino Uno.

Circuit Diagram

The following circuit shows you the connection of the FC 28 LM393 Soil Moisture Sensor Module with Arduino Please make the connection carefully


Working Principle

The FC-28 Soil Moisture Sensor contains two electrodes that are inserted into the soil. As the moisture content in the soil changes, it affects the electrical conductivity between the electrodes. When the soil is dry, the resistance is higher, and as it becomes moist, the resistance decreases. The Arduino can measure this resistance and convert it into meaningful moisture values.

Coding and Data Interpretation

To interface the FC-28 Soil Moisture Sensor with Arduino, follow these steps:

  1. Set up the necessary variables: Declare variables to store the sensor pin number and moisture values.
  2. Configure the pinMode: In the setup() function, configure the analog pin connected to the sensor as an input using the pinMode() function.
  3. Read sensor values: Use the analogRead() function to read the analog input from the sensor and store the value in a variable.
  4. Convert sensor values: Depending on the specific characteristics of your FC-28 sensor, you may need to map the analog values to corresponding moisture levels using the map() function.
  5. Display results: Print or display the moisture values using the Serial Monitor or an LCD display connected to the Arduino Uno.

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow


//For more Projects: www.arduinocircuit.com

const int hygrometer = A0;	//Hygrometer sensor analog pin output at pin A0 of Arduino
int value;

void setup(){

void loop(){
	// When the plant is watered well the sensor will read a value 380~400, I will keep the 400 
	// value but if you want you can change it below. 
	value = analogRead(hygrometer);		//Read analog value 
	value = constrain(value,400,1023);	//Keep the ranges!
	value = map(value,400,1023,100,0);	//Map value : 400 will be 100 and 1023 will be 0
	Serial.print("Soil humidity: ");
	delay(2000); //Read every 2 sec.


The FC-28 Soil Moisture Sensor module has various applications, including:

  1. Plant irrigation systems: Monitor soil moisture levels to automate the irrigation process, ensuring plants receive optimal water supply.
  2. Greenhouses and agriculture: Control irrigation in greenhouse environments or agricultural fields based on real-time soil moisture data, promoting efficient water usage.
  3. Indoor gardening: Monitor soil moisture in indoor gardening setups to maintain optimal moisture levels for plant growth.
  4. Soil moisture mapping: Collect data from multiple FC-28 sensors placed in different locations to create a soil moisture map, helping to identify areas with varying moisture levels.
  5. Research and experimentation: The sensor can be used in scientific experiments or research projects involving soil moisture monitoring and analysis.


The FC-28 Soil Moisture Sensor, when integrated with Arduino, offers a practical solution for monitoring soil moisture levels. By following this tutorial and understanding the working principle of the sensor, you can build a soil moisture monitoring system for your plants or agricultural projects. This enables you to make informed decisions about irrigation, resulting in healthier plants and efficient water usage.

Leave a Comment