ThingSpeak Integration

ThingSpeak

ThingSpeak (https://thingspeak.com)

  • ThingSpeak is a web platform the IoT
  • It allows you to send data from Argon to be stored at ThingSpeak
  • You can create basic graphs and dashboard with the values from your Argon
  • ThingSpeak also integrates with MATLAB for powerful data analytics

Configuring Argon and ThingSpeak

  • The following examples are provided as a quick reference
  • More detailed steps were described in the lecture

General Steps to Connect Argon and ThingSpeak

  1. Create an integration -> webhook on Particle console

  2. Create channel at ThingSpeak

  3. Write firmware sketch and flash Argon

Example 1: Send Single Data Point from Argon to ThingSpeak

Particle integration settings

image-20200404195445383

Example 1: Send Single Data Point from Argon to ThingSpeak

ThingSpeak Channel Setttings

image-20200404195342458

Example 1: Send Single Data Point from Argon to ThingSpeak

Argon code

double temp;

void loop() {
  temp = 89;		//just example; temp should come from sensor
  // Trigger the integration
  Particle.publish("Environment", String(temp), PRIVATE);
  delay(60000);	//use delay or millis to avoid publishing too frequently
}

Example 2: Send Multiple Data PointsArgon to Thingspeak

Particle integration settings

image-20200404194632886

Example 2: Send Multiple Data Points from Argon to Thingspeak

ThingSpeak channel settings

image-20200404194744347

Example 2: Send Multiple Data PointsArgon to Thingspeak

Argon Code

double temp;
double humidity;  
int rainfall;
String weather;

void loop() {
  //variables should read sensor data
  String data = "{ \"weather\": \"" + weather + "\"" +
                ", \"temp\": " + temp +
                ", \"humidity\": " + humidity +
                ",\"rainfall\": " + rainfall +
                "}";
  // Trigger the integration
  Particle.publish("Environment", String(data), PRIVATE);
  delay(60000);	//use delay or millis to avoid publishing too frequently
}

##

String data variable will be in the following format

{
"weather":"sunny"
"temp":76
"humidity":42
"rainfall":19
}

Updated: