Skip to main content

Soil moisture sensor (hygrometer) and KISS

I always tell everyone about KISS (keep it simple stupid). Do everything as simply as you can. If it can be simpler, make it simpler. Today, I realized I went overboard. I lied. Because today I connected flowers to an Arduino to see when they need watering. 

  • Red means it's dry and needs watering. 
  • Blue is okay. 
  • Green is all good. 

It's very easy to add a voice so the flower would speak from a speaker saying "water me." 
Or to add automatic watering so the water from a bottle would pour itself through a tube. Example here

But isn't that over-engineering?

And yet, I preach KISS... 😄













Demo (testing on Production Env 🙀):


Please share your thoughts. 
Would you want this in your home, or is it too much? 💦😂😍


Arduino Code:

int soilSensorPin = A0;
int soilMoistureValue = 0;

// RGB LED pins
int redPin = 13;
int greenPin = 12;
int bluePin = 11;

void setup() {
Serial.begin(9600);
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}

void loop() {
soilMoistureValue = analogRead(soilSensorPin);
Serial.print("Soil Moisture = ");
Serial.println(soilMoistureValue);

if(soilMoistureValue >= 1000 && soilMoistureValue <= 1023) {
Serial.println("Dry Soil");
setColor(255, 0, 0); // Set LED to red
}
else if(soilMoistureValue >= 500 && soilMoistureValue < 1000) {
Serial.println("Middle Wet Flower");
setColor(0, 0, 255); // Set LED to blue
}
else if(soilMoistureValue >= 0 && soilMoistureValue < 500) {
Serial.println("Wet, Everything is Good");
setColor(0, 255, 0); // Set LED to green
}

delay(1000);
}

void setColor(int red, int green, int blue) {
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}

Comments