IoT Tutorial on Connecting Temperature Senor to Cloud with NodeMCU

Tutorial on Connecting Temperature Sensor to Cloud with Arduino Nodemcu ESP8266

NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the ESP-12 module. The term "NodeMCU" by default refers to the firmware rather than the development kits. The firmware uses the Lua scripting language. It is based on the eLua project, and built on the Espressif Non-OS SDK for ESP8266.

Some creative ESP8266 enthusiasts have developed an Arduino core for the ESP8266 WiFi SoC that is available at the GitHub ESP8266 Core webpage. This is what is popularly called the "ESP8266 Core for the Arduino IDE" and it has become one of the leading software development platforms for the various ESP8266 based modules and development boards, including NodeMCUs.

Let's start with setting up the Arduino

Part I: Installation and settings of Arduino IDE

  1. If you have not already done, follow the installation and settings of Arduino IDE through this link https://youtu.be/4Ih39hGcPzg
  2. Follow the settings of ESP8266 through this link https://youtu.be/G6CqvhXpBKM
  3. To create the temperature sensor project, go in options file New
  4. You can add the library files from sketch --> include library --> manage library
    1. Add all the libraries specified in the program
    2. ESP8266WiFi.h
    3. DNSServer.h
    4. ESP8266WebServer.h
    5. WiFiManager.h
  5. WiFiManager.h

Arduino side is done, let's shift to Cloud side to set up things

Part II: Setting up Cloud Account on Thingsio.AI

ThingsIO.AI is a IoT Platform for developers. As a developer we understood the pain of not having a seamless place to connect, analyze and process device data. Many pure analytics platforms does not offer device management, which is core for the iot. That is the reason of ThingsIO.AI

  1. Register the account via this link http://thingsio.ai/#/register
  2. Create a project:
  3. Write the name of the project:
  4. Now, you will be on the project dashboard of your account. Click on the new project option:
  5. Click on the add a new device option:
  6. Enter the device name and click on the create and configure device:
  7. Click on the add a new device option:
    1. Track your device’s special parameters here. This can be set in device configuration (default to null).
    2. You can see your real time and special parameter’s graph.
    3. You can see your all data points.
    4. You can see here your last 5 data points.
    5. You can see here all the list of created graphs.
  8. Go in sample device code options and click on the NodeMCU. You will get the sample code from there and paste into your Arduino IDE.
  9. Click on the “Send trial data” to send a trial data to the server:
  10. Part III: Setting up NodeMCU and Completing the Project

    Now switch back to your NodeMCU Project. The new few steps you have to do it you Arduino project and is related to NodeMCU ESP8266.

  11. Go in sample device code options in http://thingsio.ai/ account and click on the Node MCU. You will get the sample code from there.
  12. Copy and paste the sample code into your IDE
  13. Compile the sketch by clicking on the compile icon on the top left corner
  14. connect the node MCU(ESP8266) via the USB cable
  15. Upload the sketch by clicking on the upload icon
  16. You can connect the temperature sensor to the 3.3 v pin of Node MCU and check the output on the serial monitor
  17. Now your NodeMCU is configured and it is sending data to the cloud, thingsio.ai. Last part is to visualize the data

    Part IV: Charting and Vizualtions on Thingsio.AI

  18. Now, click on the configuration device option.
  19. You can set the special parameters (this is tracked on the device dashboard) & transform it accordingly and add new parameters (Parameters are updated automatically as you send them from your device).
  20. Click on the update device option:
  21. You can also set your device geographical location.
  22. To create a graph for your device click on the “create graph option”.
  23. Click on the preview option. You will see your created graph and click save changes.
  24. You can monitor the response from the server, connection with the Wi-Fi etc on the serial monitor (make sure that the baud rate is same as that specified in the program ie,115200)

2 Comments


Jonathon
Says August 15, 2017 at 11:33PM

Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

Andy
Says August 15, 2017 at 11:33PM

Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

Bryson
Says August 15, 2017 at 11:33PM

Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

Leave Your Comments