Soil Moisture Sensor – How to choose and use with Arduino

Into agriculture, gardening, or building a soil moisture project that requires a soil moisture sensor to measure the water content of your soil? Here at Seeed, we offer just that! Simple and easy to use with your Arduino board, you wouldn’t have to worry about building your very own soil moisture project!

Before we introduce our soil sensor and teach you how you can use it with Arduino, let us first take a look at what is a soil moisture sensor, its usages, and more!

What is a Soil Moisture Sensor and how does it work?

As its name suggests, a soil moisture sensor is one that detects the volumetric water content of the soil. There are two types of such sensors

  • One that measures based on the rules of soil; dielectric constant, resistance and ions
  • The other which include gypsum blocks, tensiometer that measures water potential; a new property within soils

We’ll be talking about the first group of such sensors today but first, you may be wondering why is it important to measure soil moisture?

  • Well, we all know crops require water for growth, but understanding what’s sufficient and not over-watering it is crucial for such. This is where soil moisture sensors come to play, an important method to provide insights into the irrigation systems.

Soil moisture working principle

Soil Moisture Sensor can either use resistance or capacitance changes to measure the water content of the soil. To further understand both working principles, we’ll take a look at how each of it works below:

Resistive Soil Moisture Sensor

Resistive Soil Moisture Sensor

To simply put it, resistive soil moisture sensor work by using the relationship between electrical resistance and water content to gauge the moisture levels of the soil. Such sensors contain two exposed probes that are inserted directly into the soil sample.

  • When the water content in the soil is high, the soil has a stronger electrical conductivity, hence resulting in lower resistance levels which indicate as a high soil moisture
  • When the water content in the soil is low, the soil has poorer electrical conductivity, hence resulting in a higher resistance which indicates as low soil moisture

Capacitive soil moisture sensor

Capacitive soil moisture sensor works by measuring the change in capacitance that’s associated with dielectric permittivity (the ability of a substance to hold an electrical charge). It’s commonly built with a positive and negative plate, with a dielectric medium separating it in the middle.

Instead of directly inserting two exposed probes for moisture measurement, it measures moisture through the ions dissolved. As such, capacitive measuring is corrosion-free and allows for better reading of moisture content.

For either type, Moisture levels are then outputted ether in % of water volume or in m3.m-3 (how much of a cubic metre is water as compared to the entire cubic metre of soil sample).

What is a soil moisture sensor used for?

Agriculture usages

File:PikiWiki Israel 12354 Agriculture in Israel.jpg

Imagine managing acres of cropland without knowing when’s the right time and the right amount of water to apply to your crops. Sounds disastrous?

Yes indeed, but that’s where soil moisture sensor is used for, helping farmers know exact soil moisture conditions on their fields, improving the overall management of crops during critical growth stages.

Household usages for Gardeners


Since soil moisture sensors are relatively cheap and readily available, it is a popular option for gardeners to use in checking whether their pot of plants or garden plants has sufficient moisture for growth.

Research and Forecasting

Soil moisture sensors are used for research purposes as well, collecting Long-term soil moisture data that can be used to forecast/predict potential droughts, landslides, erosions, etc. Such applications can then help in coming up with early preventive measures.

Irrigation for Sporting Fields

Be it American football, soccer or golf courses, they are all played on sporting fields that require irrigation to maintain the pitch. However, not over-irrigating it is key, where soil moisture sensors are used for, ensuring such irrigation systems are efficient in preventing over-watering, etc.

Buy Soil Moisture Sensors at Seeed

Seeed offers two Soil Moisture Sensors for your selection, both affordable and easy to use with Arduino or Raspberry Pi thanks to our Grove System!

Compared to other soil moisture sensor breakout that requires soldering, all you’ll need to get our soil sensors functioning is a Grove – Base Shield alongside your Arduino device! Simple and Easy Plug and Play soil moisture system!

Like the look of its simplicity? Not only are we offering a much easier interfacing with Arduino and Raspberry Pi, it is done with no extra cost involved!

If you like what you’ve seen with Grove, here are our Soil Moisture Sensors for your consideration!

Grove – Capacitive Moisture Sensor (Corrosion Resistant)

This is the Grove – Capacitive Moisture Sensor. As its name suggests, it measures soil moisture through capacitive changes, making it a better option then resistive ones!

  • Since there’s no direct exposure of the metal electrodes, you wouldn’t have to fear any erosion/corrosion happening on this sensor as well!
  • Apart from soil moisture detection, it’s suitable for applications such as automatic watering system as well
  • Instead of having a typical soil moisture sensor operating range, it operates on either 3.3V / 5V for easy microcontroller parability

Its feature includes:

  • Capacitive style soil sensing
  • Corrosion-resistant
  • Built-in amplifier

Grove – Moisture Sensor (Resistive option)

If you’re looking for a cheaper alternative that does the job and is willing to sacrifice incremental performance upgrades the previous option has to offer, this Grove – Moisture Sensor is for you!

Despite this soil moisture sensor running based on the resistive working principle, it can still be applied in most of your soil sensing applications including:

  • Botanic Gardening; deciding whether your plants in the garden need watering, plant watering automation
  • Consistency measurement
  • Moisture sensing

However, do remember that resistive soil motion sensor like this is not hardened against contamination or exposure of the control circuitry to water. It is therefore prone to corrosion across the probes.

How to use a Soil Moisture Sensor with an Arduino?

Now that we’ve understood all you need to know about soil moisture sensors, let’s get started with our simple tutorial on how you can use the Grove – Capacitive Moisture Sensor with Arduino!

Required Materials:

You’ll need the following hardware components for this tutorial:

  • Seeeduino is Seeed’s very own Arduino board, made with relative benefits over the original
  • This tutorial is still applicable for the following Arduino boards:
    • Arduino UNO, Arduino Mega, Arduino Leonardo, Arduino 101, Arduino Due

Before we begin with the hardware configurations, do take note that if you’re using an Arduino UNO, it is recommend for you to use the DC power supply, otherwise the maximum ripple of VCC may exceed 100mV

Hardware Overview and Assembly

  • Step 1: Connect the Grove – Capacitive Moisture Sensor to port A0 of the Grove – Base Shield
    • You can opt to connect the Grove – Capacitive Moisture Sensor to Seeeduino directly as well
  • Step 2: Plug Grove Base Shield into Seeeduino Grove port
  • Step 3: Insert the Grove – Capacitive Moisture Sensor into the soil to be tested
    • Ensure when inserting, to not cross this white line:
  • Step 4: Connect Seeeduino to PC via a USB cable

We’ve used a pot of plant as an example but it should look something like this after the above steps:

Software configuration and calibration

If it’s your first time building a soil moisture sensor with Arduino, we recommend you to take a look at our getting started with Arduino guide before moving on with this section!

  • Step 1: Copy the code below, and download it to your Arduino. If you’re unsure on how to upload the code, please check our how to upload code guide

  Reads an analog input on pin 0, prints the result to the Serial Monitor.
  Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

  This example code is in the public domain.

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  delay(100);        // delay in between reads for stability

Step 2: Open the Serial Monitor of Arduino IDE by clicking Tool -> Serial Monitor. You can opt to tap the Ctrl + Shift + M key on your keyboard as well. Set the baud rate to 9600.

  • If you’re unsure about the Arduino Serial Monitor, do check my guide on it

When everything goes well, you’ll see something similar to the one below:


Do note that different module measurements may result in dirrent output

Soil Moisture Sensor Projects

Since the above tutorial is only one example of how you can pair the soil moisture sensor to an Arduino, here are some other projects to help you get started!

ESP8266 & Seeed Moisture Sensor Project

Are you using the ESP8266 Breakout Board instead of an Arduino and require a tutorial for pairing the soil moisture sensor together? This project is for you!

What do you need?

Hardware components:

  • NodeMCU ESP8266 Breakout Board
  • Seeed Grove Starter kit plus for Intel Edison

Software apps and online services:

Interested to find out more? You can check out the full tutorial by Team Mongoose OS: Toly on!

Plant Monitoring System using AWS IoT

Worried about your plant and its moisture levels while you’re away for a vacation? With this plant monitoring system, you can track and easily monitor your plant through web services for IoT!

What do you need?

Hardware components:

Software apps and online services:

Hand tools and fabrication machines:

  • A generic 3D printer

Interested to find out more? You can check out the full tutorial by CJA3D on!

Automatic Plant Watering System

DIY an Automatic Plant Watering Device

Interested in making your very own automatic plant watering system? With this DIY project, you do so without any hardware programming, coding, or soldering!

  • This project uses a Wio Link, a Wi-Fi development board to build connected IoT projects with our Grove modules

What do you need?

Hardware components:

Interested to find out more? You can check out our full tutorial on Instructables!


That’s all for today on soil moisture sensors. I hope with today’s blog, you get a deeper understanding of what it is, how it works, usages and how to build a soil moisture system!

Get started with building a soil sensor project with the Grove – Capacitive Soil Sensor today!

Please follow and like us:


January 2020
Wordpress Social Share Plugin powered by Ultimatelysocial