Introduction: Pi Zero Binary Clock

Picture of Pi Zero Binary Clock

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.

Step 1: Electronics

Picture of 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

Picture of 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

Picture of 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

Picture of 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!

Comments

ProstetnikJeltz (author)2017-01-17

Can't find the repository on github.

Has it moved or was it deleted ?

Greetings from Munich Uli

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

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

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

zposner (author)2016-12-12

I really like the endcaps

Thanks!

techno man (author)2016-12-11

Amazing work and nice design too

Thanks for posting :)

Thanks for the feedback, much appreciated! :)

About This Instructable

3,144views

69favorites

License:

Bio: 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 ... More »
More by Frederick Vandenbosch:Portable Hot Wire Foam CutterPi Zero Binary ClockSpark Core IoT controller
Add instructable to: