How to interface soil moisture sensor with evive?

soil moisture sensor
About This Tutorial
This tutorial demonstrates how to interface and track moisture of the soil.Display the data on evive display.
Tutorial Info

Components Required

Image Component Quantity Available in Kit
evive 1
USB A-B Cable 1
Male to Female Jumper Cable 20cm 3
Soil Moisture Sensor 1


Monitoring plant health is very important for its fast growth. In this busy world, people usually forget to water their plants which leads to bad growth and health of their plants. For ensuring complete development of plants it is necessary to know the amount of moisture present in the soil. Soil moisture sensor senses the amount of moisture present in the soil.

Soil Moisture sensor

Soil moisture sensors (Wikipedia) measure the volumetric water content in the soil. The two probes of the moisture sensor are connected to LM293 comparator. This sensor uses the two probes to pass current through the soil, and then it reads that resistance to get the moisture level.

Soil Moisture sensor

How does soil moisture sensor work?

The Soil Moisture Sensor uses capacitance to measure the water content of soil (by measuring the dielectric permittivity of the soil, which is a function of the water content). The output from the sensor is an analog voltage value between 0 to 5V, which is linearly proportional to the moisture percentage of the soil.

Moisture Percentage = (Analog voltage * 100) / 1023 % 

Circuit Diagram for the soil moisture sensor

The circuit of the soil moisture sensor is explained below:

  • + pin of the comparator is connected to the 5V pin of the evive board.
  • – pin of the comparator is connected to GND pin of the evive board.
  • Out of AO(Analog output) and DO(digital output) AO pin is connected to the analog pin(here in our code we have used A0 pin) of the evive board.

PictoBlox Code

In this example, we will display the moisture value on evive TFT Display:

  1. Open PictoBlox.
  2. Select the board as evive:
    Selecting Board
  3. Connect the evive.
    Select Port
  4. Make two variable to store the Sensor Value and Moisture Percentage:
    New Variable Pictoblox
  5. Create the following script using when evive starts up block:
    Soil Moisture
  6. Upload the code onto evive:
    Upload Code

You can download the PictoBlox program from here: Displaying soil moisture value on evive TFT Display


The soil moisture percentage is displayed on the TFT Display.
soil moisture sensor

Share this Tutorial
Share on facebook
Share on twitter
Share on pinterest
Share on reddit
Share on print
Featured Projects

Leave a Reply