Water Now

Made by meilinz

This is an IoT device to remind my dad watering my mom’s plants when she is not at home. It works by detecting moisture in the plant soil. If there is sufficient soil water, all 3 LEDs will keep lighting. As soil water becomes more and more insufficient, the LEDs will fade away. And if the plants are out of water, there will be only one LED light and IFTTT will immediately send out a SMS message to my dad. Also there is a switch to disable/enable the soil moisture.

0

Problem Statement

People often forget to water their plants and feel self-condemened when watching their beloved plants dead. Or gardening beginners have to experience failure several times until he/she understands how much water is enough. My initial idea was to create a watering reminder for my dad but this device could help every "green-lovers" to water plants in time or to stop watering when enough.

0

Goal

The device will have the ability to detect the exactly moisture level in soil so that it could distinguish whether water is needed or too much. Users could not only tell the changes of soil moisture from 3 LEDs, but also they will get an immediately SMS message  from IFTTT when their plants are thirsty. It should be connected to the Internet as an IoT device so users could get alert remotely and ask their family or friends to help watering when they are not at home.

0

Process

This device is built upon the Particle Photon micro-controller. 

0

As below flow charts show, I started with connecting soil moisture sensor, switch and the LED which tell the switch status.

0

Then I finished with adding 3 LEDs to the circuit. With my coding, this circuit should work like this: when the soil moisture reaches a high level, all 3 LEDs will light up; when the soil moisture falls a low level, only 1 LED will lights up; and 2 LEDs will light up in these levels between.  

0

  • When coding, I searched online to get the information about the reading levels of soil moisture sensor. 
  • After coding compiled and water added, the reading from soil moisture sensor floated among 1-3, which really confused me, so I:
  1. checked the whole circuit again and asked help from classmates, turning out nothing wrong with it;
  2. replaced the soil moisture sensor with a LED to see whether there is something wrong with the sensor, and the LED didn't light up;
  3. checked the switch...Bingo! It had a poor contact!
So I had to hold the switch all the time during running the program to keep contact.

0

Outcome

The following is the completed final circuit.

0

The following is the completed final code.

0
int sensorPin = A0;
int thresholdUp = 3000;
int thresholdDown = 350;

int LedPin1 = D0;
int LedPin2 = D2;
int LedPin3 = D4;



void setup(){
  Serial.begin(9600);
  pinMode(sensorPin,INPUT);
  pinMode(LedPin1, OUTPUT);
  pinMode(LedPin2, OUTPUT);
  pinMode(LedPin3, OUTPUT);


  Particle.subscribe ("SoilStatus",sensorPin);


}


void loop(){
  int sensorValue = analogRead(sensorPin);
  Serial.println("\nSensor Value: ");
  Serial.print(sensorValue);
  if (sensorValue <= thresholdDown){
    digitalWrite(LedPin1, HIGH);
    digitalWrite(LedPin2, LOW);
    digitalWrite(LedPin3, LOW);
    Particle.publish("SoilStatus","Dry! Water me!",60,PUBLIC);


  } else if (sensorValue > thresholdDown && sensorValue < thresholdUp){

     digitalWrite(LedPin1, HIGH);
     digitalWrite(LedPin2, HIGH);
     digitalWrite(LedPin3, LOW);


  } else if (sensorValue >  thresholdUp){

     digitalWrite(LedPin1, HIGH);
     digitalWrite(LedPin2, HIGH);
     digitalWrite(LedPin3, HIGH);

    
  }
    delay(5000);
}
Click to Expand
0

The following is the bill of components:

  • A particle photon
  • A SparkFun soil moisture sensor
  • A switch
  • 4 1kΩ resistor
  • 4 LEDs
  • 13 jump wires

0

Video Show Time!

0
WATER or NOT?
Meilin Zhang - https://www.youtube.com/watch?v=c12R0QC7Lrs
0

Reflection

The process of making this project is a torture but full of FUN! I am new to circuit and programing so everything I have to learn from the ground up. But this is really a great chance and I enjoyed a lot! It's so amazing when you go through squeezing your head to making objects "alive"--light, sound, etc. Step by step, it's easy, complex and fun!

x
Share this Project


About

This is an IoT device to remind my dad watering my mom’s plants when she is not at home. It works by detecting moisture in the plant soil. If there is sufficient soil water, all 3 LEDs will keep lighting. As soil water becomes more and more insufficient, the LEDs will fade away. And if the plants are out of water, there will be only one LED light and IFTTT will immediately send out a SMS message to my dad. Also there is a switch to disable/enable the soil moisture.

Created

January 26th, 2017