Hey Wildbill, as you know, I'm new to this realm of coding. Just wanting to verify I'm correct in my assumption: the higher the number, the less resistance? (in effect we are measuring the flow, not the lack of flow, correct?)
It depends how your voltage divider is wired - how have you set it up?
I have a 10k ohm resistor connected to 5V and the AI-0 wired past the resistor. Is this efficient/the best option?
Michibacy: I have a 10k ohm resistor connected to 5V and the AI-0 wired past the resistor. Is this efficient/the best option?
I've no opinion about which way up is better; the way you have it, the more moisture there is, the less resistance and the lower the value you will get from analogRead.
Ok, how would I go about changing it to do lower value=lower moisture?
Switch your voltage divider around and attach the 10K resistor to ground. Or do it in software and subtract whatever reading you get from 1023 before you use it.
Thanks! I'll change over the resistor, a hardware swap at this point is more plausible than a software swap. (boy that does sounds bass ackwards don't it?)
Changed over the resistor and it's working seamlessly. Is there a way to utilize the ICSP for the lcd display? Also, what will be the most cost effective option? At this time (version 1.1) I can utilize the digital out pins if that is cheaper (from what I've read it is). I have a project box I plan on using that is 4.3"x3.2"x1.6", is there a display you would suggest (brand or model) that would fit within this box? thanks!
Also, I'm working on making an economy version as well that doesn't have an LCD read out, rather has series of LED's that blink if the moisture level is too high, low or "just right". I think that code is rather easy to come up with but I'll be back if I need help :) thanks a ton for all your help!
At it again: new question:
Is there a way to mount a potentiometer that once turned, will adjust the delay value in the following code? (The user would rotate the knob to increase the Tx frequency, to reflect changes in speed)
Serial.print("Moisture Sensor: "); int MoistureReading=analogRead(0); Serial.print(MoistureReading); delay(529);