This clock uses a minimalist design constructed in the shell of an old hard drive. A DS1307 Real Time Clock (RTC) module keeps accurate time while an ATMega328 (with Arduino bootloader) microcontroller determines which LEDs should be lit to display the current time in binary.
Ever since receiving my binary watch a while back, I've wanted to make a desk clock version. As this is my first crack at one, I thought I'd keep things basic and make it simply tell the time. No alarms or other fruit.
As I have an abundant supply of old hard drives, I went the upcycling route and used one for the enclosure. Should add to the clocks nerd cred as well which can't hurt.
You typically need a torx screwdriver bit to crack open most hard drive cases however you can bust out some dodgyness and use a flat head if need be.
The only parts to be re-used were the body and cover of the hard drive however there's also some handy rare-earth magnets that can be salvaged.
I marked out a grid then punched and drilled the holes. This is a common LED arrangement for DIY binary clocks. The left two columns represent the hours and the right ones are minutes.
Each LED is installed and secured into place with a bit of hot glue. All the LEDs negative legs are soldered together creating a common ground connection.
A colour coded wire was soldered to each positive connection then insulated with another healthy dob of hot glue.
I had a couple of ATMega328 microcontrollers with arduino bootloaders (can be programmed by an arduino) so I breadboarded out a functional arduino (hackduino) and tested it with the standard blink sketch. This excellent instructable by user "jmsaavedra" provides nice clear instructions on building your own hackduino.
A more permanent solution was then made on some protoboard with the RTC, outputs for each LED with a resistor in series, 7805 5V regulator and the other supporting passive components. I've included the arduino schematic below:
The LEDs were too bright with my original resistor values and the green LEDs were slightly brighter than the blue so I had to do some adjusting for the final schematic. You can reference the graphic below to determine how each pin on the ATMega328 and ATMega168 correspond to the Arduinos pinout.
Once everything was connected up, I let it run naked for a couple of days to make sure everything was sweet. A spare 9v wall wort provides enough power for the unit.
The RTC will remember the time for approx. 10 years on its own battery and it will draw juice from wall power when it's available. The arduino sketch uses the Adafruit RTC library to interact with the RTC module and ask for the current time.
The sketch then takes those values and calculates which LEDs should be lit to display the current time in binary format. You can download the code here.
As the hard drives enclosure is conductive, both sides of the board are insulated with electrical tape and I used dobs of hot glue for any other exposed bits. Now it's time to screw the cover back on and plug her in to make sure it all still works.
I may elaborate on the design down the track to add other standard clock features like an alarm, snooze etc.