rjconcepcion
Published © CC BY-NC-ND

Soil Moisture Tester

Check your plants soil moisture with this simple tester. You will know if you need to water your plants.

BeginnerProtip1 hour1,869
Soil Moisture Tester

Things used in this project

Hardware components

Arduino Uno
×1
Soil Moisture Sensor FC-28
×1
Breadboard (Generic)
×1
Resistor 330 ohm
×3
Red Led (Generic)
×1
Green Led
×1
Yellow Led
×1
cable jumpers
×1
Power bank (opcional)
×1
Breadboard Jumper Wire
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic

Code

Soil moisture terter code

Arduino
// Soil moisture tester

// Set leds numbers
const int verde = 8;          
const int amarillo = 9;
const int rojo = 10;

// Set analog input
const int sensor = A0;

// Variable to store moisture value
int humedad = 0;

void setup() {
  
  //Set name as outputs
  pinMode(verde, OUTPUT);
  pinMode(amarillo, OUTPUT);
  pinMode(rojo, OUTPUT);

}

void loop() {

  humedad = analogRead(sensor); //take the lecture from the sensor

  if(humedad < 300) {             // If the moisture value is less than 300 lights on green led and turns off others.
    digitalWrite(verde, HIGH);
    digitalWrite(amarillo, LOW);
    digitalWrite(rojo, LOW);
    delay(1000);
  }

  else if(humedad > 300 && humedad < 600){    // If the moisture value is more than 300 but less that 600 lights on yellow led and turns off others..
    digitalWrite(verde, LOW);
    digitalWrite(amarillo, HIGH);
    digitalWrite(rojo, LOW);
    delay(1000);
  }

  else {                                    // Any value more than 600 lights on red led and turns off others.
    digitalWrite(verde, LOW);
    digitalWrite(amarillo, LOW);
    digitalWrite(rojo, HIGH);
    delay(1000);
    
  }
  delay(1000);    //Retardo de 1 segundo antes de iniciar el ciclo nuevamente.

}

Credits

rjconcepcion

rjconcepcion

11 projects • 8 followers
Electronic is my passion. I like to work with programming devices like Arduino, ESP8266, Raspberry Pi. I enjoy design electronic projects.

Comments