A low-cost circuit for reading soil moisture from multiple Irrometer 200SS Sensors
In a previous article, I wrote about how important it is to get to know the soil moisture in real-time to perform optimum irrigation and how the Irrometer Watermark 200SS sensor is a well-suited sensor to achieve this.
In this article, I am going to talk about how you too can create a simple low cost and highly reliable circuit to read from multiple Irrometer 200SS sensors.
At its core, the Irrometer 200SS is a resistive based sensor and it’s operating principle is that — change in water content in the soil results in a change in resistance. And the simplest way to measure resistance value using a microcontroller is to create a voltage divider circuit and read the change in voltage and translate it to its equivalent resistance.
A major issue with this approach is that the electrodes of the sensor and the soil moisture together act as a small battery when DC is used in operation. This, in turn, starts a chemical reaction where the anode part of the sensor starts to corrode. With this approach, the sensor can barely last for 6 months in the soil. Thus, it is highly recommended not to use any DC source in tandem with the sensor.
The reference circuit the Irrometer company has given is quite complex. Also, there is no other circuit readily available in the market where you can read from at least 4 sensors continuously using a single microcontroller.
There is a very simple circuit using a very basic electronic component to achieve this. The component is the humble 555 IC. Well, a CMOS variant!
This is the schematic you can use to read from the Irrometer circuit:
Instead of using a voltage divider, we use a LMC555 circuit. The capacitors C3 and C6 are used to ensure that no DC component enters the sensor. AVCC is 3.3V supply and SWPFREQ is the output of this circuit that gets connected to a microcontroller digital input pin.
the 555 IC must be a CMOS 555. i.e. LMC555CN or similar. It will not work if you use a regular NE555! The capacitors can be ceramic (non-polar). The MUX also must be a CMOS variant.
The microcontroller circuit does not measure the sensor’s internal resistance directly. The sensor resistance forms part of an oscillator circuit (555 IC) which outputs an alternating signal whose frequency is a function of resistance. As the soil (and sensor) dries, the soil-water potential decreases (becomes more negative), and the sensor’s internal resistance increases. The increasing resistance causes the frequency of the output signal to decrease. The microcontroller program uses a built-in Arduino routine (PULSIN) to measure the frequency of the alternating signal in terms of pulsewidth. As the signal alternates between periods of high and low voltage levels, the PULSIN routine measures the length of time, or duration, in microseconds (us), of the high-voltage state. This pulsewidth measurement is then used to calculate water potential. The sensor outputs frequency in the range of 50 Hz to 10,000 Hz from wet to dry condition of the soil which gets converted to 0 to 200KPa using suitable calibration equations.
What if I want to measure more than one sensor in the same circuit? What if I need to measure the values of 4 sensors placed at different depths of the soil? Simple, I can replicate the above circuit 4 times (one for each sensor) and use it! That’s what we did! And everything worked perfectly when we tested it in a lab condition where each sensor was placed in individual soil pots for testing. But when we took it out into the field and placed it in soil, around 2 feet away from each other and started taking readings, were we in for a surprise!
There is a concept called “Ground Loops” in electronics. In layman's terms, apart from your circuit ground (battery negative), the earth provided a grounding of sorts. This creates unnecessary “loops” in the circuit that makes the readings go all over the place! You can also call this “common-mode noise”. In addition to general device isolation from the ground, when reading multiple sensors the circuit must be designed to accommodate isolating sensors from each other. The wet soil in which sensors are installed creates a common conductive path between sensors. In effect, without isolation, a device can be reading partially or fully between electrodes in different sensors rather than between electrodes inside each sensor.
If you are using a single sensor with a single 555 circuit, you will not experience this issue. But the moment you add two or more, the readings get haywire!
There are many solutions to this. It mainly involves isolating the ground using optoisolators/optocouplers, isolated DC-DC, etc. These are complicating things, they consume more power and these solutions are what we at fasal call “Over-engineering”!
To achieve complete isolation between the sensors and the 555 circuit (and thereby, eliminating sensor interferences and ground loops), there is a very simple electronic component that can be used to solve the issue. Just like the humble 555 IC, we can use a 2 Channel Multiplexer that can be used to switch between the sensors during reading. We are using a 74HC7052D which is a 4 channel dual multiplexer. In simple words, 4 soil moisture sensors can be connected to a single 555 circuit. The modified circuit schematic is as below:
The mux select pins S0 & S1 are used to toggle between the four dual channels Y0, Y1, Y2 & Y3. The logic table is as below:
Note: !E is always at LOW.
Because the multiplexer switches between the sensor paths, there is complete isolation from one sensor to another and thus eliminating interference from other sensors as well as the ground.
You can find the PCB Design files (ready for manufacturing) as well as a sample Arduino Code to work with the PCB in our GitHub repo: https://github.com/Fasal-Tech/irrometer555-withMux
Also read —