Skip to content

Raspberry Pi Clock

I’ve been trying to come up with an interesting use for the Pimoroni Unicorn Hat I bought earlier this year.

The Unicorn Hat is an extremely bright 8×8 RGB LED matrix, which fits neatly onto a Raspberry Pi. It’s actually only supposed to work with the newer model Raspberry Pi’s (B+ and newer), which support the new HAT Specification. However, I managed to get it to work with an old model B I had lying around by simply removing the composite socket.

I wrote some Python code using Pimoroni’s Unicorn Hat library and the Python Imaging Library, which assembles scrolling messages using text and images in a simple text format. Then I developed a series of scripts to generate various messages for the system to scroll. These include the time, date, weather conditions and forecast, moon phase, sunrise and sunset times (with a bit of help from the excellent PyEphem library).

My code is available in github as Unicorn Scroller.

Here’s a video of it in action: