So, a few weeks ago I got a PiFace for my Raspberry Pi.

The PiFace is a clip on extension board for the Raspberry Pi which, together with the free library software, makes it super easy to control various real-world inputs and outputs – turning things on and off, and sensing whether switches have been pressed.

Pretty cool, but unfortunately due to my work load, and an ever growing to-do list, I had so far not had the time to play with it at all. However, a recent sports injury forced me to stay at home for a few days, and since I couldn’t really move (or indeed, put on my own socks), I decided to use this as an opportunity to play.

My first bit of tinkering was to see if I could wire up and take advantage of the 8 software controllable outputs exposed by the PiFace. These outputs consist of 9 connectors, the first of which is a 5 volt power line, and the other 8 being the ends of an open collector.

The Circuit

I am not an electrical engineer, so this is all brand new ground for me, and that is enough of a reason for me to find it all terribly exciting. These first bits of hardware hacking giving me the same thrill of figuring something out and getting something to work as when I wrote my first software programs all those years ago!

Anyway, the circuit is a simple one, and consisted of a breadboard with 8 leds connected in parallel with the 5 volt power rail on one side and the open collector terminal on the other. The back of the packet my LEDs in also noted that a resistor of 330 ohm should be used in series with the led when connected to a 5 volt power supply in order to avoid burning them out.

Experiment1

The Software

As a proof of concept, I wrote a bit of software to cycle through and turn each light on for a second, before turning it off and turning the next one on. Nothing too fancy right now!

The Finished Article

So, here’s my first experiment in action…


Like I said, I’m not an electrical engineer so this is hardly the Starship Enterprise, but I learnt a lot!

Current-CostThe current cost meter is an electricity monitoring device which attaches to your house’s electricity meter. It gives you a read out of how much electricity you are using at any given time, and how much that electricity is costing you.

One of the cool things about the Current Cost meter, verses other meters which are out there, is that it includes a data cable. This cable attaches the meter to your computer, and you are able then to extract usage data, very simply, over a serial connection.

So, riffing off the weather display tool I wrote a few weeks ago, here is a quick tool for extracting electricity usage data from your Current Cost meter, and outputting it in a customisable format. The tool is tested on Linux against a Current Cost EnviR, but it may well work with other meters in the range.

Since the first step towards any form of optimisation is to collect data, my plan is to use this tool to graph my electricity usage over time, and hopefully reduce my running costs a bit. Anyway, code up on GitHub as usual!

» Visit the project on Github…

In a previous post I wrote about a little bit of software which let you extract information from the output of the Weather Display weather station software.

Lately, I’ve been playing around with munin a fair bit, so I thought it’d be pretty neat to combine the two, and have munin keep an eye on my local airfield and monitor the winds, pressure and temperature. So, I had a quick skim of the plugin writing tutorial on their wiki, and bashed together some munin plugins.

Writing plugins for munin is actually remarkably straightforward, and very quickly my computer began generating some very pretty graphs…

wdwind_www_enstoneaerodrome_co_uk-day

wdtemp_www_enstoneaerodrome_co_uk-day

wdpressure_www_enstoneaerodrome_co_uk-day

* The outside temperature sensors at Enstone seems to have run out of batteries, hence the rather odd reading.

Hope this is useful to someone, code in the usual place!

» Visit the project on Github…