Soil detection module w/o MCU? - Page 1
Forum section: electronics / projects

author: kalel
author_rank: Frequent Contributor
timestamp: September 13, 2017, 08:12:54 pm
content: There are these really cheap hygrometer modules, but adding an Arduino/MCU to each (or relatively long cabling) might not be optimal for me.Most of these claim to have a digital output and not just analog one. There's a potentiometer too, possibly threshold adjustment. Since the output is already digital, could I (perhaps even directly) simply wire an LED and a resistor to the digital output?Or if the output current on the digital port is too low for a few mA (I guess 4-5 mA or maybe even less might be enough to indicate), the signal would go to a transistor which would power the LED.There's very little information on most eBay pages about the circuit. One description mentions this:QuoteI have found this datasheet from a manufacturer:http://pdf.datasheetcatalog.com/datasheet/BayLinear/mXtvuyw.pdfAnd it says that high-level output current is max 50nA.Will that also be the maximum load of the circuit digital out?If so, definitely some amplification would be needed, 100000 times for 5mA? If any of that is anywhere near correct, I probably need to find a cheap mosfet, or maybe link 2 or more NPNs (might be cheaper + unlike mosfets, I actually have some of those).It wouldn't hurt to understand things a little bit better.

author: sanwal209
author_rank: Regular Contributor
timestamp: September 13, 2017, 09:25:39 pm
content: You can use this circuit in the attachment.

author: Ian.M
author_rank: Super Contributor
timestamp: September 13, 2017, 10:44:45 pm
content: DC excited direct contact soil hygrometers simply are not durable unless they have non-reactive noble metal or solid graphite electrodes. The excitation current causes the positive electrode to be etched away, and if it is composed of a tinned PCB track like the one illustrated above, with maybe 0.1 sq in area and 1 Oz copper thickness, as little as 15 Coloumbs of charge (current x time) could totally dissolve it. Failure could be much earlier as there is a high risk of increased etching at the soil surface in damp conditions. At 1mA sense current expect a lifespan of at most several hours, at 1uA, you'll probably get a month or two.At the very minimum you need to use AC excitation, either transformer or capacitor coupled so there is no DC leakage, at a high enough frequency to limit copper and tin ion mobility, so metal atoms eroded during one half-cycle of the excitation signal plate back onto the electrode in the next half cycle, but ideally you would use a capacitive or inductive non-contact sensor that senses the increase in the dielectric losses due to the soil moisture.

author: kalel
author_rank: Frequent Contributor
timestamp: September 14, 2017, 09:59:32 am
content: Thanks, I did not think much about the effects of DC and moisture (I thought the module makes figured it out - or copied a way that works).This is more for MCU usage or other latching circuitry, would it not be enough to send a short pulse (just enough to make the comparison) each half a minute or a minute or so?That way, there's no constantly flowing current through the electrodes, and one minute of current constantly going through them could equal a lot more minutes in pulses, electrode dissolution-wise.Of course AC or other material electrodes as you mentioned make probably the best solution for such issues.

author: Ian.M
author_rank: Super Contributor
timestamp: September 14, 2017, 10:36:51 am
content: Unless you are in the process of watering, soil moisture isn't going to change significantly over a ten minute period. The sensing circuit will take a little time to stabilise, but it should be possible to reduce the average current by a factor of 1000, extendong the sensor life proportionately. However the complexity is now creeping up - Implementing the required feature set without a MCU would be difficult, and if you are going to add a MCU, you might as well build your own AC excited sensor.I found a schematic for the type of sensor you showed above. There's really not much to it and the 'AC' analog output s just the unbuffered sensor connection.You might find this old topic interesting:https://www.eevblog.com/forum/projects/reliable-way-of-measuring-soil-moisture/

author: kalel
author_rank: Frequent Contributor
timestamp: September 14, 2017, 11:09:02 am
content: Making a further search for available sensors, I was able to find:- These "corrosion resistant" probesThey also gave a diagram for connecting things:But it also uses DC and I couldn't tell what the corrosion resistant material is, could be graphite maybe?That's up to 10 times more expensive than the cheap, quickly dissolving solution. 5pcs of the corroding probes are about $3, and they mentioned 12 months usage each (probably the best case scenario, plus they mention surface gold plating but I'm not completely sure if I can see it on those pieces). So 5 years in the best case scenario, maybe a year or two years is more realistic (I wouldn't know the actual duration). Also, I'm not sure how the corroded metals could impact the plant itself.

author: Ian.M
author_rank: Super Contributor
timestamp: September 17, 2017, 03:47:42 am
content: You need AC excitation and stainless steel probes. If you stick to the two rod design, 4 or 5 mm rod clamped in a large 'choc block' connector would do for a cheap probe. A better quality one would involve threading the end of the rod so the connection can be made with two nuts, a shakeproof washer and a crimp ring terminal, then potting that in epoxy. Connect a resistor between an Arduino PWM pin and an ADC pin, and from the same pin, a large non-electrolytic series capacitor to one side of the probe, then the other side of the probe via another capacitor to Arduino ground. Set up the PWM for a squarewave of several KHz frequency. The ADC sampling must be synchronous to the drive signal, ideally just before the PWM goes low, but in practice it should be OK to sample it immediately after it goes low, so triggering it from the PWM ISR would be possible. A better option would be to use ADC auto-trigger on timer rollover, set the pin by compare match, and reset it in the ADC conversion complete ISR.A pure hardware solution would use a quad OPAMP or comparator - one section as an oscillator, driving a bridge with the sensor capacitively coupled as above, then the signal processing depends on whether you want an analog or a digital output - either stretch the pulses so it stays low for a whole cycle of the oscillator if the soil conductivity is high enough, or a precision rectifier and low pass filter circuit for analog output.

author: kalel
author_rank: Frequent Contributor
timestamp: September 19, 2017, 02:23:23 pm
content: I doubt there's much of a cheap module for an AC excited system (they could make one if they wanted to - somewhat more expensive but still cheap).There might be some AC signal generator modules, however, which might be usable. But the comparison circuitry would still need to be custom (well, unless there's a fit for purpose comparison module).I guess in most cases (especially if done cheaply), doing this properly needs to be a custom solution and is not as simple as these DC modules make it seem.

author: cstratton
author_rank: Regular Contributor
timestamp: September 19, 2017, 02:32:53 pm
content: Probe concerns apart, you should be using a microcontroller for this, but not a full-sized Arduino. A MCU is an IC - you seem to be thinking about the board you've seen it on, not the chip itself on a more suitable board.The ATmega chip from an Arduino is a reasonable choice, or something like an ATtiny if the need is limited. There are also plenty of cheap, small ARM parts, and viable members of the PIC and MSP430 lines too.If you need to run on battery power you would need to optimize the circuit for that - ideally no regulator, no constant-on LED, no signals asserted against pulling resistors, slow internal clock, etc.If you want to stay with the Arduino concept the non-USB pro mini style boards are cheap and fairly small, though will need some modification for power concerns and you'll need to put them in some sort of enclosure (small wide mouth bottle??)

author: zeqing
author_rank: Regular Contributor
timestamp: September 21, 2017, 03:27:06 am
content: for the soil moisture sensor, there are mainly 2 ways: resistor and capacitor. the product you mentioned is based on resistor, really cheap, that changes the currently and finally changes the output voltage. it is just for a moisture reference . the "digital" only means "0" or "1" , you can adjust the threshold by adjusting the potentiometer. more reilable solution is the capacitor measuring, but the price more expensive. i have a store that list them the advantage and disadvantage, the the spec:https://www.makerfabs.com/index.php?route=product/search&search=soil