Send a feed to an Internet of Things (IoT) cloud service – Tutorial

The CloudIn widget sends data to IoT cloud services including data.sparkfun.comXively (formerly COSM & Pachube), and ThingSpeak, as well as cloud devices from These services allow for devices, software, or people to post and receive feeds from anywhere in the world. For example a gesture sensor in Pasadena could send its values to the cloud, and video displays in London and Beijing can access the latest value of that sensor, and play different scenes based on the Pasadena sensor value.

The key thing about these services is that feeds can be posted and retrieved from anywhere, without the need to have a direct connection between the sender and receiver. The IoT cloud service handles the asynchronous reception, storage, and delivery of the feeds.

The CloudOut widget sends a value periodically, using an API key, channel, and dataFeed value from a public or private account on the IoT service. Set how often you want to send a feed value in the sampleRate parameter of the widget, set in seconds. For example, if sampleRate is set to 5.5, the widget will send a new value every 5 and a half seconds.

Note that these services are designed for low data rate feeds, and are not designed for real-time interactions such as using a knob to interactively turn a remote servo with fine grained responsiveness. The services have different standards for data rates:

  • Xively – has a rate limit of 25 access per minute (in their free version)
  • ThingSpeak –  has a rate limit that allows access once every 15 seconds
  • – has a rate limit of 100 accesses every 15 minutes (once every 10 seconds)
  • – allows a total of 1 access per second, per device.
  • – support for this service has been removed.

On Screen Features

  • connect – Connects to the cloud service.
  • channel – Represents a device or other data source, e.g. an Arduino
  • dataFeed – A single data stream of the channel, e.g. a proximity sensor connected to the Arduino
  • in – The most recent value from the inputSource
  • refresh – The number of seconds left until the next data value is sent
  • out – The next data value to be sent to the IoT cloud service


  • apiKey – The API key you’ve gotten from the cloud service. keyCOSM keyThingSpeak key
  • channel – The ID of the channel you’ve set up. sparkfunPhant = private key, Xively = Environment, ThingSpeak = Channel, = device id. This represents a device, environment, virtual feed, etc.
  • cloudService – Selects the IoT cloud service to use
  • cloudUrl – If set to other than “default”, sets the URL of the cloud service (only applies to sparkfunPhant)
  • dataFeed – The ID of the specific data feed to send data to. = data field, Xively = Datastream, ThingSpeak = Field# (should be an integer from 1 to 8 ), = port (e.g. A0)
  • feedType – Set to last or average. Last sends the most recent value received from the inputSource – typically used where the only the most recent value is important, like with a switch that indicates if a door is open or closed. Average sends an average of all values received since the last send – typically used where you want to send the general state of the sensor, like when sensing temperature.
  • inputSource – The instance name of the source the widget listens to, e.g AnalogIn.
  • invisible – If set to “true” or checked, the widget will disappear when the Flash movie is run – NOTE: you can make all the widgets invisible interactively when the Flash moving is running simply by pressing the backslash key “\”.
  • remoteHubIP – unused
  • sampleRate – The widget will retrieve a data value from the dataFeed every number of seconds specified. Must be 1 second or more.

Last modified March 22nd, 2015