Monitoring Room Temp & Humidity using Blynk
This activity will take you through the steps and procedure you need to follow to display the temperature and humidity of the room using the DHT11 sensor, NodeMCU and the Blynk app.
Last updated
This activity will take you through the steps and procedure you need to follow to display the temperature and humidity of the room using the DHT11 sensor, NodeMCU and the Blynk app.
Last updated
Setup the circuit with the NodeMCU and the DHT11 sensor.
Configure/setup the Arduino IDE by installing the DHT11 library.
Setup the Blynk App on your smartphone to include the display widget for both temperature and humidity.
Write the code that will read the temperature and humidity values from the DHT11 sensor.
The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed).
Inset the DHT11 sensor on the breadboard as shown above.
Connect the Vcc pin on the sensor to the 3v pinon the NodeMCU.
Connect the GND pin of the sensor to the GND pin of the NodeMCU.
Connect the data/signal pin of the sensor to the digital pin D2 on the NodeMCU.
On the Blynk app create a new project and name it "Monitor Room". You will receive the authentication key via e-mail.
On the "+" icon add the Gauge widget and call name it "Temp". Assign it a virtual pin V5 and setup the value from 0 to 100.
Add another Gauge widget and call it "Humidity". Assign it a virtual pin V6 and setup the value from 0 to 100.
To read from the DHT sensor, we’ll use the DHT library from Adafruit. To use this library you also need to install the Adafruit Unified Sensor library. Follow the next steps to install those libraries.
Open your Arduino IDE and go to Sketch > Include Library > Manage Libraries. The Library Manager should open.
Search for “DHT” on the Search box and install the DHT library from Adafruit.
After installing the DHT library from Adafruit, type “Adafruit Unified Sensor” in the search box. Scroll all the way down to find the library and install it.
Add the following code to your Arduino IDE:
On line 10 of the code above include the authentication key that was sent to you via email.
Also add the ssid and password of the local network that you would like to connect to.
Upload the code to your NodeMCU dev board.
Open your Blynk app again and then press the "play" icon to run your project. You should be able to see the Humidity and temperature.