### ABC - Almost Binary Clock

Lots of people make binary clocks, but I find the commercially available ones to be lacking in aesthetics. Sure, if you're studio apartment is decked out with black leather chairs and brushed chrome end tables with glass tops you've perhaps got a place for something like this:

These binary clocks like this just seem too.....busy. I mean, who really needs to see the seconds on a binary clock? Even if you did need to know the exact time, down to the second, by the time you do the math to figure out what that is, it's changed. I also think that these would be fairly distracting. To see the blinking lights change every second (albeit out of the corner of your eye) I think would be maddening.

<nitpick nerdlevel="HIGH">And it's not even real binary! It takes each position of the base-10 representation of the number and turns THAT into the binary number. As shown above, the middle 2 columns for "48" get represented by a binary 4 (100) and a binary 8 (1000). "True" binary should show this as 110000 (32 + 16 + 0 + 0 + 0 + 0)</nitpick>

Speaking of blinking lights that no one pays attention to, having a binary clock that updates every second reminds me of those random blinking lights that set designers would put on old TV shows that are supposed to take place on spaceships. Nothing to describe what any of the blinking lights mean, as if to imply in the future we won't need labels.

"Captain! The green light is blinking! We're under atta--
Wait, never mind. That's the olive light."

So in starting this project, I had 3 basic design goals:
1. Replace the typical metallic "trying too hard to look futuristic" design with something less pretentious
2. Reduce the number of lights
3. Big enough to hold (and conceal) an arduino microcontroller, for the brains of the clock

Design

I don't know about you, but I rarely need to be aware of the time in anything more granular than 5-minute increments. This reduces the complexity pretty dramatically and it also means that I won't have to incorporate any additional chips into the circuit. I can just wire the LEDs right up to the arduino.

I had some blue marbles laying around that were originally going to be used for a rolling ball sculpure. I thought if the marbles were backlit with a white LED, that would give a nice subtle glowing effect. So I decided on the following setup:

This design meets the criteria of reducing the number of lights, so we don't have lights blinking on and off all the time.

Building Value
My wife and I found an incredible store in Cincinnati called Building Value. They're a non-profit that takes leftover materials from remodeling and reconstruction projects and sells them at a discount to give the materials a "second life". They have a part of their store where they have piles and piles of old solid wood.

Sure there was some pretty nasty stuff there, like an old refrigerator (it was a huge olfactory mistake to open it), but I found an old oak door header that cleaned up very nicely once we brought it home.

Code
I breadboarded a prototype of the solution and set to work on the code. I needed to have an internal counter to track the current time as well as a function to set the time. The code to advance the time and display it is pretty basic. The arduino goes to sleep for nearly 1 second an then increments a "seconds" counter. According to the table below, it knows when to turn on and off the different LEDs.

The code copies the value from currenttime and compares the copied value to the numbers on the lefthand column. If it's found to be greater, it subtracts that value and proceeds to the next smaller comparison value.

 If Counter is greater than... Then subtract the value and turn on the LED for... 46800 reset currenttime to 3600 ( = 1:00) 28800 8:00 14400 4:00 7200 2:00 3600 1:00 1800 30 minutes 900 15 minutes 600 10 minutes 300 5 minutes

Momentary Pushbutton Switch
I had to also provide a way to set the current time. For this purpose, I added a momentary pushbutton switch to the mix. Holding the button in for about 5 seconds puts you in time-setting mode. Then you can use the pushbutton to advance the time by 5-minute increments. Once the time is properly set, holding the pushbutton for about 2-3 seconds will return the arduino to non-time-setting mode.

Woodworking
I got the drill and chisels out and began to chip away at the beautiful wood. And after much measuring and drilling, like a cybernetic surgeon on a budget, I added the marbles, LEDs, and pushbutton switch with lots and lots of hot glue.

This picture makes it a bit hard to see what's going on, but there are 8 LED's going to digital arduino pins 2-9, and one pushbutton switch going to digital 10.

All of these use a common GND wire.

Finished Product

And some videos of the functionality...

#### Setting the time

...And here it is mounted to the wall in the basement: