Share via


Moisture Sensor with Windows on Intel Galileo

Recently I was playing with moisture sensor for one of my project so thought to share it with you. I got that from ebay for less than $4. Basically A soil moisture sensor measures the water content in soil. With it, you can easily tell when the soil needs more water or when it’s over-watered . When the soil moisture decreases, the sensor output value will decrease. This sensor uses the two probes to pass current through the soil, and then it reads that resistance to get the moisture level. More water makes the soil conduct electricity more easily (less resistance), while dry soil conducts electricity poorly (more resistance. You can know whether a plant needs water or not by observing the results that the sensor outputs. Now by the end of this article you will be able to make your own moisture sensor that can track the water needs of plants of your garden.

This is how a soil moisture sensor looks:

 http://poojabaraskar.azurewebsites.net/wp-content/uploads/2015/07/IMG_20150201_140327_1.jpg 

 Requirements

  • Moisture sensor module (Arduino Compatible)
  • Intel Galileo Board
  • Jumper wires
  • Breadboard
  • LED

Interface

  • Power supply: 3.3v or 5v
  • Pin definition:
  • Analog output (Yellow wire)
  • GND (Black wire)
  • Power (Red wire)
  • DO: Digital output interface

http://poojabaraskar.azurewebsites.net/wp-content/uploads/2015/07/IMG_20150201_134154_1.jpg

The code is written in C++ with Visual Studio that will deploy on Intel Galileo running on Windows.

http://www.c-sharpcorner.com/UploadFile/f55fd9/moisture-sensor-with-intel-galileo/Images/image3.png

Here I am using a Gen1 board but you can definitely use any. Depending on the code, the sensor data is received by the A0 pin. However any analog I/O pin can do the task. My sensor was showing values above 300 when the soil is moist and above 500 when it is completely dry but when I place it in water the values drops to 100. Here I have attached an LED to alert us when the soil becomes dry or you can do something else with your Advanced Gardening System to alert you that the plant needs water. Also I have noticed that different sensors give different values. So perhaps the values for Dry, Moist and Wet soil will be different from mine but you can always play with the values and tabulate them. After a few samples you can finally determine the values for each condition of moisture with your sensor.

The following shows the values when the sensor is placed in water:

 http://poojabaraskar.azurewebsites.net/wp-content/uploads/2015/07/wet_.png  

The following shows the values when the sensor is in air (dry):

 http://poojabaraskar.azurewebsites.net/wp-content/uploads/2015/07/dry_.png