Introduction: Binary Marble Clock

About: Swedish expat living now living in Malaysia after spending some years working in Dubai.

This is a simple clock that shows the time (hours/minutes) in binary using leds hidden beneath glass marbles.

For an average person it looks just like a bunch of lights, but you will be able to tell the time by just a quick glance at this clock. It might take you a couple of days to get up to speed on the esoteric art of fast binary counting, but you'll be able to tell the time right away, just a bit slower in the beginning.

Here's a instructable of counting in binary Binary counting.

Step 1: What You Need

  • One Atmel Tiny2313 microcontroller
  • One 0.1 uF capacitor
  • Eleven resistors - 120 ohm
  • Eleven high brightness leds. I used 6 white and 5 yellow
  • One 10 MHz crystal
  • Two 20 pF capacitors
  • One small pushbutton
  • Eleven glass marbles
  • A nice piece of wood to mount it all on

The picture below are missing the leds and resistors...

Step 2: Preparing the Base

I took a a piece of wood( 3x2 cm , 50 cm long) that I found in a closet and used that as a base for the clock.

I started by drilling eleven 5 mm holes straight through for the leds. On the top I then used a 12 mm drill and drilled down like 7 mm at each 5 mm hole to get an indentation for the marbles to be put into. On the bottom I used an even wider drill and drilled out a huge chunk of wood over each led hole and then I chiseled a trench between the holes so the cables can be put there.

In the middle between the hour- and minute-leds I drilled and chiseled out a huge crater to put the electronics into.

After sanding it a bit and painted it all with a dark brown color.

Step 3: Soldering the Leds & Resistors

The leds have one short lead (minus) and a long led (plus). Insert all leds turned in the same direction and then solder all the short leads together.

Solder the 120 ohm resistors on the long leads.

Solder a wire long enough to reach the middle of the clock to each resistor.

Step 4: The CPU & Crystal

I didn't bother to make a circuit board for this project, it's easier to just solder it all together in dead bug style. (Actually I would rather call this a squashed bug because the chip is not turned upside down, but it's flattened out/squashed... ;-)

Begin by flashing the software into the chip (ATtiny2313) and test it to make sure that it works.

Then flatten the chip by angling all the leads outwards.

Solder the crystal to pin 4 & 5 on the chip. I ran the leads of the crystal on the bottom of the chip to get them out of my way.

Solder the 20 Kohm resistor between pin 1 (reset) and pin 20 (plus).

Solder the two 20 pF capactitors to pin 4 & 5 and then solder them both to pin 10 (minus).

Solder the 100 nF capacitor between pin 10 (minus) and pin 20 (plus).

Step 5: The Button

Chisel out an indentation for the button in the wood and connect the button to the wire that are connected to all the leds. Then solder another wire long enough to reach the microcontroller to the other pin of the button

Step 6: Wires

Solder the wires coming from the leds and the button to the microcontroller.

The led first led (the led farthest down) is the Minute-1 led up to the led for Minute-32 that should be just beneath the microcontroller. Above the microcontroller is the Hour-1 led.

Don't forget the wire coming from the button, solder that to pin 11 on the microcontroller.

End with soldering the power wires to pin 20 (plus) and pin 10 (minus) on the CPU. And yes, there's one final wire to do - solder a wire between the pin 10 on the microcontroller to the long wire connecting all the leds (and the button).

Finish it off by using hotglue to hold down all the wires into the trenches in a neat and orderly fashion.

Step 7: Schematic

The schematic is so simple and there's no circuit board so only made a handdrawn schematic.

Step 8: The Software

The software is written in C for the Atmel using GCC.

There are really nothing special about the software. Timer0 is used to generate interrupts every 1638.4 uS and the Bresenham algorithm is used to make sure that the clock ticks at average every second.

After power on the the clock displays a dot that flashed up & down to indicate that the time must be set.

By pressing the button the time advances as a slow rate for 15 seconds and then speeds up. If the button is just pressed momentarily (0.1-0.5 seconds) the time is decremented by one minute for easy adjustment.

Step 9: The Finished Clock

Glue the marbles by using a dab of hotglue and it's done!

Apply 5 volt to it and bask in its glory.... :-)