Python/Raspberry Pi: Alarm clock

When I initially got hold of a Raspberry Pi my first project was to play around with some Python scripting to get a feel for how to develop on the RPi.

I wanted to know whether to be be most productive I should be working on files directly on The RPi (i.e. map the folders across my home network) or work on my main development machine and just copy over (only) for testing. I was also interested in seeing how the performance of the RPi held up – very well it turns out!

I still get a a fair bit of traffic to this blog from people searching for alarm clocks for their Raspberry Pi, so I’ve linked the code below. There is no GUI and the file loading (the bit where you can place your alarm times) is currently just a stubbed in function with some test data (5 seconds after you launch the alarm sounds).

I will get around to finishing this someday as it’s clearly something a fair few people want – so I guess I’ll turn it in to a little learning resource for people.

Key points:

  • Heavily commented (i.e. good for learning from)
  • Stripped back Observer Pattern implemented
  • Stripped back Delegate Pattern implemented
  • Headerless setup (also known as “I haven’t done a UI for it” :D)


  • XML Parsing for Alarm datafile loading
  • Weather functionality (Yahoo weather probably, as I’ve played around with this already)
  • Some sort of user interface (probably ultimately exposed for easy extensibility)
  • Hooks for GPIO control

Code here:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s