Binary Marble Clock

by matseng in Circuits > Clocks

41853 Views, 132 Favorites, 0 Comments

Binary Marble Clock

mc-ballcloseup.jpg
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.

What You Need

mc-parts.jpg
  • 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...

Preparing the Base

mc-drilledtop.jpg
mc-bottomplain.jpg
mc-drilledtop-zoom.jpg
mc-toppainted.jpg
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.

Soldering the Leds & Resistors

mc-leds.jpg
mc-ledsminus.jpg
mc-ledsresistors.jpg
mc-ledscables.jpg
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.

The CPU & Crystal

mc-cpu.jpg
mc-cpuflat.jpg
mc-cpucrystal.jpg
mc-cpureset.jpg
mc-cpu20pf.jpg
mc-cpu100nf.jpg
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).

The Button

mc-button.jpg
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

Wires

mc-wires.jpg
mc-wiresglue.jpg
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.

Schematic

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

The Software

gccegg-65.png
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.

The Finished Clock

mc-finished1.jpg
mc-finished2.jpg
Glue the marbles by using a dab of hotglue and it's done!

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