Soil moisture monitoring

How to Build a Soil Moisture Monitoring System (Tutorial)

Importance of Soil Moisture | AgTech Overview | How Data is Used | Tutorial for Building a Soil Moisture Monitoring System | How to Protect and Hide Your Hardware | The Future | For Non-Profits

“The world’s food system is broken. It is driving the planet towards climate catastrophe while leaving billions of people either underfed or overweight” 

The Guardian, $1m a minute: the farming subsidies destroying the world
A farmer walking through crops

Why is Measuring Soil Moisture Important? 

70 percent of the world’s freshwater is used for agriculture.

Within that 70 percent, 60 percent of the water diverted or pumped for irrigation is wasted—via runoff into waterways or evapotranspiration.

40 percent of the world’s population is expected to face water stress by 2030 and the global population is expected to rise from 7.3 billion to 9.7 billion between now and 2050.

Obviously, with more people on the planet, we must grow more food.

However, we need to do it through sustainable agricultural practices that will reduce water waste.

Enter AgTech

AgTech (agriculture technology) consists of technologies that offer a smarter, more efficient way to farm.

Approaches like precision farming, pest-resistant seeds, watering systems that check the weather are all examples of AgTech being used today.

The result? Farmer’s yields are boosted, along with cost-savings and reduced use of natural resources. AgTech solutions can help us protect our remaining water resources while also feeding the world’s growing empty stomachs. 

“Our global climate and its future changes are dependent on how these major Earth cycles link and vary together”

The Guardian, $1m a minute: the farming subsidies destroying the world

One step towards sustaining a greener planet is through monitoring soil moisture.

Soil is a mixture of organic matter, minerals, gases, liquids, and organisms that together support life. It’s the only distinguishing buffer that controls the exchange of water and heat energy between the land surface and the atmosphere. Without this key intermediary, life would cease to exist.

Soil moisture is the water that is held in between soil particles. Surface soil moisture is the water that is in the upper 10 cm of the soil and root zone soil moisture is the upper 200 cm of soil. Simply because there is water in the soil does not mean the plants can absorb it which is why these differences are key to track.

In order to effectively sustain plants, soil water must first break down salts in the soil, thereby producing a soil solution full of nutrients that the plants can absorb and use to grow. If these salts are not broken down into nutrients, much of the water sits as on top of the soil as a film that wastes away, which has led to many of our agriculture problems of today.

How Soil Moisture Data is Used

With soil moisture data, farmers, non-profits, environmental organizations, and governments alike can understand what soil moisture content is optimal for plant growth. The data can be used to: 

Assist with crop productivity: Soil moisture data can help improve crop yield forecasts and irrigation planning. By combining soil moisture data with efficient irrigation systems and drought tolerant crops, and we can prompt a shift to sustainable production. The amount of healthy food that could be unlocked this way is estimated at “$4.5 Trillion in new commercial opportunities each year by 2030.”

Monitor Droughts: Soil moisture data can provide critical insights about drought early warning for the agriculture industry. With early warning systems, we can reduce crop failure, death of livestock, and people.

Recall the 6.7 million Syrian refugees who escaped their war-torn nation and risked their lives to cross the Mediterranean into Europe? These people fled for a variety of reasons, including an extreme drought that led to massive crop failure, which caused a spike in the cost of grain. Without freshwater and food, the Syrian civil war was exasperated. Millions of Syrians revolted in the streets holding bread and chanting slogans against the Syrian regime.

Protests in Syria

Predict floods: It feels like every day there is a flood going on somewhere in the world. One day it’s dams breaking in the United States, rivers changing courses in China, or rising sea levels colliding with rivers causing entire cities to literally wash away. By monitoring soil moisture, we can actually improve flood warning systems by analyzing the soil moisture content before a rainstorm. Governments can then warn residents of areas at risk of flooding, and indicate which routes to take before worsening weather conditions put their lives at risk.

Policy Recommendations: Temboo is working with a local nonprofit in New York City on a project to monitor the soil moisture in tree-beds. The data will be leveraged to acquire additional grant funding, which will scale the project for more robust findings. The nonprofit will use the data to recommend the best management practices to reduce combined sewage outflow into a local water body. Through the power of monitoring soil moisture, nonprofits, and local citizens are protecting their waterways with concrete evidence that the government cannot ignore.

Improve Weather Forecasting: Meteorologists have microclimate forecast insights that far exceed any technology today through monitoring soil moisture. Forecasting the weather requires continuous monitoring of the “state of the atmosphere, including the level of moisture of the soil available”.

Additionally, by monitoring soil moisture, global industries, such as airline corporations and government response agencies, can derive economic value from weather knowledge that is estimated at roughly $13 Billion.

Water, energy and crop cycles: Like all things in nature, climate change is linked to soil. Agriculture, Forestry, and other land use industries account for 24% of global GHG emissions.

If we can monitor soil moisture, we can increase the rate of carbon storage in soil. Soil moisture data can allow farmers to provide plants with the exact amount water needed to grow. The larger plants grow, the more carbon they’re able to extract from our atmosphere to offset climate change.

How to Build a Soil Moisture Monitoring System (Tutorial)

Soil moisture monitoring Setup

Below is a step-by-step tutorial for building a soil moisture sensing application using Temboo’s Kosmos IoT system and soil moisture sensors from NCD.

For the purpose of this soil moisture system, we are going to use a wireless NCD soil moisture sensor because:

  • It’s low power.
  • It can be used indoors or outdoors.
  • It has a 2 mile line-of-sight range with it’s on-board antenna.
  • The probe does not corrode over time and is insensitive to salinity.
  • It measures volumetric water content (VWC).
  • It measures gravimetric water content (GWC).
  • It includes battery level readings with every transmission.
Parts list for building the soil moisture monitoring system

Setting Up Your Kosmos Account

  • Go to the Temboo’s website and create an account – don’t worry, you have a 30 day free trial.

Gateway Application Setup

  • First, install Etcher so that you can copy the Kosmos gateway application to your micro SD card.
  • Insert your micro SD card into your USB SD card reader and connect the card reader to your computer.
  • Open Etcher and drag the Temboo_kosmos...xz file to the micro SD card (you previously downloaded this file while creating your Kosmos application).
Etcher Image

Kosmos Gateway Hardware Setup

  • Insert SD Card
    • Insert the micro SD card into the underside of the gateway (the metal contacts slide in face up).
micro usb into the gateway
  • Power Up The Gateway
    • Connect the 5V 2.5A power adapter to your Kosmos
      gateway. Then, plug the adapter into a power outlet.
powering the gateway
  • Connect Ethernet Cable
    • Use the ethernet cable to connect your Kosmos gateway to an ethernet outlet. See instructions later in this guide if you want to connect your gateway via WiFi.
connecting the ethernet to the gateway
  • Connect NCD Modem
    • Connect the NCD modem to your gateway via the USB cable provided.
connecting the receiver to the gateway
  • Prepare USB Drive
    • Copy the Kosmos config file temboo_kosmos_config.ini onto your USB drive.
put the temboo_kosmos_config.ini to the USB
  • Insert USB Drive
    • Insert the USB thumb drive into any available USB port on your Kosmos gateway.
Put the USB into the gateway

Don’t forget – you can always ask us for help!

Powering On Your NCD sensors

  • Attach the antenna to your NCD sensor(s). Next, decide how you want to power your NCD sensor(s).
    • Wired power: connect the NCD power adapter (12V 3A) to the sensor and plug it into a power outlet. The sensor will automatically start sending data to your Kosmos gateway
    • Battery power: open the sensor’s enclosure and set the PS (power select) jumper parallel to the marking line on the board.
Power source switch for soil moisture monitoring system

Configuring your NCD Sensors

  • Log Into Kosmos
    • Log in to your Kosmos account and navigate to the Sensor Provisioning page. (Hint, its on the top right of the screen)
Device provisioning
  • Select Your Application
    • Select the Kosmos application that you want to set up. During this process we’ll configure your sensors to communicate securely at your chosen data frequency.
select device
  • Confirm Connectivity
    • After selecting an application you’ll see a screen displaying your gateway’s connectivity status. When your gateway is online you can move on to configuring your sensors.
      • Note: This can take up to 60 seconds. Check your social media real quick and when you come back, your soil sensor should be online.
gateway connected page
  • Enter Config Mode
    • Your NCD sensors must be set to config mode before their settings can be updated.
    • To enter config mode, press the RST button for 5 seconds, release it, and then hold down the CFG button until your sensor has been provisioned (this typically takes about 25 seconds).
image of rest and config
  • Exit Config Mode
    • Once you’ve successfully provisioned your sensor(s), hold the RST button for 5 seconds
    • When you’ve finished the provisioning process you automatically will be taken to your dashboard to see your live data!
successful config
You’re a rockstar.

Connecting Your Gateway Via WiFi (Optional)

  • We recommend using ethernet to connect your gateway to the Kosmos web dashboard.
  • To use WiFi to connect your Kosmos gateway to the internet, first remove the USB thumb drive from your gateway and plug it into your computer.
  • Locate the temboo_kosmos_config.ini file on the USB thumb drive and open it with your favorite text editor.
  • Add the details of the WiFi network that you want your gateway to connect to (see lines 14 & 15 in the screenshot below), and then save your config file.
  • Eject the USB drive from your computer and insert it back into your Kosmos gateway. Remove the gateway’s power supply and reconnect it. Your Kosmos gateway will power back up and connect via WiFi.
wifi setup for soil moisture monitoring system

How to Protect and Hide your Soil Moisture Sensor

Once your soil moisture sensor is online and transmitting data to Kosmos, you’ll want to deploy it in the real world.

The gateway, modem, micro SD card, USB flash drive, and power supply should all be kept indoors, connected to the internet, and as close to the sensors as possible.

Depending on where you live, you might be okay with the soil moisture sensor sitting outside with no external covering. However, if you are in a more urban area, you may want to hide your soil moisture sensor to prevent theft or tampering.

To hide the enclosures, you’ll need to assemble durable junction boxes that can withstand severe weather conditions. These enclosures can be made in a variety of ways – below is simply one method.

  • Remove NCD’s original antenna and replace with the flexible single band antenna
    • Unscrew the antenna nut
    • Be very careful to gently pop off the original antenna or you may rip off the entire antenna piece
    • Place the flexible antenna on the antenna connector
Inside an NCD Soil Moisture monitoring Sensor directing the end user to replace the old antenna with a flexible antenna
  • Drill ⅞’’ hole into the top-center of the junction boxes 
  • Cut 1’’ flexible non-metallic PVC to desired length 
  • Attach the ½’’ liquid-tight NM 90-degree PVC conduit fitting to the top of the box and at the other end of the flexible conduit 
    • The ½’’ liquid-tight NM 90-degree PVC conduit will fit perfectly with the ⅞’’ drill hole 
A junction box with one 90 degree conduit attached to the box, a pvc pipe connected to the 90 degree conduit with another 90 degree conduit at the end of the pvc pipe for soil moisture monitoring system
  • Make sure the silver nut is on the inside of the lid and that the threaded side is facing up
image of the full setup of the soil moisture monitoring application
  • Give yourself about 12 inches of wire from the NCD box and cut the wire. Then feed the cut wire through the module
    • Why? Because the soil sensor cannot fit through the 90 degree conduits, so we have to cut the cord, feed it through the system, and re-attach the wires 
  • Strip the wires down to the metal material, and use the solder heat seal shrink butt connectors and a heat gun to fuse the wires back together 
    • Make sure the metal in the solder is melted and that it is touching both ends of the wires. Remember, black goes to black, red to red, and silver metal to silver metal. Here is a quick video on how to solder. 
  • Once the wires are fused back together, do a little tug test to make sure the wires are connected.
  • Use the silicon and seal the top of the soil sensor to the PVC pipe to ensure no water gets into the PVC pipe
  • Once the silicon is dry, Voilà! Your waterproof soil sensor is ready to be buried into the ground!

For extra protection, you can spray paint the top of the junction and PVC pipe brown to match the dirt. Caution, do not spray paint the actual sensor it will ruin the readings!

Close up image of the soil moisture monitoring sensor

A Note About Connectivity 

If you want to monitor soil moisture in a large open field or in an urban environment, connectivity may be an issue.

If the soil sensors are not communicating with the gateway, then you can add a “repeater”. A repeater extends the radio waves of the sensor to reach the gateway beyond its normal capacity.

Monitoring Soil Moisture for a Better Future

Indoor farm

If we continue with the status quo, we are walking into a future soiled by climate change that is threatening human life, biodiversity and natural resources.

But there is hope. We have the means, research, and willpower to continuously show the world that we can solve our own problems with technologies like the Industrial Internet of Things.

Look at vertical farming. These farms are nestled in urban environment and are feeding millions of people a day. How?

By monitoring soil moisture to give plants the exact nutrients they need, indoor farming can save 90% of water resources and use about 1/4 of the traditional space.

As such, the indoor farming business is soaring and it just shy of 15 billion annually. With almost 2/3rd of the population moving to cities by 2050, indoor farming can be a viable, sustainable market.

“To keep costs down, modern sensors and smart energy systems to drastically reduce the overall energy consumption required to produce crops by determining the exact amount of nutrients needed for each individual plant.”

Modern Ag

For many areas around the world using traditional farming methods, monitoring soil moisture is still very much in your reach.

Combine soil moisture data with drip irrigation systems on Kosmos, and you’ll be able to automate the exact amount of nutrients your crops need to thrive in changing environmental conditions.

Drip irrigation system

Environmental Monitoring at Non-profits

If you are working on an environmental monitoring solution at a non-profit or government agency, we want to help. We offer special programs and discounts for using Temboo’s Kosmos IoT System for environmental monitoring applications that contribute to sustainability, legislation changes, or community improvement.

For more information, contact us at