Pi Zero Binary Clock

Introduction: Pi Zero Binary Clock

About: I'm Frederick and I build electronic things, mostly with Raspberry Pi. Using my 3D printer, CNC machine or hand tools, I make custom frames and enclosures for my projects. These projects are a way for me to ...

I’ve had a Unicorn pHAT sitting in a box for a while, but I finally used it in a simple project. Because it has four rows of LEDs, I thought it would be ideal to make a binary clock from.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Electronics

The electronics involved in this project are limited and practically plug-and-play: A Raspberry Pi Zero and a Unicorn pHAT. The main twist here, is that instead of soldering a set of regular headers on the Pi, I used a set of right angle headers, resulting in the pHAT facing forward rather than up.

Step 2: Software & Code

The code for this project is very straightforward. It takes the time, converts it to binary and displays it on the LED matrix. By editing the code, you can change the color of the LEDs.

Code on github. Download the script and save it on your Pi.

Some other things need to be configured properly as well:

* time zone: pi@binaryclock:~ $ sudo cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime
*
unicorn phat: pi@binaryclock:~ $ curl -sS get.pimoroni.com/unicornhat | bash
*
run at startup: pi@binaryclock:~ $ sudo crontab -e
...
# m h dom mon dow command
@reboot sudo /home/pi/binary.py

Step 3: Enclosure

The enclosure consists of two elements: a white acrylic body and two wooden end caps. The acrylic hides the electronics, while still allowing the light of the LEDs to shine through.

The end caps were carved using a CNC, and the edges rounded using a router, though similar results could be achieved by cutting small blocks with a saw.

The acrylic strip was cut from a bigger sheet. By scoring a straight line with a sharp knife, it's possible to snap the sheet along the line. Using a small torch, heat was applied to the strip to make it fold along the heated line.

Step 4: Assembly

With the enclosure parts ready, the electronics can be fitted inside. I used a strip of double sided tape to attach the Pi Zero to the acrylic. To ensure the LEDs remain as close as possible to the acrylic, hot glue was used to hold them in place.

Once the electronics were fitted, the wooden end caps were mounted on the sides. As the connectors remain accessible at the back, power can easily be applied.

Step 5: Video

That's it, this is how I built this binary clock using a Raspberry Pi Zero and Unicorn pHAT. If you would like to see the building process in a more dynamic way, check out the video!

Make it Glow Contest 2016

Runner Up in the
Make it Glow Contest 2016

CNC Contest 2016

Participated in the
CNC Contest 2016

Homemade Gifts Contest 2016

Participated in the
Homemade Gifts Contest 2016

Be the First to Share

    Recommendations

    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Finish It Already Speed Challenge

      Finish It Already Speed Challenge

    6 Discussions

    0
    ProstetnikJeltz
    ProstetnikJeltz

    3 years ago

    Can't find the repository on github.

    Has it moved or was it deleted ?

    Greetings from Munich Uli

    0
    Frederick Vandenbosch
    Frederick Vandenbosch

    Reply 3 years ago

    Hi, I just tried and the link works for me. Could you try again?

    https://gist.github.com/fvdbosch/11ccbbda153a8e4ea8d7230df79dad65

    0
    ProstetnikJeltz
    ProstetnikJeltz

    Reply 3 years ago

    Hello Frederick,

    thank you for the quick reply.

    The link obviously doesn't work at my office only, there are probably some restrictions with https, I never noticed before.

    The confusion was triggered by a message from Browser ( FF ) that the target of the link doesn't exist, sorry for that ;) .

    I tried it with the smartphone now and it works.

    Hope to be able to show the results soon ;).

    Greetings Uli

    0
    zposner
    zposner

    3 years ago

    I really like the endcaps