2

I have one of these ubiquitous soil moisture sensors:

sensor

The only information I can find is that it operates from 3.3V to 5V, uses an LM393 to trigger a digital output and also exposes an analogue reading.

I'm intending to hook it up to a low power PIC (actually a PIC16LF1554 ) and want everything to remain sleeping until I periodically read the sensor from the analogue output. So, I'll power the sensor, take a reading through ADC and the power it off again.

Trying to keep everything as small as possible, with minimum components, I'm considering powering the sensor from a spare PIC pin, which I know will source/sink 25mA maximum. So I'll just drive the pin high to power up, take a reading then drive the pin low again.

How can I find out what current the sensor assembly will draw so I don't risk overloading the PIC pin? If I hook my (cheap) DMM in series with the sensor when powered from 3.3V standalone, the power LED on the sensor doesn't light up and the meter shows zeroes on the lowest range (2000uA). So I can't tell what it draws when it's working normally.

Do I need a better DMM or is there some other way I can see if I need to power this via a transistor (or some other way)?

Roger Rowland
  • 2,002
  • 4
  • 18
  • 36
  • Usually people that sell stuff provide you with datasheets... But for that small circuit it should not be hard to reverse engineer it and calculate/simulate yourself – PlasmaHH Dec 23 '14 at 16:53
  • You don't even need that circuit. You just need the probe and a single resistor. The probe acts like a resistor itself - use a second to create a voltage divider, then measure the midpoint voltage with a PIC ADC. – Majenko Dec 23 '14 at 16:56
  • @Majenko Thanks - I did wonder if I needed that circuit if all I wanted was the analogue reading, but still not sure how I can safely power it from a PIC pin. Do I simply choose a second resistor to limit to 25mA (assuming the sensor is shorted)? – Roger Rowland Dec 23 '14 at 16:59
  • @RogerRowland Are you sure you're using the DMM correctly? Have you got the lead in the current-measuring socket, not the voltage-measuring socket (if it's that type of DMM)? – John Honniball Dec 23 '14 at 17:42
  • @JohnHonniball Yes, it's in the right socket, there's one for high current but this one is marked VmAOhm, but I tried both anyway. – Roger Rowland Dec 23 '14 at 19:49
  • @RogerRowland Well, that's a puzzle then, because the LED should light when the meter is in the circuit. Current should flow through it and power the circuit as usual. – John Honniball Dec 24 '14 at 09:25
  • @JohnHonniball Yes, that's what I thought. If I take the meter out of circuit and short the wires instead, the LED lights up. Maybe the DMM is just too cheap (~£10) or it's dropping too much voltage for the sensor circuit to operate? It says it needs 3.3V to 5V, and I am giving it 3.29V (as measured from the power supply). – Roger Rowland Dec 24 '14 at 09:41
  • @RogerRowland It's possible that an internal fuse has blown. Can you test the meter by using it to measure the current of, say, another LED? Just wire up a LED, resistor and PSU and see if the LED lights and the meter can give you a reasonable reading. – John Honniball Dec 24 '14 at 11:18
  • @JohnHonniball Ok, I'll do that as soon as I get home (still at work at the moment...sigh) – Roger Rowland Dec 24 '14 at 11:20

1 Answers1

3

The best way to know what the current draw can be is to consult the datasheet. If that is not available, and this is for production, go get something that does have a datasheet.

You can also just measure the current. However, keep in mind that only tells you what that unit draws on that day at that temperature.

However, looking at the bigger picture, what's the point of embedding someone else's unit into yours? The circuit for a moisture meter is very simple, and is probably easier to incorporate into your own product than to try to embed someone else's. Also, there are a lot of bad ways to try to measure resistance between electrodes. Something that doesn't come with a datasheet doesn't inspire confidence that someone that actually knew what they were doing designed the unit. Since it appears to be just a simple analog circuit, it is quite unlikely to be using a good technique.

The best method pretty much requires a microcontroller doing a 4-phase measurement. I discuss it in the context of detecting water, but the principle is the same. See https://electronics.stackexchange.com/a/33938/4512, https://electronics.stackexchange.com/a/103330/4512, and https://electronics.stackexchange.com/a/28485/4512.

Olin Lathrop
  • 310,974
  • 36
  • 428
  • 915
  • Thanks - this is a hobby project and there is no datasheet - at least none that I can find. I'll take a look at your links .... – Roger Rowland Dec 23 '14 at 17:01