How to make a plant watering system with the Nodemcu ESP8266 board and the new Blynk update

How to make a plant watering system with the Nodemcu ESp8266 board and the new Blynk update

Hello and welcome back. In this tutorial, we will learn how to make a plant watering system with the Nodemcu ESP8266 board and the new Blynk update. For that, I mainly used a soil moisture sensor and a relay module. We can get the moisture values ​​using the soil moisture sensor and we can control the water pump using the relay module. In this project, I used a mini water pump as an example. But, you can connect any other water pump AC or DC. It depends on your requirements. (Please use a relay with more amperage than the water pump and be careful when using AC electricity)

(adsbygoogle = window.adsbygoogle || []).push({});

Also, we can control and monitor this system on our smartphone or computer using the Blynk platform from anywhere in the world. I think this is a low-cost project, but more helpful for our home garden, small greenhouses and etc. So, why wait, let’s do it. SriTu Hobby will guide you step by step for that.

  • If you want to do it using the old Blynk app – Click me

Ok, let’s do it step by step. The required components are given below.

Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.

(adsbygoogle = window.adsbygoogle || []).push({});

Other components

Step 1

Firstly, identify these components.

(adsbygoogle = window.adsbygoogle || []).push({});

Step 2

Second, place the Nodemcu board on the breadboard and connect the VIN and GND pins to the breadboard.

Step 3

Thirdly, place the soil moisture sensor on the breadboard and connect it to the Nodemcu board. For that, use the circuit diagram below.

How to make a plant watering system with the Nodemcu ESp8266 board and the new Blynk update
(adsbygoogle = window.adsbygoogle || []).push({});

Step 4

And then, connect the LCD display and relay module to the Nodemcu board.

Step 5

Now, let’s create the Blynk web dashboard for this project. For that, follow the steps below.

  • First, go to the Blynk website and create a new account using your Gmail address. And then, sign in to your account and click the new Template button. Next, enter your project name as you like and click the done button.

(adsbygoogle = window.adsbygoogle || []).push({});
  • Now, click the “Datastreams” tab and create two data streams for that. Use the information below.
  • Virtual PIN –> Name – Moisture value / PIN — V0 / MIN — 0 / MAX — 100
  • Virtual PIN –> Name – Water pump / PIN — V1 / MIN — 0 / MAX — 1

(adsbygoogle = window.adsbygoogle || []).push({});
  • Next, click the “Web dashboard” tab and include the one button and one Gauge widget to the dashboard. And then, arrange these widgets as you like.

  • Now, click the one-by-one settings buttons on these widgets and select the data streams we created earlier. After, click the save button.

  • Now, click the search icon button and create a “New device”. For that, select the template you created earlier.

(adsbygoogle = window.adsbygoogle || []).push({});

OK, the Blynk web dashboard has been created.

Step 6

Now, connect this project to the computer, and let’s upload the program for this project. It’s as follows.

/*Plant watering system with new blynk update
Home Page
*/ //Include the library files #include <LiquidCrystal_I2C.h> #define BLYNK_PRINT Serial #include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h> //Initialize the LCD display LiquidCrystal_I2C lcd(0x27, 16, 2); char auth[] = "";//Enter your Auth token char ssid[] = "";//Enter your WIFI name char pass[] = "";//Enter your WIFI password BlynkTimer timer; bool Relay = 0; //Define component pins #define sensor A0 #define waterPump D3 void setup() { Serial.begin(9600); pinMode(waterPump, OUTPUT); digitalWrite(waterPump, HIGH); lcd.init(); lcd.backlight(); Blynk.begin(auth, ssid, pass, "", 80); lcd.setCursor(1, 0); lcd.print("System Loading"); for (int a = 0; a <= 15; a++) { lcd.setCursor(a, 1); lcd.print("."); delay(500); } lcd.clear(); //Call the function timer.setInterval(100L, soilMoistureSensor); } //Get the button value BLYNK_WRITE(V1) { Relay = param.asInt(); if (Relay == 1) { digitalWrite(waterPump, LOW); lcd.setCursor(0, 1); lcd.print("Motor is ON "); } else { digitalWrite(waterPump, HIGH); lcd.setCursor(0, 1); lcd.print("Motor is OFF"); } } //Get the soil moisture values void soilMoistureSensor() { int value = analogRead(sensor); value = map(value, 0, 1024, 0, 100); value = (value - 100) * -1; Blynk.virtualWrite(V0, value); lcd.setCursor(0, 0); lcd.print("Moisture :"); lcd.print(value); lcd.print(" "); } void loop() {;//Run the Blynk library;//Run the Blynk timer }
(adsbygoogle = window.adsbygoogle || []).push({});
  • Now, copy and paste the Blynk auth token. It’s in the Blynk web dashboard.

  • Next, enter your WIFI SSID and password. And then, select board and port. Finally, upload this code to the Nodemcu board.

(adsbygoogle = window.adsbygoogle || []).push({});

Step 7

Ok, now let’s create the Blynk mobile dashboard. Follow the instructions for that.

  • First, download and install the Blynk app on your phone. Then, sign in to your account and click the template you created in the Blynk web dashboard.

  • Now, add the widget to the dashboard. For that click the + icon at the top right corner. And then, add one button and one gauge widget to the dashboard.

  • After, arrange these widgets as you like. Now, click the one-by-one widget and select the data streams you created in the Blynk web dashboard.

OK, the Blynk mobile dashboard is ready for us.

Step 8

Finally, connect the water pump to the relay module. Use the circuit diagram above for that. Then, put the soil moisture sensor into the soil. (I used a 9v battery for operating the water pump)

(adsbygoogle = window.adsbygoogle || []).push({});

Ok, now you can test this project. The full video guide is below. So, see you in the next project or tutorial.

How to make a plant watering system with the Nodemcu ESp8266 board and the new Blynk update

Similar Posts


  1. the code provided for automatic irrigation on the site when it is compiled is giving an error in lcd.init, how to solve it?

  2. Moisture value in my device giving 98-100
    i have not include lcd, is it make any difference and why my moisture value is showing like that

  3. hello sir, my coding has an error compiling for board nodemcu 1.0 (esp-12e module). what’s the solution ?

Leave a Reply

Your email address will not be published. Required fields are marked *