0% found this document useful (0 votes)
14 views

IOT based Irrigation System

Uploaded by

Suba Selvi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

IOT based Irrigation System

Uploaded by

Suba Selvi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Automatic Irrigation System

Description:

To main objective is to implement an IoT based automatic plant watering


system using nodeMCU that senses the moisture level of the soil and gives a
notification to our smart phones whether the plant must be watered or not. Based
on the received notification we can turn ON/OFF the water pump from a remote
location with help of a mobile app (Blynk app).

Components Required:

 NodeMCU
 Soil Moisture Sensor
 Water Pump
 Relay
 Breadboard
 Jumpers

Software Required:

 Arduino IDE
 Blynk app

Procedure:

1. Connect the Vcc, Gnd and A0 pins of the soil moisture sensor to the Vcc
Gnd and A0 pins of the NodeMCU respectively using jumber wires.

2. Connect any one of the digital pins of Arduino (say D4) to the input pin
“in” of the relay.
3. Connect the Vcc and Gnd of the relay to a 5V supply.
4. Now connect one of leads of the water pump to the relay’s CC and the other
to a 12v supply.
5. The relay’s SC is connected to the ground wire of the 12v supply.
6. On your smart phones, install Blynk app and register.
7. Create a new project, Give a name Select Hardware module as
“NodeMCU” Connection type as “Wifi”.

8. By swiping the screen on the new project window, will open the widget
window. Select two widgets a button and a notification widget.
9. Press the button widget, set the pin option as D4 (the digital pin connected to
the relay) and Press the notify widget and set pin as V5 (virtual 5).
10. Now load the following Arduino code to the NodeMCU module using the
USB cable by specifying the proper port and board type in the Arduino IDE.

Code:
#include <Wire.h>

#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

char auth[] = "###########"; //authentication code received from Blynk

char ssid[] = "#######"; //wifi name

char pass[] = "##########";//wifi password

int Relay =4 ;

int thresholdUp = 250;

int sensorPin = A0; //output ADC pin

//int sensorPin = D4;

int sensorValue;

void setup()

//Serial.begin(9600);

Blynk.begin(auth, ssid, pass);

BLYNK_READ(V5) //Blynk app has something on V5

sensorValue = analogRead(sensorPin);

Blynk.virtualWrite(V5, sensorValue); //sending to Blynk

void loop()

sensorValue = analogRead(sensorPin);
Blynk.run();

if (sensorValue <= thresholdUp)

Blynk.notify("No Needs to water");

else if(sensorValue > thresholdUp)

Blynk.notify(" Need to water");

You might also like