Go Down

Topic: Garduino data output problem (Read 3 times) previous topic - next topic


Jan 29, 2011, 08:24 am Last Edit: Jan 29, 2011, 08:43 am by Graynomad Reason: 1
When inserted in the ground the two nails have a certain resistance between them (created by the soil). This and the actual resistor you have form a "voltage divider" and you are reading at the point between these two resistors.

The value you read will change if either of the resistors does, therefore as the soil changes it's resistance (wetness) the value you read also changes.

Now if you are just touching the two wires together the value is driven directly to 5v, you no longer have a voltage divider, just a pull down resistor and a wire connected to 5v.

So the ADC will read the max value, ie 1023.

To simulate the soil get another resistor (or better still a pot, that's potentiometer, not a pot of soil) and connect that to 5v where the nails should be. If using a pot turning the knob should give you different readings.


Rob Gray aka the GRAYnomad www.robgray.com


What value resistor are you using? I imagine that soil would have a very high resistance, so a 10k resistor might not give you the accuracy or range you want.


Jan 29, 2011, 04:56 pm Last Edit: Jan 29, 2011, 04:59 pm by futonsnstuff Reason: 1
I am using a 10k resistor, as you said. This was the value I was told to use in the instructions.

So currently, what is my best plan of action in order to get this to work? I will try replacing the nails with a separate resistor.


If you have a multimeter, find the resistance of the two  probes while they are in the soil. Tell us that number.


Okay, I have found the problem I was having. It turns out the wires I was using were faulty.

Now, I am getting correct readings from my probes, but there is another small hitch.

Once the serial monitor gives me one reading, it stops. It shows no additional readings.

How would I need to modify the code so it consistently takes readings every few seconds?

Go Up