Saturday, March 26, 2011

Pubbers & Subbers, Putters & Getters, Movers & Shakers - and Purple Hearts!

Sometimes the best made plans fall apart - due to circumstances beyond one's control. As a result of missing the postman at 8:13 this morning, my component order has gone back to the Royal Mail depot - and not retrievable until 7am on Monday morning - doh. Time to get a louder doorbell!

That rather put a kybosh on any new hardware developments this weekend. Instead, I thought I'd dust down some of the hardware I developed for the prototype ethernet node back in August last year and get re-aquainted with firmware which allows it to communicate via Pachube.

The first Arduino/Ethernet node was built on breadboard from 3 ICs (Atmega328, ENC28J60 and 74HC125) and about 35 other components. With a little care, the design will fit on a single standard, 63 strip breadboard, and cost about £12 in components to make. The Nanode is just a compact PCB version of the original prototype, designed with through hole components to make it easy to build at home.

Firstly, I thought I'd look back over the simple Publisher/Subscriber code I wrote for the prototype Nanodes about 8 months ago and have a go at getting the breadboard ethernet hardware running again - see above.

The strategy is based on the simple model that one ethernet connected device publishes a string of data to a Pachube feed, and that multiple nodes can subscribe to that feed and make use of the data.

The simplest Pachube feed is a comma separated array of values (CSV), so the publishing device - the "Putter" has to put out a CSV string of arguments, and the subscribing device, the "Getter" has to be able to subscribe to the given Pachube feed and get the CSV data into a form where it can do something with it.

I have dusted down the "Etherduino" breadboarded ethernet connected Arduino ( see August 2010 posts for details) - and this is acting as my "Getter". A standard Arduino and ethernet shield is acting as the "Putter".

The first test is to ensure that a simple message of say 6 comma separated arguments can be passed seemlessly from putter to getter. So far, so good - my getter is printing out the serial CSV string to my monitoring serial port every few seconds. Now to come up with an interesting demonstration application which involves some moving and shaking.

Back at Homecamp in April 2009, I showed a very simple use of a radio control servo with a coffee-stirrer glued to the servo arm, which was used as a large scale analogue meter. The Arduino can drive the arm to any angle from 0-180 degrees, and use the coffee-stirrer pointer to point to any chosen value on an A4 sized graphic. The great thing about servos is that they buzz when they move, and this attracts one's attention to the fact that something is changing.

Another easy hack is the use of low cost LED lamps to make colour changing "ambient orbs" to visualise a physical parameter - such as temperature or electricty consumption. A recent sale at Homebase and I bought 4 lamps for £10, including Heart, Orb, Cube and Star. From chilly blue to toasty red orange, and optimum green when the room temeperature is at its best.

A combination of the servo and RGB LED "ambient orbs" might be a good set of visual demos for the forthcoming Pachube Hackathon.

No comments: