Inverting the output of moisture sensor circuit

Thread Starter

richardperkin

Joined Sep 25, 2012
14
Hi! I found a moisture sensing circuit by searching the forum here, originally posted by Audioguru (schematic attached). I'd like to interface this moisture sensing circuit with an HM-11 Bluetooth module, with the Bluetooth module reading the voltage on one of it's input pins and transmitting that value. This seems pretty simple to do, based on the "HM-10 Stand-alone: Remote Light Sensor" demo project here http://www.martyncurrey.com/hm-10-bluetooth-4ble-modules/
However, I'd like to "invert" the output of the moisture sensing circuit so that the output signal/voltage increases with an increase in moisture between the probes (rather than having the output increase with decreasing moisture between the probes, as it does in the attached schematic). So basically the circuit and Bluetooth transmitter only start to signal when moisture is detected between the probes. Also, I'd like to know how easy it would be (or which component values can be altered) to decrease the measurement/output pulse rate to, say, once a minute to reduce the power consumption of the circuit. The HM-11 Bluetooth module will run on 3V, and this is the only moisture sensing circuit (Audioguru's) I've found so far that is low voltage.
My background is mechanical engineering, and while I can read a schematic and assemble electronics, design-wise I'm hopeless!

upload_2017-11-27_16-3-30.png
 

Attachments

Last edited by a moderator:

alfonsoM

Joined Nov 8, 2017
41

Alec_t

Joined Sep 17, 2013
10,592
To 'invert' the action, connect the probes to pin 3 and C3 instead. I don't know what the values of R2 and R8 are, but you may need to swap those over.
 

Thread Starter

richardperkin

Joined Sep 25, 2012
14

Thread Starter

richardperkin

Joined Sep 25, 2012
14
Thanks alfonsoM...that makes sense, because I was previously thinking of using a pair of HT12 encoder/decoder ICs with 433MHz Tx/Rx pair, but it seems from the link I posted above that it's possible for the HM-11 Bluetooth module to act as the "central" device and read in an analogue signal and transmit it (such as the voltage from a LDR in that case). I think that it should be able to read in the voltage level output from the moisture detecting circuit and transmit that in the same way... hopefully!
 

Thread Starter

richardperkin

Joined Sep 25, 2012
14
Thanks again, Alec_t!
I'll probably put the circuit together on LTSpice and fiddle around to see if the resistor values need swapping, as you suggested they might.
Could you perhaps tell me... which are the components in the circuit that set the flashing time for the LED? I'd quite like to reduce the rate of the LED flashing (output pulse)
 

Alec_t

Joined Sep 17, 2013
10,592
R4,C4 determine the flash rate. Increase either one to reduce the rate. R3,C4 deternine the LED 'on' time per flash.
The circuit should work with R2 and R8 as is or swapped. Swapping them will affect the soil conductance threshold at which the LED starts flashing.
 
Last edited:

Thread Starter

richardperkin

Joined Sep 25, 2012
14
One last thing... capacitor C2 is there to smooth out the power supply, right? Do you think the operation of the circuit would be affected if this is removed? I'm trying to minimise the parts count and also make the circuit as small as possible, and the electrolytic is probably the largest component
 

Thread Starter

richardperkin

Joined Sep 25, 2012
14
Okay, thanks...I'll give it a try! Also, I was hoping to use the two probe connections for the purpose of recharging the battery (as well as for measuring moisture) - would this be possible somehow using some strategically placed diodes? Or would I just have to have separate charging terminals connected to the battery?
 

Alec_t

Joined Sep 17, 2013
10,592
I'd like to "invert" the output of the moisture sensing circuit so that the output signal/voltage increases with an increase in moisture between the probes (rather than having the output increase with decreasing moisture between the probes, as it does in the attached schematic).
I took "output signal" to mean the voltage on C3, but on further analysis of the circuit, and confirmation by LTspice, it now seems the voltage swing on C3 would actually increase with increasing moisture between the probes positioned as shown in post #1.
The voltage swing is close to zero when the inter-probe resistance is equal to R2, but the greater the difference between the R2 and R8 values (whether their positions are as shown or swapped) the greater the C3 voltage swing. This swing needs to exceed the hysteresis of gate IC1-d in order to turn on the LED.
My suggestion to change the probe positions and perhaps swap R2 and R8 won't work to get the inversion you want. Apologies for that. I'll have another think about how it can be achieved without too much ciruit alteration. In the meantime someone else may chime in with a suggestion.
 

philba

Joined Aug 17, 2017
960
It seems like all moisture detecting circuits use the same mechanism - resistance of soil based on moisture content. If you have a micro to drive the bluetooth module, then why not just use the ADC to measure the voltage between the probes as one half of a voltage divider and skip all the other circuitry? You need to have something like stainless steel sensors if you want it to last any length of time, by the way.

Also, I think you could use capacitance as a way to measure moisture content and use insulated wires as the probes.
 

Thread Starter

richardperkin

Joined Sep 25, 2012
14
Thanks for trying to find the solution, Alec... I guess I should have been more specific and said the "output of the circuit to the transistor pair driving the LED". All your help is much appreciated!
 

Thread Starter

richardperkin

Joined Sep 25, 2012
14
Thanks for the suggestion, philba... unfortunately it is will be a compact device using the HM-11 BLE module as the central device, which means no microcontroller. True, it would have been really easy to set up using an ardiuno nano or similar. Have planned to use stainless steel probes to minimise the amount of oxidation from the galvanic action.
 

Alec_t

Joined Sep 17, 2013
10,592
Just to confirm, you want the LED to come on when the probes are dry?
Any idea of the likely inter-probe resistance that the soil (or whatever other medium) will present when wet and when dry?
Do you want to include a trimpot to adjust the threshold, or just try different fixed resistors?
 

philba

Joined Aug 17, 2017
960
You can program an ATTiny85 with an arduino. Smaller than the schematic you posted.

Also, I would look at using a comparator or opamp to do a non microcontroller based circuit. Very straightforward. Here's one example. I'd replace the 47K/10K divider with a trimmer pot to allow for adjusting the trip point. Also, I'd add hysteresis and a 100n bypass cap. The 358 could drive maybe a 10mA load (ie an led).
 

Alec_t

Joined Sep 17, 2013
10,592
The post #1 circuit periodically reverses the voltage across the probes, i.e they are driven with AC. This is a definite advantage, to reduce probe corrosion due to electrolysis. I have therefore retained this feature in the modified circuit below. A trimpot is included to allow adjustment of the switching threshold. Note that D1 is reversed compared to the post #1 circuit, and C5 has been increased to lower the LED pulse rate. The two transistors have been eliminated, as U1d can drive a LED directly.
DroughtSensor.PNG
 

Attachments

Thread Starter

richardperkin

Joined Sep 25, 2012
14
Thanks Alec! I could have spent months fiddling around in LTSpice trying to figure the circuit out for myself - I really appreciate the time and effort you've put into helping me out with this. Also very kind of you to provide the Spice file for your modified circuit above!
 
Top