thingspeak - a blog about technology€¦ · thingspeak •thingspeak is an iot analytics platform...

28
Hans-Petter Halvorsen ThingSpeak http://halvorsen.blog

Upload: others

Post on 05-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Hans-Petter Halvorsen

ThingSpeak

http://halvorsen.blog

Page 2: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

ThingSpeaks

• ThingSpeak is a Web Service (REST API) that lets you collect and store sensor data in the cloud and develop Internet of Things applications.

• It works with Arduino, Raspberry Pi and MATLAB (premade libraries and APIs exists).

• But it should work with all kind of Programming Languages, since it uses a REST API and HTTP.

https://thingspeak.com2* ThingSpeak is free for small non-commercial projects

Page 3: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

ThingSpeak

https://thingspeak.com

Page 4: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

ThingSpeak

• ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet of Things applications.

• The ThingSpeak service also lets you perform online analysis and act on your data. Sensor data can be sent to ThingSpeak from any hardware that can communicate using a REST API

• ThingSpeak is a Web Service (REST API) that lets you collect and store sensor data in the cloud and develop Internet of Things applications.

https://thingspeak.com4* ThingSpeak is free for small non-commercial projects

Page 5: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

What is ThingSpeak?

https://se.mathworks.com/videos/introduction-to-thingspeak-107749.html

Page 6: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Hans-Petter Halvorsen

ThingSpeak + LabVIEW

http://halvorsen.blog

Page 7: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

The Cloud

ThingSpeak + LabVIEW

www.ThingSpeak.comLabVIEW

Page 8: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Configuration and Settings

Page 9: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet
Page 10: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet
Page 11: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

SubVI

Page 12: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet
Page 13: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Hans-Petter Halvorsen

ThingSpeak + Web Browser

http://halvorsen.blog

Page 14: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

ThingSpeak + Web Browser

• We can use a standard Web Browser in order to put data to ThingSpeak or to get data from ThingSpeak

Write Data Example:

https://api.thingspeak.com/update?api_key=<WriteKey>&field3=2

Read Data Example:

https://api.thingspeak.com/channels/<ChannelId>/fields/3/last.json?key=<ReadKey>

14

Page 15: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet
Page 16: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Set and Read Values using a Web Browser

Set Kp Remotely Example:

https://api.thingspeak.com/update?api_key=<WriteKey>&field3=2

Read Kp Remotely Example:

Enter the following in a Web Browser (or from a Programming Language like LabVIEW, MATLAB, etc)

https://api.thingspeak.com/channels/<ChannelId>/fields/3/last.json?key=<ReadKey>

{"created_at":"2017-06-26T07:41:54Z","entry_id":1270,"field3":"2"}Response in Browser:

We set Kp=2

We read Kp=2

Page 17: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Hans-Petter Halvorsen

ThingSpeak + MATLAB

http://halvorsen.blog

Page 18: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet
Page 19: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

ThingSpeak + MATLAB

The “ThingSpeak Support Toolbox” lets you use desktop MATLAB to analyze and visualize data stored on ThingSpeak.com

ThingSpeak Support from Desktop MATLAB:

http://se.mathworks.com/hardware-support/thingspeak.html

Page 20: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Hans-Petter Halvorsen

ThingSpeak + Arduino

http://halvorsen.blog

Page 21: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

ThingSpeak + Arduino

Arduino Example:https://www.arduino.cc/en/Tutorial.WiFi101ThingSpeakDataUploader

21

Page 22: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Arduino WiFi Shield + ThingSpeak

• ThingSpeak is a Web Service (REST API) that lets you collect and store sensor data in the cloud and develop Internet of Things applications.

• It works with Arduino, Raspberry Pi, MATLAB and LabVIEW, etc.

https://thingspeak.com

Arduino Example:https://www.arduino.cc/en/Tutorial.WiFi101ThingSpeakDataUploader

Page 23: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

www.ThingSpeak.com

The Cloud Data Analysis

Data Collection

Arduino + Wi-Fi Shield

Page 24: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Hans-Petter Halvorsen

ThingSpeak + C#

http://halvorsen.blog

Page 25: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

The Cloud

ThingSpeak + Visual Studio/C#

www.ThingSpeak.comVisual Studio

C#

Page 26: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Configuration and Settings

Page 27: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

27

void SaveMeasurementData(){

string apiKey;double tagValue;

string server = "https://api.thingspeak.com/";string webMethod;string uri;

var webclient = new WebClient();

apiKey = “xxxxxxxxxxxxxxxxxxxxx";

tagValue = Convert.ToDouble(txtMeasurementValue.Text);

webMethod = "update?api_key=" + apiKey + "&field1=" + tagValue;

uri = server + webMethod;

webclient.UploadString(uri, "POST", "");

}

Page 28: ThingSpeak - a Blog about Technology€¦ · ThingSpeak •ThingSpeak is an IoT analytics platform service that lets you collect and store sensor data in the cloud and develop Internet

Hans-Petter Halvorsen

University of Southeast Norway

www.usn.no

E-mail: [email protected]

Web: http://www.halvorsen.blog