HOMEBREW My Train-Schedule Alarm Clock By Greg McCarroll
It was a cold winter morning and I was the Blu Tack-filled base of a Lego brick, made with
sitting on an even colder bench on a railway plat- the microswitch of the mouse). The snooze connects
form in London, cursing myself for hitting snooze. by a long cable to my Linux workstation, my old
Because of that moment of weakness, I had to wait alarm clock, an AirPort Express, and a program
around for the next train. Did I mention it was cold? quickly hacked together in Perl.
So I started thinking about solutions — after all, The program was made a lot easier by using
I had time to kill. A 30-minute snooze function? No various bits of code from CPAN ( cpan.org) where
good, the gap between trains wasn’t always 30 min- possible. (I even managed to give a little back by re-utes. Any alarm clock would have to be aware of the leasing the module that I wrote to screen-scrape the
railway timetable, or better still, be aware of delays. train information.) To be honest, it was just a simple
That night, I thought about what I’d need to build state machine that slept until it got close to wake-up
such an alarm clock. I could figure out how to do time, then started monitoring the departure boards.
almost everything: the snooze button, the music to So I now have an alarm clock that wakes me a
wake me up, the web lookups — but I couldn’t figure little later if trains are delayed, and works out the
out how to easily build a display for the current time. length of time to let me snooze based on the next
A couple of weeks passed until I ended up at a din- departure needed to get me to work. Best of all, my
ner party talking about the idea. A friend, Kate Pugh, employer agreed that if all the trains were canceled,
pointed out the obvious — I already had an alarm the clock would email my workplace that I’d be
clock with a display, so why not just use it? working at home, and let me sleep in.
The very next day, I built a new alarm clock that
has a snooze button made mainly from Legos and
an old mouse (my favorite bit was the wonderful
contact that a thumbtack, pushed upside down into
Photograph by Greg McCarroll
Greg McCarroll is a Perl hacker living in London with his wife,
Ron, and cat, Hobbes. He loves technology that makes
people’s lives better, even if better means more time sleeping.
192 Make: Volume 11