Introduction: When NodeMCU Meets Thingspeak

About: Electronics Engineer.

When ESP8266 (NODEMCU) meets Thingspeak we can found real time data. Yeah it is true. In this project we have interfaced NODMCU with dht11 sensor as well as sending temperature and humidity data to Thingspeak server.

Step 1: Supplies:

Hardware and software requirements:

1.NodeMCU

2.DHT11 sensor

3.Jumper wires

4.Breadboard (optional)

5.USB cable

6.An active Thingspeak account

7.Arduino IDE

8.Thingspeak

Step 2: Installation of Arduino IDE

Now first of all we need to download and install the Arduino IDE as we have shown in above figure.

You can refer Download Arduino IDE for downloading and installing the Arduino IDE.

Step 3: Now It’s Time to Congfigure NodeMCU in Arduino IDE

This are the steps:

Step1: After installing the Arduino IDE we need to open it.

Step2: Now you need to click on a file. Then you have to click on preferences.

Step3: Now you will get one window like above figure. Now you need to copy this URL in the Additional board manager. This is the URL http://arduino.esp8266.com/stable/package_esp8266com_index.json you can copy it and paste it on your Additional board manager.

Step4: Now come back to the home screen (Arduino IDE) and click on Tools then select the Board manager then select ESP8266 Boards and then scroll down on that window you will get NodeMCU 1.0(ESP-12E Module) as shown in above figure.

Step5: Now restart your Arduino IDE.

Step 4: Library Installation

we are using DHT11 sensor. DHT11 sensor is known for Temperature and Humidity sensor. So we need to install the library of DHT11 sensor in Arduino IDE.

This are the steps:

Step1: You need to click on Tools then click on Manage libraries. Then search on search bar “DHT11” and install the latest version of it. As shown in figure above.

There are many cloud platforms to send the data to cloud. But I would like to suggest you Thingspeak. Because it is easy to use. Now we are using Thingspeak cloud platform to receive the data from NodeMCU . So we need to install library of Thingspeak in Arduino IDE.

This are the steps:

Step1: Again you have to do same process but little bit change at the end step you need to click on Tools then click on Manage libraries. Then search on search bar “Thingspeak” and install the latest version of it. As shown in figure above.

Step 5: What Is Thingspeak

Let me tell you what is Thingspeak. Thingspeak is open source application. It is Internet of Things(IoT) application and API to store and retrieve the data from things using the MQTT protocol over the internet or via a local area network.

So first you have to create an account on Thingspeak then you can send the data to Thingspeak server. After that successfully creating the account then you have to sing in to the account.

Now you have to click on New channel shown in below figure. Now give it a name as per your project. As you can see we have given name dht11 sensor and fill some things like description and field1 and field2.

In a single channel we can create 8 fields. Now in this project we need only 2 fields i.t temperature and humidity from dht11 sensor.

Now after successfully doing those things you need to go to the API Keys tab and copy the API key of the channel and paste in to your NodeMCU code written in Arduino IDE.

Note: This API key will provide you by Thingspeak on your email.

Step 6: Now It’s Time to Coding.

Now open the Arduino IDE and write the code. Also you can download the code from here.

Step 7: Output

As above image shows that this is our output

Step 8: Conclusion

  • In this simple project, I have shown you how to interface DHT11 Humidity Sensor with ESP8266 and ThingSpeak API.
  • It is not mandatory to use ThingSpeak.You can use any other platform.
  • You can monitor the DHT11 Sensor Data from anywhere in the World just by sitting in front of a computer. 
  • This project could be your first implementation towards a bigger and better Weather Station with many other sensors.
  • This project helps us to use of IoT.