Mon 1 Jun 2009
Last weekend I went to the Howduino hack day which by good fortune was happening on my doorstep, in Liverpool. The day was organised by two friends of mine – Adrian McEwen and Thom Shannon – who have been doing hardware hacking for quite some time now and wanted to open things up for more people to get involved.
The day was partly named after Arduino (with a bit of Scouse humour mixed in – “how do we know?!”). From their website:
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software.
Basically you get a circuit board that has a USB slot, a power slot and a set of digital and analogue inputs and outputs. You can load software onto the circuit board via the USB slot, the software can then run on the board when it is disconnected from the computer and can operate other hardware through the inputs and outputs. Adrian used one of these devices to make the famous Bubblino twitter monitoring bubble machine and the Mazzini power monitoring project. Thom has used it to make, amongst other things, a light tracking mini.
Though Howduino got its name from the Arduino boards, the day was actually more of a general hardware hacking event. Sophie Green spent most of the day making artworks using “brush bots” which were incredibly simple devices made from motors and batteries mounted on toothbrushes. Some people built a “drawbot” from scratch on the day and a few people tried making racing radio controlled cars with movements controlled by twitter hashtags.
My project was suggested by Grant Bell, he thought that I should use mapme.at to create a “Weasley Clock”. This clock is described in the Harry Potter books by J.K. Rowling, it is used by the Weasley family to see where each member of the family is. Instead of telling the time, each hand shows a photo of one of the family members, the clock face has a number of locations written around the edge, such as “Home”, “Travelling”, “School”, “Holidays” and even “Mortal Peril”!
Now one way in which I could’ve handled this would be to create a web page that showed my location on a picture of one of these clocks. That would be fairly easy to do but much less interesting than the hardware hacking version. I started off by getting hold of an old clock. My Dad has been tinkering with and fixing clocks for years, and often gets given old clocks and told “This stopped working years ago, thought you might like it” so fortunately he has a few lying around and gave me this one:

I spent a morning taking it to pieces carefully and working out how it worked, until I pulled the back off it and the chime spring caused an explosion of gears:
I then took all the bits to Howduino together with a stepper motor that I’d taken out of a floppy drive. After a short while working with Aaron from Oomlout we managed to get the stepper motor going but then I had the problem of connecting the motor to the clock. After many hours of trying to glue and solder the small stepper motor on I finally decided to ask around to see if anyone else had stepper motors. Fortunately someone did, a much bigger motor that could fit through the black of the clock mechanism and unbelievably had a gear on that meshed perfectly with the gears in the clock. With the application of some super glue and a few pieces of metal “salvaged” from an old printer I got the motor attached and turning the hand reliably:
Once that was done I had to write some software. The software for moving the clock is fairly simple. As the motor is a “stepping” motor it can be controlled very reliably. One step of the motor moves it by a well defined amount, with the gearing from the clock 150 steps of the motor turns the minute hand around in a complete rotation, meaning 12 × 150 = 1800 steps will turn the hour hand around completely. I knocked up some Arduino code that reads the current location of the hands from the EEPROM memory on the Arduino. To reset it I manually move the hands to “midnight” and zero the EEPROM memory. I can then tell the Arduino to position each of the hands by an hour. As the hands are still geared together I can only put the hour hand between one hour and another, while the minute hand can be precisely positioned. When the clock has moved to the position you’ve requested, it saves the new location of the hands to the EEPROM memory again so that it’s safe to be powered off.
To get my location I’ve knocked up a MapMe_At class which can request the location for a user. It makes a HTTP request to mapme.at, using the Arduino Ethernet Shield, pulls down the location and uses a very lightweight JSON parser to pull out the label for the favourite location that I’m currently at. From my core code I then request the location of two users from mapme.at every minute, convert that location to a position on the clock and then move the hands. When it works it looks really good, I’m only running the clock forwards at the moment because some of the gearing for the chime is still there and makes funny noises if I run the clock backwards, this means that it can take nearly a minute for the hands to move but considering it’s unlikely for location changes to happen that often this should be fine. I do seem to have a problem whereby the clock stops working after running for a while so I’ll have to do some debugging, but as you can see from the photos and the video it is looking pretty good at least!
(Unfortunately hardware hacking can have its casualties, as you can see the glass on the face of the clock was one)
I’ll be taking the clock along with me on the next Tech Bus Tour from London to Liverpool. I’ll be updating the face to show our progress between the locations as this should be more interesting than showing that I’m “Travelling” constantly. I’ll also open source the Arduino source code when I get around to tidying it up.
UPDATE 2009/01/04: The code is now available on github, I haven’t had time to fully clean it up and add comments throughout but hopefully it’ll be useful anyway. Download the code here.





June 2nd, 2009 at 8:15 am
[...] John McKerrell has blogged about a hardware hacking project he recently created mashing his location up with an old fashioned clock using an Arduino circuit board. The “Harry Potter” style Weasley clock has the names of favourites shown on the face of the clock and the hands of the clock move to point at his current location. Take a look at the video below or head over to his blog for more information. [...]
June 10th, 2009 at 6:09 pm
sweet! this is exactly the kind of thing I’m looking to hack as well. can you publish your code soon?
June 29th, 2009 at 3:48 pm
any update on the software? can you publish it?
July 13th, 2009 at 12:44 pm
My Harry Potter geek of a girlfriend thinks that is very cool, but wonders where the mortal danger function is.
July 19th, 2009 at 11:57 am
@Stuart – I had intended to have a “Mortal Peril” segment which I could customise but I guess it might not get too much use (hopefully!)
September 4th, 2009 at 6:46 am
[...] Potter fans should recognize John McKerrell’s Weasley Clock right away. He replaced the brains of the clock with an Arduino fitted with an ethernet shield, and [...]
September 4th, 2009 at 7:23 am
[...] Potter fans should recognize John McKerrell’s Weasley Clock right away. He replaced the brains of the clock with an Arduino fitted with an ethernet shield, and [...]
September 4th, 2009 at 10:21 am
[...] Potter fans should recognize John McKerrell’s Weasley Clock right away. He replaced the brains of the clock with an Arduino fitted with an ethernet shield, and [...]
September 6th, 2009 at 6:18 pm
To get the position, do you use mapme.at/where/? Is the user location public or do you log in and store the cookie on the Arduino?
Cool project
September 6th, 2009 at 6:27 pm
@Stewart – glad you like it. mapme.at has an API that serves JSON, I use that to get my location. Because I’m parsing the text of the favourite I don’t have to make my full location public so the Arduino doesn’t have to log in, but can still find which favourite I’m at.
You can find more information about the API here: http://blog.mapme.at/developer-api/
September 6th, 2009 at 7:27 pm
I must be missing something – tried the where.json api and while I’m logged in I get my location back. If I log out, I get “cannot find specified user”, presumably because my cookie isn’t valid. Adding ?usernames=an_example_username doesn’t help. Hence the thought that you must be exchanging a cookie from the Arduino board
November 11th, 2009 at 10:53 am
[...] Johns blog to read how he has built a working Weasley clock using a Arduino kit, mapme.at and great [...]
November 23rd, 2009 at 9:37 am
[...] my favourite talk of the day was John McKerrell, talking about mapme.at, with his geo-clock (if you’ve read Harry Potter, remember the Weasley’s clock, with hands for each member [...]
November 29th, 2009 at 4:13 pm
Hello John,
I very much like your idea. Could you send me the Arduino Sketch over? I’m an Arduino newbie and I’m making my first steps in parsing information from the web. Your Sketch could be very helpful to me!
Thank You Very Much!
Till
December 31st, 2009 at 7:38 pm
Hi John,
Love your work, could you please share with us the code (I’m especially interested in the ethernet shield-part of the code)
Awesome project,
-m
February 1st, 2010 at 7:10 pm
[...] amazing Weasley Clock Arduino, Stepper Motors, Weasley [...]
June 7th, 2010 at 8:48 pm
[...] current GPS craze, how hard would it be to create one’s own real life clock? A bloke at Blog What I Made goes through all the details, and there are several videos of deconstructed clocks in various [...]