-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Hardware | Quantity |
---|---|
NodeMCU ESP8266-12E Board | 1 |
DHT11 Sensor Module | 1 |
Jumper Wires (Male-to-Female) | 3 |
Breadboard | 1 |
USB Cable | 1 |
Software & Online tools |
---|
Arduino IDE |
Web Browser |
Thingspeak Account |
Arduino IDE with ESP8266 add-on installed.
The circuit diagram for monitoring humidity and temperature is shown in the figure below. It is built around NodeMCU ESP8266-12E board, DHT11 Sensor, and few jumper wires on the solderless breadboard.
The DHT11 sensor senses humidity and temperature, and sends the information to digital pin D2 of NodeMCU ESP8266 board, as shown in the above figure. From NodeMCU, humidity and temperature values are uploaded to the Cloud at regular intervals of time through the NodeMCU ESP8266 Wi-Fi module. From the Cloud, humidity and temperature values can be seen graphically on the ThingSpeak platform from anywhere in the world.
ThingSpeak is an open-source data platform but you need to register to use it. After registering, login to your account and create a new channel with humidity as one field and temperature as another, as shown in the figure below.
Once a new channel is created, it will generate two API keys, namely, write an API key and read the API key. Replace the line given below in the program with your write API key:
String apiKey = “NTIM1RXET6YVUVWF“;
Next, substitute Host_Name and Password with your Wi-Fi name and Wi-Fi password in the two lines given below in the program (code.ino):
String Host_Name = “DLinkWiFi”; String Password = “Pass@123”;
The program should be verified with your Wi-Fi setup. It uses the DHT library. If the DHT library is not present in your Arduino folder, download it from https://github.com/adafruit/DHT-sensor-library. To import the DHT library in Arduino IDE, select Sketch >>> Import library >>> Add library >>> Select the library that you have downloaded. Compile the sketch/program and upload it to Arduino MCU through Arduino IDE. Ensure that the Wi-Fi modem and the Internet connection in your PC/smartphone are working properly. Once sketch uploading is done, it will upload humidity and temperature values on the ThingSpeak platform and you will be able to see it graphically in the Private view window, as shown in the figure below. If you want to change the channel or field name, you can change it from Channel Settings (shown in the figure below).
Along with temperature and humidity sensors, other sensors like gas, voltage, current, and energy can be used based on the requirement. Moreover, it is also possible to take further actions by controlling the actuators from the Internet once the sensor values are going above/below predetermined values.