Thing Speak ESP8266

ThingSpeakā„¢ is an IoT analytics cloud platform service that allows you to aggregate, visualize and analyze live data streams in the cloud. ThingSpeak provides instant visualizations of data posted by ESP8266 to ThingSpeak. ThingSpeak is often used for prototyping and proof of concept IoT systems that require analytics.

In this tutorial, We will learn following thinds

  1. How to Configuring ThingSpeak Cloud server Account ?
  2. How to program ESP8266 to upload sensor data ?

Lets understand the cloud concept first. Uploading of ESP8266 sensor data is done using Internet. It is three step process.

  1. Connect to your WiFi hot spot having internet access.
  2. Read Sensor data
  3. Upload data to ThingSpeak

Step 1: Sign up ThingSpeak

Its simple just enter your email id and verify your account.

Step 2: Configuring ThingSpeak

Configuration is just few clicks job

Step 2.1: Create New Channel

Click on New Channel

Create Channel Thing speak for ESP8266

Enter Name and Field. You may have multiple Fields depending on number of sensor create multiple fields such as Light, Temperature, Humidity, etc.
Enter Name and Label thing speak esp8266

Keep everything else as it is. Blank or default values. and click on Save Channel.thing speak save channel

Step 2.2: Getting API Key

Click on API Key Tab and look for these two fields Write Api Key and Update channel feed line.

api key esp8266 thing speak

This line is important for data upload to cloud server

First parameter is Api Key. Do not share API key it makes decision of which user it is. In most cases I create own cloud server as per requirements. Second parameter is field1=0 here you can pass the ADC value ex. field1=1234

value in front of field1=0 is your sensor data for example if your adc value is 1234 then you call this GET request with https://api.thingspeak.com/update?api_key=yourapikey&field1=1234

For multiple sensors you need to add multiple fields as shown in below example

https://api.thingspeak.com/update?api_key=yourapikey&field1=1234&field2=442

Step 3: Programming ESP8266 to upload data to ThingSpeak cloud server

Make Changes in program for API KEY, SSID and PASSWORD

Upload Program and Open Serial monitor with baud rate of 115200. First it will show connection status to your wifi router then It uploads data to server and displays response from server. Do not try to upload data at very high rate ThingSpeak server will simply blocks it. 5 Seconds update time is okay.

ThingSpeak Response on Serial Monitor

Step 4: Check Data on ThingSpeak Server

Open Your ThingSpeak Account and Click on Private View of Your Channel

thingspeak esp8266 dataupload

You did it well….Thats it….You can Create multiple Fields and Upload multiple sensor data. and also you can create multiple channels for multiple Data Nodes.

In case of any problem upload your project on Steps2Make.com to hear from me.

Leave a Reply