2
\$\begingroup\$

I am working with some cheap soil moisture sensors, as the ones on the picture below.

enter image description here

One of the problems of these kind of sensors is that they must not be powered on at all times. If you neglect to do so and leave them powered up at all times, electrolysis will take place and corrode the anode probe, thus releasing unwanted materials into the soil that you are probing.

To overcome this problem I intend to keep the board without power until the system needs to acquire new data.

This is the schematic of the board:

enter image description here

My question is, how much time after powering up should I wait before the voltage from the A0 output is stable?

The RC constant of the 51K resistor and the A0 capacitor is 5.1 ms. Should I at least wait 5.1 ms?

\$\endgroup\$
4
  • \$\begingroup\$ Actually, that's a 510k resistor and a 0.1 uF capacitor, giving a time constant of 51 ms. \$\endgroup\$
    – Dave Tweed
    Apr 2 '20 at 11:22
  • 1
    \$\begingroup\$ Wait 5 to 10 time constants for reasonable accuracy. \$\endgroup\$ Apr 2 '20 at 12:06
  • \$\begingroup\$ What will sample the A0 pin, what resolution ADC for example it has or what resolution you need? 5 time constants for being charged past 99% of the final value. \$\endgroup\$
    – Justme
    Apr 2 '20 at 14:57
  • \$\begingroup\$ @DaveTweed You are right, I was almost asleep when writing the question, thanks for letting me know. The RC time constant is 51 ms. As Brian Drummond commented, I think waiting for 5 time constants would make the trick, I' ll try to get some oscilloscope shots and update the post. \$\endgroup\$ Apr 3 '20 at 0:41
1
\$\begingroup\$

I would wait for 10ms, take multiple readings, check if they are stable (within a defined range) and average them to get the final reading.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You shouldn't just "take average" for the sake of it. You need to look at the expected noise before making a call like that: does it come in the form of short spikes or slow surges etc? Average/moving average is suitable to compensate for surges, not for spikes. \$\endgroup\$
    – Lundin
    Apr 2 '20 at 9:18
  • \$\begingroup\$ The cap needs longer to charge than 10ms. \$\endgroup\$
    – Justme
    Apr 2 '20 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.