Introduction
For the absent-minded green thumbs, you'll need to use one of these moisture sensors!
In this guide, you will learn how you can use a moisture sensor with an Arduino, to determine the amount of moisture in a substance.
After completing this guide, you could create an Arduino plant watering system or a simple moisture detector for your beloved garden plants.
Tools
-
-
-
-
-
-
int ledPin = 13; // Wet Indicator at Digital Pin D13 int sensor = 0; // Soil Sensor input at Analog Pin A0 int value = 0; void setup() { Serial.begin(9600); pinMode(ledPin, OUTPUT); Serial.println("SOIL MOISTURE SENSOR"); Serial.println("-----------------------------"); } void loop() { value = analogRead(sensor); value = value / 10; Serial.println(value); if (value < 50) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); } delay(1000); }
-