Posts tagged Pachube

5 Notes

Using Python and an Arduino to get data from Pachube

The dial I created was mostly for server monitoring but before that I figured I would try and hook it up to Pachube to obtain the speed of something. I went hunting for something on Pachube that had a speed elements. I found that there is a plentiful supply of massive ships that post AIS data like this awesome tanker and she has this Pachube feed Cool.

The biggest thing with ships is a limited amount of variation in speed. Which makes testing really really boring. So having overlooked perhaps the largest contributor of data to Pachube, namely weather monitoring stations, I changed my plan and started to monitor the wind speed of a place in New Zealand.

The system is really simple. I get data from Pachube using their API with a simple python script this then talks via the serial port to the Arduino and changes the position of the gauge. Simple.

I’ve put all the code up on GitHub at

The code is simple but could benifit from additional error handling if you plan to use it properly. The Arduino code is based on code from Maurice Ribble

In terms of hardware I haven’t posted a diagram because it is really simple. I power the Arduino over USB. I share a ground with an external 5v power supply to drive the servo and connect one signal write between the Arduino and the servo. I actually have a Netduino so I’m going to make an ethernet controlled dial very soon.

I might try making other variants of the gauge at some point in the future because I’m hooked on Laser Cutters now.