Water Leak Detector Two Wires

Thanks for checking on this. I’m a beginner in electronics so I’m going by common sense a bit on this. Below is my code for the Argon, I have tested in different liquids and works great. Values are changing according to what I would expect. At the same time I’m not sure if I’m doing something “unsupported”.

int analogPin = A1;
int val = 0;          

void setup()
{
    pinMode(analogPin, INPUT_PULLDOWN);
    Particle.variable("Volt", val);
}

void loop()
{
    val = analogRead(analogPin);    // read the input pin
    Particle.publish ("val", String(val));
    delay(1000);
}

Tested on Argon, INPUT_PULLDOWN works great! air=0 , skin contact = 20-40, water=1900.
I have no need for the extra sensitivity 100k external pull down resister gives. This will simplify my moisture testing. Will have to test on soil next.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.