But I could not create code to run it, do not know if it's the connection or even the code or who knows if both schema eletricoquanto code is wrong.
I want a sample code and the electric scheme.
The sensor is made with a comparator that is ment to give a digital output.
You should tune the onboard restistor to a level that switch 'when too dry)
Try this prog
void setup()
{
pinMode (A0,INPUT_PULLUP); //same pin as list time... can be any I/O pin except 13
pinMode(13,OUTPUT); // onboard led
}
void loop()
{
digitalWrite(13,digitalRead(A0));
}
You shoud be able to switch led on/off by connection the two rods with wet fingers.
..tune the pot to find suitable switchposition..
void setup()
{
pinMode (2,INPUT_PULLUP); //same pin as list time... can be any I/O pin except 13
pinMode(13,OUTPUT); // onboard led
}
void loop()
{
digitalWrite(13,digitalRead(2));
Serial.println(digitalRead(2));
}
void setup()
{
pinMode (2,INPUT_PULLUP); //same pin as list time... can be any I/O pin except 13
pinMode(13,OUTPUT); // onboard led
Serial.begin(9600); // set serial window to same speed
}
void loop()
{
digitalWrite(13,digitalRead(2));
Serial.println(digitalRead(2));
delay(1000); // not to run too fast in window (will show 1, I guess)
}
It looks correct. Should now be possible, with the onboard potensiometer, to adjust so switchpoint is at suitable humidity
(..if the card has been fed incorrectly, it may even be possible that the opamp is 'RIP')
(I'd check around with a multimeter at the opamps pins. You got the full schematic)
The output of the code is: 0 Maximum in potentiometer
Output 1: to minimum.
If I wet the sensor, nothing happens, it amounts to no light, no minimum or maximum for adjusting the potentiometer.
And now?
when the extreme points at pot changes output, it tells me that the comparator is OK
"Wet pins" means that current can flow between them : e.g. :
they are put into moist soil, into salty water or you press your wet fingers over both pins.
At some position of pot, you shoud be able to change output with "connection" activated/deactivated.
I found this schematic, but it doesn't fit 100%. http://m2.img.dxcdn.com/CDDriver/sku.200142.jpg
A0 is not at pin, but gnd is. I believe this is the correct diagram.
Got a 10k resistor? Connecting that between pins will split 5V to match a point of change near middle position on potmeter
Attached: your sensor.
Try: Disconnect sensor and put a resitor between those two pins (range 1k..100k)
(the voltage divider you make, will result in a voltage at positiv input of amplifier)
use pot to change voltage at negativ input.
Output is high when (voltage at +) > (voltage at -), else low.