The soil moisture sensor is mainly used in agriculture or farming-related projects & is very popular among hobbyists. some of the students still don’t know what is a soil moisture sensor. so, here we are giving a brief introduction to the sensor.
- This sensor comes in 2 parts, one is the main board and other is the sensing plate. Same as the rain sensor discussed in basic electronic series of articles.
- The probes which are introduced into the soil are vulnerable to corrosion, so use this soil moisture sensor wisely. Or, as I have stated the same in the rain sensor, use a different or custom probe which can last long into the soil without corroding.
- The soil sensor is capable of giving both type of outputs, i.e., analog and digital. But I myself prefer analog signal as it is more efficiently and accurately based on analog values.
- Due to long usage of the sensor, a layer is formed of water salt on the probes, so make sure to clean them time to time for prolonged use.
- Above is the soil moisture sensor schematic, which is once again drawn from a sensor lying around at my place. I cannot guarantee complete accuracy of the sensor schematic, as it may be different for different sensors.
- The sensor is built out from the LM393, Dual Voltage Comparator which is used in many other sensors included in basic electronics series. It is the heart of the sensor along with the probes which are half-buried into the ground.
- A potentiometer and an onboard status led are present on the PCB. These help in adjusting the values sent to the microcontroller and indicating the detection of moisture in soil by the moisture sensor.
- Try to keep the main PCB away from soil as it can create error in sensor values. Also, as stated in disadvantages, the Jumper pins of the probes can be rusted due to expose to moisture of soil sensor.
- It has wide range of voltage range, so it can easily be used with almost any microcontroller but the values with be altered accordingly.
soil moisture sensor working
- The working of Soil Moisture sensor is very similar to a sensor built out of LM393 IC. The only difference can be in the type of outputs sensor offers or gives.
- Probes which are half buried into the ground does the main job of sensing the moisture from the soil. Actually, those probes don’t check moisture, it checks the voltage levels which is also the analog value of the sensor which is given out to the microcontroller.
- The one side of the probe is connected to ground and the other to the non-inverting input of the 1st comparator. With a pull-up resistor and a 0.1µF capacitor in parallel with the probes. The rest of the job is done by the comparator in deciding the output.
- The values of the sensor can be altered due to presence of the fertilizers, insecticides or pesticides. So find a way to make values correct, either using PID or some algorithm.
- First and most is it easily available at a very cheap price, so there is not a problem of availability of soil moisture sensor.
- Secondly, it gives both type of outputs with on-board status led and potentiometer for adjusting the values. Also the quality of main PCB is good as compared to probes.
- Third, you can mount this sensor to any surface as the PCB ensures a mid-hole for screwing the main PCB to any surface.
- The main disadvantage is of the quality of the PCB of the Probes. In my opinion and my usage, I personally didn’t like the quality at all. Over a period of time, the Probes get covered with a layer of salt which is mainly caused due to presence of moisture in the soil.
- Secondly, due to the moisture, the pin headers may get rusted along with the connecting wires which needs to be checked from time to time.
Price & Availability:
- As stated previously, the sensor is very easily available in both offline and online market. Below are the link of some of the website which you can prefer to buy the sensor from. so here you can see the availability of the soil moisture sensor.
soil moisture sensor Applications
- This sensor is very easy to use and used commonly among beginners for many projects. Some of the projects with code and complete instruction details are given below.
Q. What is the voltage level of the soil moisture sensor working?
According to the datasheet of the LM393 IC, the working voltage is up to 36V. So accordingly you can connect it to any voltage level disregarding any voltage logic level.
Q. How to avoid depositing of layer of salt over the probes of the soil moisture sensor working?
If you have the probes the same as the picture, then you may seem it to be quite hard to make it so. But you can use another probe which are available in the market or use some of the copper probes for measuring the value of moisture in the soil for better durability.
Q. Can long connecting wires be used between the main board and the probes?
You can extend the wires that connect the mainboard and the probes, but the values may be altered if the resistance of the wires increase must as compare to the common jumper wires.
Q. Can fertilizers or pesticides can alter the values of the soil moisture sensor working?
Yes as stated above the values can be altered if you use fertilizers or pesticides as these may increase the content of free ions in the soil which results in better conduction of the voltage signals. Hence, altering the value, as free ions in those try to imitate as moisture in the soil.