IoT BLYNK App with ESP8266 and DHT11 Sensor for Temperature and Humidity Monitoring

This is a typical example taken for Blynk App and what is said about DHT11 shall be applicable for any other sensor. Blynk is an IoT Platform used with Arduino, Raspberry Pi, ESP8266 and NodeMCU and other microcontrollers. Blynk app is a digital dashboard where you will be able to build or design a graphical interface for any IoT based project by just drag and drop widgets. It is easy to use this IoT platform to create advanced applications. Blynk isn’t limited to some specific board or platform it can be used with any microcontroller.
Blynk App Blynk App Setup with NODE MCU To recieve temperature and humidity data from DHT11 sensor on Blynk app, download and install the Blynk app from Google play store or Apple app store.
Log in to Blynk App using your email id and password, if you don’t have an account create one.

NODE MCU Setup with DHT11

To get the example code for DHT11 with NodeMCU search in browser “blynk code generator” then open the first link of blynk example browser.
Then, select NodeMCU as board and example code for DHT11, as shown below: Now, open Arduino ide and select Tools option as shown below: Copy the example code for DHT11 with NodeMCU from the link then paste and run into Arduino IDE.
Programming Explanation

#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

#include <DHT.h>

Enter the Auth Token in the code, which is send to your email (as shown in the below image) or you can also check in the project setting of the Blynk App. char auth[ ] = “68c69bdc0f4d47a2b304a96357427278”; Here, in the below code we are configuring the wifi credential and defining the pins for DHT11.
char ssid[ ] = “CircuitLoop”; //wifi name char pass[ ] = “circuitdigest101”; //wifi password Blynk.begin(auth, ssid, pass); dht.begin(); Setup a timer interval for the function to call every second timer.setInterval(1000L, sendSensor); After, uploading the complete code in the Arduino IDE run the blynk app to measure the temperature and humidity. The app will look like as the image given below: Hence, we have successfully interfaced DHT11 with Blynk App.