IOT based Irrigation System
IOT based Irrigation System
Description:
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>
int Relay =4 ;
int sensorValue;
void setup()
//Serial.begin(9600);
sensorValue = analogRead(sensorPin);
void loop()
sensorValue = analogRead(sensorPin);
Blynk.run();