Building a binary clock
A couple of years ago I wanted to try out some iot-related stuff. I bought a couple of Arduino-boards and some random components and started fiddling around. At first I started out by trying some experiments such as temperature controlled LED lights and blinking stuff that reacted to sound. After this I wanted to get my feet wet and actually build something, preferably geeky, not necessarily very useful. Binary clocks have been an interest of mine for years. They kind of force you to take a step back and reflect on time, what time is, what is time and so on, and maybe slow down the frantic pace of modern life for a few seconds. Or not, but I like them anyway!
The digital hardware
Initially I used an Arduino UNO board and some prototyping boards. This combined with a clock chip (DS3231) gave an accurate digital clock, even if it was not very pretty. After a few prototyping rounds I settled on Arduino/Genuino Nano and its ilk, I found some cheap versions with the CH340H chipset that worked well with Arduino Studio.
A bunch of 5mm LED lights in various colors and brightness values, some resistors and a lot of wiring and I actually had produced something that did something. The low power diffused LEDs were really nice, although the blue is a bit sharp. The green 15000mcd ones are horrible – they can only be viewed from a narrow angle, and they tend to blind people despite toning them down with resistors.
The wooden hardware
This needed to go into a box, obviously! Too big for a hand worn watch. I found some spare wood lying around my workshop and enlisted a friend to help out measuring, drilling and sawing, and we built one each. More fun that way – doing stuff together with someone.
We sawed and glued wooden pieces in approximate dimensions into something resembling a box, then we drilled holes just shy of 5mm for the lights. To make them stick we put duct tape on the inside and punched holes in it where the lights were inserted, and they sit quite well in there.
While soldering the parts together we accidentally set off the fire alarm – so proper ventilation is a must next time. Lesson learned 🙂
An attempt was also made to make the whole thing battery powered via 9v, but that lasted for about a day since the lights are constantly on. Thus plugged-in operation (or possibly solar powered) is the way to go.
For this project I didn’t want a ready made solution, so I started out rolling my own. I thought it would be simple enough. At least I was not entirely wrong! The challenges I faced were related to counting ticks correctly (before adding the RTC chip), making sure the correct lights were on at the correct times, and attempting bit shifting operations to improve code efficiency. The bit shift part was abandoned, but I might take that up again. Anyway: all my problems were solved thanks to the RTC chip and the time library. After that, nothing was difficult 🙂
It works! It ticks, blinks and shows the correct time. There is a battery backup for the RTC chip. Also, it is quite a conversation starter – it does not go unnoticed. Some think it is a thermometer, some think it is a (weird) piece of art, and yet others want to try to decipher the time themselves before being told how it works.
I am pleased with the result, especially for a quickly hacked-together prototype, and will continue my adventures.
Fritzing diagram and breadboard layout can be found here.
- Wifi support to enable NTP sync (to avoid having to reprogram it for daylight savings)
- Solar power or a big battery to make it portable
- A really nice box to make it look better
- Proper installation so the electronics don’t fall out when moving the box