In this tutorial we will take a look at how you can use soil moisture sensors with your Arduino board…
Click on video below for full tutorial…
Check us out on Facebook!
Parts list:
affiliate links
Arduino Code:
int soil;
#define led 13
void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
}
void loop() {
soil = analogRead(A0);
Serial.println(soil);
delay(250);
if (soil <= 500)
{
digitalWrite(led, HIGH);
}
else
{
digitalWrite(led, LOW);
}
}