Hack-Ready Alarm Clock

An alarm clock that encourages tinkering and modification. Targeted for kids, but fun for old hacks like myself.

Similar projects worth following
An alarm clock that welcomes modification. The display is intentionally limited to a 1.2" 7-segment LED panel, but includes a speaker for audio playback and a Lego enclosure. The main goal is to create a platform that kids young & old alike will have fun monkeying with.

I believe that people (both kids/teens/adults) are more inspired to tinker after they learn the basic framework of what they are tinkering with. Electronics and circuit sets are great, but it really helps to jump-start learning with demos or projects that are heavily documented in the box. After you get your bearings on what works and what breaks, you are more free to experiment and add your own ideas.

To that effort I'm working on a hackable alarm clock based on the Raspberry Pi platform along with several Adafruit/Sparkfun components. The idea is that we can build a customized, tricked-out bedroom alarm clock with some general off-the-shelf components to see how hardware and software work in concert to create something useful. After the project is done, I'm hoping its creators will feel inspired to rip it apart or build new features using the pieces.

Even the enclosure (actually, especially the enclosure) is meant to be an original creation. This should be something you are proud to show off, and have the confidence to extend.

The construction of the hardware and the software will be walked through in phases, gradually building from a simple digital clock to a pushbutton alarm clock that wakes you with your own music and tells you the current weather forecast. Over the span of ten or so lessons, we will build the hardware from a Raspberry Pi and Adafruit LED backpack and create a clock "driver" in Python. No software needs to be installed - the main event loop is easily edited within an HTML interface that ships with the project.

View all 12 components

  • Supports Raspian Stretch

    DeckerEgo09/26/2017 at 00:41 0 comments

    I've migrated the build & Debian package to support Raspian Stretch - this is now the default platform to install on. Let me know if you experience any problems!

  • Now with IFTTT and Streaming Music Support!

    DeckerEgo02/08/2017 at 04:02 0 comments

    Version 2.1 of the Hack Clock now provides IFTTT event publishing support - so you can fire off events at IFTTT! Turn on your bedroom lights when the alarm goes off!

    I have also added Google Music (unofficial) support. If you provide your username/password in /etc/hack-clock.conf, you can stream "I'm Feeling Lucky" radio!

    Version 2.1 is likely going to be the last minor release for a little while, and instead I will be focusing on bugfixes.

  • Hack Clock v2 Released!

    DeckerEgo01/31/2017 at 02:06 0 comments

    Hack Clock version 2 is finally out as a stable release! Thanks for everyone's input to help make this happen.

    Tutorials, how-to's and release links are available at

  • Version 2 is Almost Done!

    DeckerEgo01/27/2017 at 03:07 0 comments

    Version 2 has entered final testing! All the lessons are there, the lessons have been tested & I the new hardware is considered "stable." Releases are at and the page is still at . Let me know if you have any issues - likely we will post v2 on the 29th!

  • New Lessons & Website Out!

    DeckerEgo01/24/2017 at 00:41 0 comments

    The revamped Hack Clock site is out! Visit to get block-based programming lessons as well as Python lessons.

    Currently the first four lessons have been posted, and I have two or three left to go. Soon v2 of the Hack Clock will be released as well - almost there...

  • Features for Version 2

    DeckerEgo01/12/2017 at 02:30 0 comments

    Alright - we're in the home stretch for Version 2 of the Hack Clock! There is a final feature list, which includes:

    • Blockly programming (program using blocks, not Python)
    • Support for Raspberry Pi Zero
    • Full Raspian support (including latest wiringpi)
    • Multiple buttons allowed (simultaneous GPIO input)
    • Flip switches on/off (simultaneous GPIO output)
    • Debian package installation
    • Full tutorial set
    • New lessons (music lover, weekday-only alarm)
    • Move from stereo headphone jack to I2S audio
    • Cheaper total bill of material (roughly $70.70, down from $95.85)
    • Lotsa bug fixes

    If you'd like to try the beta release - get the latest from GitHub!

  • Blockly Editing Now in Beta!

    DeckerEgo01/04/2017 at 02:42 0 comments

    Coding with blocks (using Blockly) is now available in master! The option is disabled by default, but if you change the following settings in webapp/ to:

    'default_editor': '/blocks/edit',
    'disable_editor_button': False,

    ...then you will be able to code your alarm clock using drag-and-drop blocks in a Blockly IDE! Click the right-most button above the editor, and you can switch back and forth between blocks and the generated Python. Saves and restores should work for both Blockly and Python as well, so it is easy to restore old files if you make a mistake.

    Feel free to try it out and provide feedback if you find something inane!

  • Moving from CodeMirror to Blockly?

    DeckerEgo12/06/2016 at 02:12 0 comments

    I'm working on moving the primary IDE of the HackClock from CodeMirror's Python editor to the Bring Your Own Blocks-style of Blockly. I really like CodeMirror's JavaScript editor, however I found that kids generally learn just enough Python to get things working and then lose interest. Kids do keep with Scratch (or ScratchJr on iOS) however, so I think the block-based editing approach may make sense here.

    Initial testing has already begun, with the blocks parsing into analogous Python scripts on the back-end. I may allow CodeMIrror and Blockly IDEs to be interchangable, with CodeMirror being the "advanced mode." We'll see how the prototypes turn out.

  • Getting Ready for Version 2!

    DeckerEgo09/28/2016 at 03:00 0 comments

    I'm working on v2 of the Hack Clock, this time hopefully using the RaspPi Zero and the much more streamlined Adafruit I2S amp breakout. If you re-use some existing USB hardware, SD cards and spare wire, that means the total build could be less than $32. Not to mention the build would have a lower footprint.

    I'm also hopeful that I2S proves more stable than the PWM -> audio jack on the Model A.

    Draft parts list is at

  • Now will auto-save & restore backups!

    DeckerEgo08/13/2016 at 19:11 0 comments

    One thing I found while using the Hack Clock as a teaching tool was that the kids are a whole lot anxious if there is an easy way to backup your work and restore quickly to a working version. For that, I've created an initial implementation of backups and restores within the Hack Clock interface - just hit the "load" button in the code editor and you will be presented with a list of backup points. Restore one and it will load it up within the code editor.

    Much less stress for everyone, and a more fun way to experiment safely with changes!

View all 18 project logs

  • 1
    Step 1

    Setup your Raspberry Pi, installing the N00Bs operating system and connecting to your local network

  • 2
    Step 2

    Solder together the Adafruit I2C backpack and the 7-segment LED display

  • 3
    Step 3

    Using various colors of jumper wire, connect the 7-segment backpack to the Raspberry Pi's as described in

View all 9 instructions

Enjoy this project?



hberg32 wrote 03/25/2015 at 09:45 point

Hi - your project caught my eye when I recognized that 7 segment display.  I'm using the same one on my own alarm clock project:

Which text-to-speech software did you decide to use?  I'm using Pico but it has one bad habit in that she pronounces a time string like "8:05" as "8 5" instead of "8 oh 5".

Did you stick with the Adafruit sample code to run the clock display itself or roll your own?  I'm currently running with the example (though with a few lines added to consult a photo cell and set the display brightness) but I may try to merge it into the main loop of my alarm program.  I'm not sure, my main loop code is debouncing both a button connected to GPIO and values returned via i2c from an analog pressure sensor connected to an ADS1015 and the code got... ugly (even by Python standards).

  Are you sure? yes | no

DeckerEgo wrote 03/25/2015 at 13:17 point

Nice build! We haven't decided on the TTS yet - I agree it's hard to find something as nice as the TTS that comes with OS X. Still searching before I add that in, but it is definitely something I want to do soon.

For the clock driver, I included Adafruit's library with the package but then created a facade over it at . The colon and evening delimiter didn't appear to be individually addressable, and I wanted the lessons to focus on setting hour/minute indicators rather than just setting digits.

The event loop was just part of the base "clock" at , with function callbacks at given intervals. I'm not happy with this setup however, since it does make the clock harder to shut down & restart cleanly. This is a big deal for the hack clock since it includes a web interface to modify the code and re-starts itself once the "main" code has been modified, so I'm going to be writing a different event loop fairly soon.

Button interrupts aren't too bad - just a function callback within

Thanks for following the project!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates