AnalogDemo: plot data and upload to Pachube in C#

by luca
2 comments

To test the program without real data, I wrote a simple Arduino sketch that, every 5 seconds, send on a serial connection a random value in the same range of analogRead():

void setup() {
 
  Serial.begin(9600);
  randomSeed(analogRead(0));
}
 
void loop() {
 
  int randomValue = random(0, 1023);
  Serial.println(randomValue, DEC);
  delay(5000);  
}

Program the sketch on your Arduino board and connect it to your personal computer.

Run the program and insert your datastream details:

  • API key
  • Feed ID
  • Datastream ID

Flag Send data if you want to update your datastream with the incoming data:

Choose the serial port Arduino is connected to and press Connect… after some seconds the first data will be shown on the chart:

The same data will be plot on Pachube site:

In the last page of this long article, I’m going to explain the source code…

[youtube id=”uY8N9Z076jU” width=”600″ height=”350″]

Related Posts

2 comments

lucadentella.it – 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 […]

Reply
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.
http://www.parallax.com/ProductInfo/Microcontrollers/PLXDAQDataAcquisitiontool/tabid/393/Default.aspx
molto interessante se non l’hai già vista.
Ci si vede
Ciao

Reply

Leave a Comment

five − three =