[SOLVED] how long does it take for pins to go high?

Hi,

Just for fun, I'm building a soil moisture sensor using two nails. Somewhere it was suggested to only apply voltage to the nails when actually taking a reading, to avoid corrosion of the nails. So I'm first setting a digital pin high to provide the 5V, then take the reading. Now I noticed that the readings I get are not accurate until 2-3 seconds after setting the pin high, which made me wonder: how long does it take for a pin to get to a (stable) 5V? Does it bounce about a bit before settling at 5V?
I couldn't find any documentation on that, at least where I looked.

Many thanks!
Jesse

with digitalWrite: a few microsecods.. stray C may make it need anoter ms to settle, but:
This is not your problem!
The chemistry is the soil and connection to your nail is why you see the 'delay'

Hi Knut,

That's an angle I hadn't though of taking yet, good point! It will take some time for the current to start flowing fully between the nails through the soil then I guess?
I will repeat this with a known resistor between the nails and see what comes out.

Thanks!
Jesse

Yep that did it! Great, that was really helpful!