This is just a very minimal example on how to use these kind of sensors. I just read a value from an analog pin every 2 seconds and print it out to serial.

These sensors are available very cheap online and are easy to use... So, now my plants go online... :)

water sensor houseplants arduino

My code:

const int analogIn = A0;

int sensorValue = 0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  sensorValue = analogRead(analogIn);
  Serial.print("Sensor: ");
  Serial.println(sensorValue);
  delay(2000);
}

And now to something completely... Need to learn how to add a ground plane in Eagle... ;)

Posted in: arduinodiyelectronicsopensource

Tags:  arduino,  water,  sensor,  analog,  digital,