Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

0
 

How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk

Hello, welcome back. In this tutorial, we will learn how to make a Temperature monitoring system using the Nodemcu board
and Blynk application. The DHT11 sensor is mainly used for this project. Also, since this project belongs to IoT technology,
we can monitor temperature and humidity from anywhere in the world through the smartphone or tablet. We can use this
system mainly for animal farms, greenhouses, and factories.

x
The process of this system

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 1/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

When power ON this system. The Nodemcu board connects to the Blynk app through the internet and Blynk cloud. And then,
the Nodemcu board receives values through the DHT11 sensor. Also, those values can be seen on the interface of the Blynk
app and on the LCD.

OK, let’s do this project step by step. The required components are given below.

Nodemcu board x 1 — Amazon / Banggood


DHT11 sensor x 1 — Amazon / Banggood
LCD display x 1 — Amazon / Banggood
I2C module x 1 — Amazon / Banggood
Breadboard x 1 — Amazon / Banggood
Jumper wires — Amazon / Banggood

Step 1

Firstly,identify these components.

Nodemcu board

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 2/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

DHT11 sensor

LCD display

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 3/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

I2C module

Breadboard

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 4/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Jumper wires

Step 2

Secondly, connect these components. To do this, use the circuit diagram below.

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 5/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Step 3

Thirdly, let’s set up the Blynk app step by step.

First, download and install the Blynk app into the smartphone. Then, sign up for this app. Now, run this app and click the
“New project” button.

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 6/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Then, enter the project name. After, select the device type and connection type. Now, click the “confirm” button.

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 7/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Then, click the + icon in the corner and insert two gauge widgets and one LCD widget.

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 8/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 9/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Curated Bonds For You

AltiFi O
Now, let’s click the widgets one by one and set up the settings in these widgets. First, click the LCD widget and change
the pins to V0 and V1. After, enter the values from 0 to 100.

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 10/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Next, click the Gauge widget one by one and name them. After, change temperature Gauge as A0 and humidity Gauge as
A1. Also, change the values from 0 to 100. Then, customize these widgets as you like.

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 11/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Earn up to 13% returns


AltiFi

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 12/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 13/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

OK, now the Blynk app is ready.

Temperature Monitoring Device Using Arduino and Python Live Data Plotting | Arduino…

Step 4

Now, let’s creates the program for this project. It is as follows.

WIFI library — Download


Blynk library — Download
I2C library — Download
DHT11 library — Download
The complete program of this project – Download
 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 14/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

1 /*Temperature monitoring system.


2 * https://srituhobby.com
3 */
4
5 #define BLYNK_PRINT Serial
6 #include <ESP8266WiFi.h>
7 #include <BlynkSimpleEsp8266.h>
8 #include <Wire.h>
9 #include <LiquidCrystal_I2C.h>
10 #include <DHT.h>
11
12 LiquidCrystal_I2C lcd(0x27, 16, 2);
13
14 DHT dht(D3, DHT11); //(sensor pin,sensor type)
15
16 char auth[] = ""; //Enter the Auth code which was send by Blink
17 char ssid[] = ""; //Enter your WIFI Name
18 char pass[] = ""; //Enter your WIFI Password
19
20 BlynkTimer timer;
21
22 void sendSensor() {
23 float h = dht.readHumidity();
24 float t = dht.readTemperature();
25
26 if (isnan(h) || isnan(t)) {
27 Serial.println("Failed to read from DHT sensor!");
28 return;
29 }
30
31 lcd.setCursor(0, 0);
32 lcd.print("Temp : ");
33 lcd.print(t);
34 lcd.setCursor(0, 1);
35 lcd.print("Humi : ");
36 lcd.print(h);
37
38 Blynk.virtualWrite(V0, t);
39 Blynk.virtualWrite(V1, h);
40 }
41 void setup() {
42
43 Wire.begin(D2, D1);
44 lcd.init();
45 lcd.backlight();
46 Blynk.begin(auth, ssid, pass);
47 dht.begin();
48 timer.setInterval(100L, sendSensor);
49 }
50
51 void loop() {
52 Blynk.run();
53 timer.run();
54 }

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 15/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Code Explanation

Firstly, libraries are included.

#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <DHT.h>

Secondly, objects are created for these libraries,

LiquidCrystal_I2C lcd(0x27, 16, 2);

DHT dht(D3, DHT11); //(sensor pin,sensor type)

Thirdly, includes the Blynk auth token and WIFI connection details as follows.

char auth[] = "DPOPmn8DiqBjklFYXy0itleC1Szog"; //Enter the Auth code which was send by Blink
char ssid[] = "srituhobby"; //Enter your WIFI Name
char pass[] = "123456"; //Enter your WIFI Password

 x

This is main function of this program,

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 16/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

void sendSensor() {
// Humidity and temperature values are obtained and these values are inserted into float
variables
float h = dht.readHumidity();
float t = dht.readTemperature();

// The sensor is checked


if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// These values are printed on the LCD


lcd.setCursor(0, 0);
lcd.print("Temp : ");
lcd.print(t);
lcd.setCursor(0, 1);
lcd.print("Humi : ");
lcd.print(h);
// These values are printed on the Blynk app
Blynk.virtualWrite(V0, t);
Blynk.virtualWrite(V1, h);
}

In the setup function,

void setup() {

//The wire library is begin

Wire.begin(D2, D1);

//The I2C library is begin


lcd.init();

// LCD backlight is turns on


lcd.backlight();

//The Blynk library is begin using the Blynk auth token and WIFI connections deatails
Blynk.begin(auth, ssid, pass);

//The DHT11 sensor is begin


dht.begin();

// This code is called the main function


timer.setInterval(100L, sendSensor);
}

In the loop function, the Blynk library is run.

x
void loop() { 
Blynk.run();

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 17/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby
timer.run();
}

Step 5

Now, select board and port. After, upload this code to the Nodemcu board.

Lastly, run the Blynk app interface and enjoy this project. The full video guide is given below. So, we will meet in the next
tutorial.

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 18/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Thousands In Stock at Digi-Key


Digi-Key India

How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 19/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Earn up to 13% returns


Don't miss your chance to capitalise on bonds AltiFi's handpicked ones are a boon

AltiFi Open

How does work Nodemcu with DHT11 sensor - ESP8266 Nodemcu with DHT11 and Blynk application

← Previous Post Next Post →

Related Posts

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 20/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Introduction to Arduino and Arduino IDE Configuration – Step by step instructions

How to make an led light up and blink using Arduino

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 21/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

How to make a knight rider LED chaser (part i)

5 thoughts on “How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk”

RIKI
NOVEMBER 30, 2021 AT 3:46 PM

Hii, i got one problem. Why my LCd screen got no output. Everthing is fine but Output for lcd show nothing “blank”. I hope u
can help me with this problem. Sorry. Have a good day

Reply

SRITU HOBBY
DECEMBER 3, 2021 AT 10:42 AM

I have two options for that. First, please adjust the contrast of your LCD. The other is to check your jumper wire and LCD.

Reply

DOVIANDA
DECEMBER 26, 2021 AT 4:04 PM

hi ive got problem ” exit status 1


Error compiling for board NodeMCU 1.0 (ESP-12E Module). ” what should i do?
 x
Reply

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 22/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

RUPERT GUINNESS
DECEMBER 8, 2022 AT 7:20 PM

my serial monitor is outputting failed to read from DHT sensor not sure whats causing it? any help

Reply

SRITU HOBBY
DECEMBER 13, 2022 AT 2:19 PM

Check your DHT11 sensor or jumper wires

Reply

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

Type here..

Name*

Email*

Website

Save my name, email, and website in this browser for the next time I comment.

I'm not a robot


reCAPTCHA
Privacy - Terms

Post Comment »

 x
Search

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 23/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Search

Home

Arduino

Arduino Tutorials

Arduino Projects

IoT

Nodemcu ESP8266

ESP32

Electronic

Simple DIY Toys

Raspberry Pi

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 24/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Products

High-Quality 16x2 LCD Display | Free guide with box


sssss
$5.99

Solderless PCB Breadboard | Mini Universal Test Protoboard


sssss
$4.99

Arduino Compatible R3 ATmega328P | Arduino UNO board SMD With Cable


sssss
$12.99

4x4 Membrane Switch Keypad


sssss
$2.99

Wheel For Smart Robot Car


sssss
$3.99

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 25/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Arduino obstacle avoiding + voice control + Bluetooth control Robot | DIY Arduino Robot

GenSwin
Halloween...
$14.99

Shop now

ELEGOO UNO
R3 Project...
$79.99

Shop now

Create it step by step

SriTu Hobby

 x
Create your dream electronic hobby project step by step with SriTu Hobby - the world's No. 1 hobby electronic website. Get
access to tutorials, and products for beginners and experienced hobbyists

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 26/27
3/27/23, 9:02 AM How to make a Temperature and Humidity monitoring system using Nodemcu and Blynk - SriTu Hobby

Links

Privacy Policy
Disclaimer
Terms And Conditions
Contact Us
Refund and Returns Policy
Shipping

Read

Read
Arduino
Arduino Tutorials
Arduino Projects
IoT
Nodemcu ESP8266
ESP32
Raspberry Pi
Electronic

Buy

Development Boards
Displays
Modules
Motors
Related components
Semiconductors
Sensors

Copyright © 2020 - 2023 SriTu Hobby. All rights reserved

 x

https://srituhobby.com/temperature-and-humidity-monitoring-system-using-nodemcu/ 27/27

You might also like