AnalogDemo: plot data and upload to Pachube in C#

by luca

In this article, I’m going to show you how to receive data from serial port, plot them in a chart and send to Pachube.

Pachube define itself “a realtime data infrastructure platform for the Internet of Things, managing millions of datapoints per day from thousands of individuals around the world”. In fact, it’s a website that allow users to send their data, have them plotted on a chart and receive data from other users; it mentions “Internet of Thinks” because often data are sent by devices directly connected to Internet (for example a Geiger counter based on Arduino, here’s the chart with collected data).

The program I’m going to show you has two main goals:

  • it receives data from a serial port (for example from an Arduino) and show them on a line chart;
  • it updates, with the same data, a datastream in a Pachube feed.

The program name (“AnalogDemo“) is because at the beginning it was designed to receive data read from an Arduino analog port (values between 0 and 1023, directly proportional to the voltage).

Let’s see how to create a new feed in Pachube: if you don’t already have an account, sign up to the site, activate your account and log in.

Choose Create a feed:

Type a name and a description:

Downwards, create a new datastream and click Save:

Choose My feeds:

Click on the new feed:

Write down the feed id, shown in the address bar of our browser:

Pachube has an authentication method based on keys. Every user is assigned a master key,that should be kept secret. So you need to create a new key with only update (PUT) grant on your feed.

Choose My keys:

Click Create a new API key:

Choose only the PUT method, if you like you can restrict the new key to be used only from a source IP or set an expiration date:

Finally write down the new key:

In the next page, you’ll find how the program works…

Related Posts

2 comments – Sensore di corrente con Arduino Tuesday November 29th, 2011 - 11:50 PM

[…] formula indicata sopra e lo invia al PC sulla porta seriale. Sul PC è in esecuzione il programma AnalogDemo che disegna il grafico dei valori letti e aggiorna un feed su […]

mario Wednesday January 25th, 2012 - 09:13 AM

Ciao Luca, progettino interessante, ho trovato in giro questa utility per Excel, solo fino al 2003, per rappresentazione grafica di dati da seriale.
molto interessante se non l’hai già vista.
Ci si vede


Leave a Reply to – Sensore di corrente con Arduino Cancel Reply

3 × 2 =