Arduino, light sensor, thingspeak

Arduino, Light Sensor, and HTTP Requests

It is actually fairly simple to start building your own little corner of the Internet of Things. These videos help you get started with doing just that by helping you build a system using a couple of sensors, an Arduino, an Internet connection and a cloud based service called ThingSpeak.

[adrotate banner=”3″]


How to Download and Install cURL

The program cURL is a handy command line based tool for generating application layer networking messages in various protocols. The reason I am including it here in my Internet of Things videos is because you can generate HTTP and HTTPS messages with it. Many cloud based IoT services support a REST API which is an interface to the service via HTTP requests. For example by sending an HTTP POST request you can send data to the cloud service for it to store in a database and by using an HTTP GET request you can obtain that data back from the cloud. cURL would typically not be used in the final product, but it is a very handy debugging tool to test the interface

How To: Download and Install a curl executable for Windows

 

 


Basics of ThingSpeak

ThingSpeak is an Internet of Things software as a service platform. It allows you to create a channel which can accept a stream of data (from a sensor network for example), store it, and display it through a website. It also allows you to obtain the data. The interface to send or retrieve data can be through a REST API (using HTTP) or the MQTT protocol. ThingSpeak is owned by The Mathworks and so can interface nicely with Matlab. The video below shows how to setup an account and then interface toThingSpeak using HTTP via cURL.

Basics of ThingSpeak a Simple Internet of Things Platform

Using HTTP to GET Data from Thingspeak

ThingSpeak uses a REST API as the interface to its database and this video shows how to use the API (via HTTP GET requests) to obtain data from a ThingSpeak channel.

Using HTTP GET Requests to obtain Data from ThingSpeak

Sending Light Sensor Data to ThingSpeak

An internet connected Arduino can be used to send data to ThingSpeak. All you need to do is collect your data (in this thing I am measuring Lux using an LDR) and then creating an HTTP POST request that you send to the ThingSpeak server.

Sending Light Sensor Data from Arduino to Thingspeak