Kaustubh Agarwal
Published © GPL3+

Rain Warning Display on Mobile for your Home Garden

A system that warns for unexpected rains to help out your garden. The system displays real time values on mobile.

EasyShowcase (no instructions)1 hour6,238
Rain Warning Display on Mobile for your Home Garden

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×4
rain sensor
×1

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk

Story

Read more

Schematics

Rain sensor

Rain sensor module arduino hookup

Code

Smart Garden

Arduino
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <SimpleTimer.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "";


WidgetLCD lcd(V1);   // LCD Widget
int nRainIn = A1;
int nRainDigitalIn = 2;
int nRainVal;
boolean bIsRaining = false;
String strRaining;


void setup() {
  Serial.begin(9600);
  Blynk.begin(auth);      // Start Blynk server
  pinMode(2,INPUT);
  while (Blynk.connect() == false) {
    // Wait until connected
  }
}
void loop() {
   Blynk.run();
  
  nRainVal = analogRead(nRainIn);
  bIsRaining = !(digitalRead(nRainDigitalIn));
  
  if(bIsRaining){
    strRaining = "YES";
  }
  else{
    strRaining = "NO";
  }
  
  Serial.print("Raining?: ");
  Serial.print(strRaining);  
  Serial.print("\t Moisture Level: ");
  Serial.println(nRainVal);
  Blynk.virtualWrite(3, nRainVal);
  lcd.clear();
  if (nRainVal< 550)
  {
       lcd.clear(); //Use it to clear the LCD Widget
  lcd.print(4, 0, "Raining"); // use: (position X: 0-15, position Y: 0-1, "Message you want to print")
  lcd.print(4, 1, "Heavily!"); }
  if (nRainVal> 700 && nRainVal < 900)
  {
      lcd.clear(); //Use it to clear the LCD Widget
  lcd.print(4, 0, "Rain"); // use: (position X: 0-15, position Y: 0-1, "Message you want to print")
  lcd.print(4, 1, "Warning!"); } 
   
  delay(200);

}

Credits

Kaustubh Agarwal

Kaustubh Agarwal

14 projects • 144 followers
IOT Enthusiast

Comments

Add projectSign up / Login