top of page
Search
Writer's pictureWatchIT Group

Part 3 Lesson 2 : Getting started with ThingSpeak and visualize your data anywhere in the world.

Internet of Things (IoT) describes an emerging trend where a large number of embedded devices (things) are connected to the Internet. These connected devices communicate with people and other things and often provide sensor data to cloud storage and cloud computing resources where the data is processed and analyzed to gain important insights. Cheap cloud computing power and increased device connectivity is enabling this trend.


IoT solutions are built for many vertical applications such as environmental monitoring and control, health monitoring, vehicle fleet monitoring, industrial monitoring and control, and home automation.

At a high level, many IoT systems can be described using the diagram below:


ThingSpeak Key Features

ThingSpeak allows you to aggregate, visualize and analyze live data streams in the cloud. Some of the key capabilities of ThingSpeak include the ability to:


  • Easily configure devices to send data to ThingSpeak using popular IoT protocols.

  • Visualize your sensor data in real-time.

  • Aggregate data on-demand from third-party sources.

  • Use the power of MATLAB to make sense of your IoT data.

  • Run your IoT analytics automatically based on schedules or events.

  • Prototype and build IoT systems without setting up servers or developing web software.

  • Automatically act on your data and communicate using third-party services like Twitter.



Steps to start using ThingSpeak


1. Open an account on MathWorks "https://www.mathworks.com/mwaccount/register " and use the same credentials to access Thingspeak.

Fill all information required and you should receive an email for verification,

and follow all instructions given .


2. Then Login in the ThingSpeak (https://thingspeak.com/) using the same credentials (E-mal and password ) used with math-works.



And start setting up channels.


Video

login in ThingSpeak

Add a New Channel to Thingspeak



LDR sensor data to Thingspeak


In this experiment we are going to send LDR (light depending resistor) sensor data to Thingspeak to be able to visualize them everywhere in the world.



What you need :


  • Circuit LDR interfaced with Nodemcu ESP8266

  • Thingspeak library

Circuit diagram


LDR sensor interfaced with Nodemcu ESP8266

download Thingspeak library in the Arduino IDE ,

Steps : Sketch > include Library > Manage Libraries ...

and in search box write Thingspeak and install the Thingspeak by MathWorks , this process takes few seconds.




Sketch


#include <ESP8266WiFi.h>;
 #include <WiFiClient.h>;
 #include <ThingSpeak.h>;
 const char* ssid = "Your Network SSID"; //Your Network SSID
 const char* password = "Your Network Password"; //Your Network Password
  WiFiClient client;
 unsigned long myChannelNumber =; //Your Channel Number (Without Brackets)
 const char * myWriteAPIKey = ""; //Your Write API Key

 void setup() 
{
delay(1000);

   Serial.begin(9600);
  
 ThingSpeak.begin(client); 
}
 void loop()
{
int LDR_value =analogRead(A0);
   
ThingSpeak.writeField(myChannelNumber, 1,LDR_value, myWriteAPIKey); //Update in ThingSpeak 
//                    (myChannelNumber,Field_number, myWriteAPIKey)
println(LDR_value);

 delay(1500);
}

API KEY & Channel number




Copy The Write Api Key & Channel Number selected in red box , and paste each of them in the respective place in the Arduino Sketch.

And remember to replace the network Credentials to access to your WiFi network.


Result : Dashboard


let us know in the comment section if it's working for you!😉


For any problem regarding the this tutorial feel free to ask in the comment section.





630 views9 comments

9 Comments


#include <ESP8266WiFi.h>;

#include <WiFiClient.h>;

#include <ThingSpeak.h>;

const char* ssid = " Network 3";

const char* password = "";

int LDR=A0;

WiFiClient client;

unsigned long myChannelNumber =1164257;

const char * myWriteAPIKey ="0P3HZK5PPZMT8Z4O";


void setup()

{

delay(1000);


Serial.begin(9600);

ThingSpeak.begin(client);

}

void loop()

{

int LDR_value =analogRead(A0);

ThingSpeak.writeField(1164257, 1,LDR_value,"0P3HZK5PPZMT8Z4O");

Serial.println(LDR_value);

delay(1500);

}

Like

Arsene
Arsene
Sep 30, 2020

can you plz share your code here! for supports

Like

i don't get result on my Thinkspeak ,help me


Like

i don't get result on my channel pls help me


Like

igorntwari28
Aug 09, 2020

worked

Like
Post: Blog2_Post
bottom of page