Things used in this project

Schematics

Rain sensor
Rain sensor module arduino hookup

Code

Smart GardenArduino
#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

11705524 10207718519433933 871861552687634133 o
Kaustubh Agarwal

IOT Enthusiast

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Biped Arduino Robot
Easy
  • 3
  • 1

Full instructions

Most simple handy robot in about 2 hours!

Ultrasonic sensor with blynk and NodeMcu
Easy
  • 209
  • 4

Protip

Interfacing ultrasonic sensor with NodeMcu and displaying the distance in the blynk app

MyHumidity controlled by BME280 and Photon
Easy
  • 58
  • 2

Full instructions

Checks if humidity threshold is reached and informs the user by using Blynk/IFTTT-services with softAP integration.

Arduino - Have Fun with Color Sensor
Easy
  • 725
  • 12

Full instructions

This project shows how to change color of Minion using Arduino, PHPoC WiFi Shield and color sensor.

Arduino - Web-Based Thermometer
Easy
  • 774
  • 12

Full instructions

This project allows you to check temperature at home from anywhere using web browser.

Electronic Voting Machine Using Arduino
Easy
  • 187
  • 5

It is an EVM using Arduino. There are five switches in all, assigned for various activities.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login