The amazing MQTT-enabled ducks!

This is a guest post by Hursley’s Chris Phillips (aka @cminion on Twitter). Take it away, Chris… and you’ll find more from him on his blog.

flashyduck-300x225

Many eightbar readers may have received one of those gadget catalogues you get through the door, with weird and wonderful widgets to ostensibly help with everyday life. “How have I ever coped without a Wifi Fondue set?” and similar thoughts may have run your mind. However, one thing these catalogues aim to promise is the integration of technology into everyday life; the dream that if technology is pervasive enough, it could remove all those little annoyances that we experience: forgetting a recipe, not knowing when our friends are turning up at the pub, having to get up twice to make a cup of tea, and so on… missing a phone call, because the phone is not loud enough, or set to vibrate, or other such vagaries of the modern telecommunications device. If only one could make a normally unobtrusive device that would alert one to a phone call, or a doorbell, or a new email, in fact pretty much anything!

Back in January I made some MQTT ducks. The aim was to make them flash on or off when receiving signals from my Ubuntu server.

Now, you may wonder why I would want 20 rubber ducks to flash when my phone goes off. Well, this was about the same time as I decided I wanted to make a unobtrusive alerting device. There is no scientific or technical reason in itself. I just had a Mini Cooper’s worth of rubber ducks sitting around, unemployed. Therefore I designed a simple project to get to grips with the world of Arduinos not only educating me but also putting the lazy mallards to use. I found some cheap fairylights just before Christmas and had the aforementioned large supply of rubber ducks (as you do).

Components

  • 1 x Freeduino
  • 1 x 20 LED Fairy lights (£3)
  • 1 x USB Printer Cable (via theattick.tv)
  • 20 x Rubber Ducks

IMG_5145

Tools

  • GlueGun (£1.50 from Woolworths during the closing down sale)
  • Scissors

The construction was very simple. Making a small hole in the bottom of each duck, I inserted an LED and glue gunned it into place. I checked the effect with the batteries to see the result.

1097743

Removing the battery component with a pair of scissors and stripping the wire coating revealed the multi-core ends. These were plugged into the digital pin thirteen and the digital ground on the Arduino. To confirm the wires were plugged into the correct pin I pressed the reset button. The ducks and LED thirteen on the Arduino would then quickly flash.

IMG_5148

Coding for Arduinos is very basic. The program I wrote received a 1 or a 0 down the USB cable. When it received a 1 (49 in ASCII) it turned the ducks on. When it received a 0 (48 in ASCII) it turned them off.

int LEDPin  = 13;
int inByte =0;

void setup() {
    pinMode(LEDPin,OUTPUT);
    Serial.begin(9600);
}
void loop(){
    if (Serial.available() > 0) {
      inByte = Serial.read();
      Serial.print(inByte);
    }
    if (inByte == 49 ) {
      digitalWrite(LEDPin,HIGH);
    }
    if (inByte == 48 ) {
      digitalWrite(LEDPin,LOW);
    }
}

To connect this to my Really Small Message Broker using MQTT, I modified an excellent & simple Perl script written by Andy Stanford-Clark. His script reads RSMB topics for specific entries. I created a listener that watched for messages being passed on to the Ducks/ topic. If the content of the message was on it sent 1 down the wire to the Arduino, and if it received off it sent 0.

Next move… well someone at Pachube put forward the idea on Twitter of controlling with their infrastructure. Now, I can send an on or off message to a Pachube feed using Twitter. My server at home then checks this feed every 15 seconds for any changes and sends a message to my RSMB as required.

Thanks to the guys from http://greatduckcaper.com/ for providing their leftover ducks and theAttick.tv for providing the USB cable!

Comic Relief, digital red nose

The rednosin twitter account made me aware of the excellent addition to the comic relief donation options. That of buying a digital rednose picture. Whilst many of us can bolt a red nose onto a picture that is not the point. The ability donate and join in with the excellent charity that is Comic relief is something we should all do. We use avatar pictures all over the place and you will see twitter full of them next few days. Check out Rednosin Chinposin so see more
So what are you waiting for! It works for Graham Norton :0)
Graham Norton

Blue Fusion at Hursley, 2009

One of the first Hursley-related things I wrote about here on the eightbar blog back in 2006 was how much I enjoy helping with our annual schools event for National Science and Engineering Week in the UK – Blue Fusion (the event website has gone AWOL at the moment but here’s a link to the press release).

This year was no exception. This is now the fifth year that I’ve been a volunteer. Unfortunately I only had room in my schedule to spend one day helping this time around, so I choose to host a school for the day rather than spending all day on a single activity (that way, I got to see all of the different things we had on offer).

So, yesterday I had the pleasure of hosting six intelligent and polite students from Malvern St James School and their teachers – they had travelled a fair distance to come to the event, but despite the early start I think they did really well.

I won’t go into too much detail and spoil the fun for people who might read this but have not yet taken part in this week’s event, but I think we had some great activities on offer. I twittered our way through a few of them. My own personal favourite was a remote surgery activity. You can’t see much in this image (it was a dark room) but the students basically had a “body” inside a box with some remote cameras to guide their hands around and had to identify organs and remove foreign objects.

img_3774

There was also some interesting application of visual technology / tangible interfaces – a genetics exercise using LEGO bricks and a camera which identified gene strands, and an energy planning exercise which used Reactivision-style markers to identify where power stations had been placed on a map (sort of similar to what we built in SLorpedo at Hackday a couple of years ago). We also had some logic puzzles to solve, built a, err… “typhoon-proof” (ahem) tower, simulated a computer processor, and commanded a colony of ants in a battle for survival against the other school teams.

Once again, I thought this was a great event – just amazing creativity on show from the folks at Hursley in coming up with such engaging exercises. I hope the students had as much fun as I did!

Eightbar featuring on Metanomics

I thought that those of you who read this blog might be interested to know I am appearing live on the Metanomics show this coming monday. Whilst I am appearing in my role as Director of Feeding Edge Ltd the conversation will be about how I see the industry going from IBM’s and corporate enterprise perspectives, how eightbar has been something that many of us have a deep affinity for, some talk of 3d printing and maybe a few surprises.
metanomics logo
There are plenty of ways to attend, and full transcripts and videos afterwards.
I was at rehearsals for it yesterday and the operation itself is certainly leading the way on Second Life shows.
See you monday.

Virtual worlds and enterprise case study

Dave Kamalsky of Linden Lab (formerly of IBM Almaden) pinged me to point out that they now have a new blog called Working Inworld. Now, I wouldn’t usually repost this kind of thing, but one particular post that caught my eye was the joint IBM / Linden Lab case study on the IBM Academy of Technology events that were held in Second Life. It’s a very nice paper, worth taking a look at for some of the figures and business aspects around how best to make use of these kinds of spaces.

Oh, and there’s an interesting concluding comment:

After holding the Virtual World Conference and the Annual General Meeting in Second Life, the AoT agrees that virtual worlds will have a big impact on business, on IBM, and IBM’s clients. And, the best way to learn about virtual worlds is to use them – which IBM is now committed to doing.

This made me smile… no kidding… some of us have been around in this space for quite a few years now… in fact, I was reminiscing about my avatar’s brief TV appearance in an in-world business meeting 2 years ago, only the other day 🙂

Sametime 3D unifies IM and virtual worlds

In the “nothing new to eightbar readers” column – we’ve talked about this before and it was showed at Lotusphere 2009 – it looks like the Sametime 3D platform is now available for test by selected IBM clients.

We don’t usually “do” press releases on eightbar, but this one is particularly interesting as it develops from trends we’ve talked about here for a long time, and has potential connections to both Second Life and OpenSim. More integration of the 3D Internet / virtual worlds into the enterprise.

Update – here’s some more from Slideshare: