Wednesday, 9 November 2016

Arduino moisture sensor value decreasing for no reason


I'm not sure what happened but all of a suden the moisture sensor I bought is acting strange. When I place it in soil and measure the value once per second, it decreases in value pretty quickly about 3 points downwards every 5 seconds.


When I am holding the sensor in the air, it reads 1023. When I put it in water, it reads around 400. When I place it in soil, it starts at about 700 and then starts decreasing, meaning it is getting wetter. How can that be possible if I didn't water the soil? Something is happening with it.


EDIT: Upon just jiggling the wires that connect the moisture sensor to the arduino...the values jumped down about 50 points. Jiggling more makes it jump around more. Is that normal?



Answer



That active aspect of that sensor looks like plain-old HASL (hot-air solder leveled) FR4 PCB.


enter image description here


Basically, that construction is pretty much never going to be that reliable. Aside from the fact that the FR4 material itself will absorb water and change it's internal leakage, you're going to have all sorts of fun electrochemical corrosion issues with the electrode surfaces, particularly if you leave the sensor powered.


Basically, that sensor works by measuring the resistance between the two "pins" of the PCB stake.

It does this by applying a voltage across the pins, and measuring the current flow.


However, this is also going to lead to the metal from one of the pins being eaten away by galvanic action.


Basically, that sensor is a toy. It's not useful in any real application.




If you want to squeeze as much life out of the thing as possible, there are a few things you can do.



  1. DO NOT leave the sensor powered. When you want to take a reading, power the sensor for maybe a few seconds, and take your readings. Then power it off again. Don't take readings too often.

  2. Periodically reverse the pins of the electrical connection between the readout board and the "stake" board. Since only one terminal will be eaten away at a time, this should spread the decay out a bit.

  3. Be aware that ANY mechanical disturbance of the "stake" board will probably cause a large shift in readout value. Your "jiggling the wires" causing a shift in values probably came from the mechanical force transmitted to the PCB through the wiring.



Proper systems for this sort of thing use a AC bias on the sensor, which minimizes galvanic corrosion, but there aren't any easy ways to hack something like that in to this device.


Real soil moisture sensors are capacitive, and therefore immune to the corrosion issue, but that much more complex and expensive.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...