SIMPLE SOIL MOISTURE SENSOR – ARDUINO PROJECT
Posted by P. Marian in Arduino | 2 comments
The other method to find the resistor’s value is to try different values or use a potentiometer. Insert the probes into the soil that has the desired moisture when to light up the LED and signal that the plant needs water.
Adjust the potentiometer and see the point at which it starts to light. Measure the potentiomenter current value and replace it with a fixed resistor.
Arduino soil moisture sensor schematic
Project source code
const int VAL_PROBE = 0; // Analog pin 0
const int MOISTURE_LEVEL = 250; // the value after the LED goes ON
void setup() {
Serial.begin(9600);
}
void LedState(int state) {
digitalWrite(13, state);
}
void loop() {
int moisture = analogRead(VAL_PROBE);
Serial.println(moisture);
if(moisture > MOISTURE_LEVEL) {
LedState(HIGH);
} else {
LedState(LOW);
}
delay(100);
}
Source (romanian): http://www.tehnorama.ro/cum-sa-faci-o-floare-sa-te-traga-de-maneca-atunci-cand-ai-uitat-sa-o-uzi/
