Instructables
Picture of Binary Marble Clock
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.
 
Remove these adsRemove these ads by Signing Up

Step 1: What you need

Picture of 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

Picture of Soldering the leds & resistors
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.
1-40 of 70Next »
Chein3 years ago
This is cool! I'm gonna make one. Btw, just wondering where do you normally source for parts? Around KL/PJ or online?
P/S: Are you by any chance the same guy who came up with that QuaterK shield? Love that too :)
matseng (author)  Chein3 years ago
Sometime I go to Jalan Pasar in the Pudu area, but usually I just order from Farnell/Element14. They have free next day delivery so it's quite convenient.

Since I travel to Bangkok twice a month I get a lot of stuff from the shops in the Ban Mo area there. I get standard components in bulk from there like 1000 packs of 0.1uF decoupling caps.

For the 200 QuarterK kits I did a while ago I got almost everything from the Chinese merchants on Taobao.com. The prices there is less than 50% than the already cheap Ban Mo-prices. But you have to wait for the shipping a bit longer and also use a shipping agent that will repack your stuff and send it to you since the merchants don't ship overseas and usually don't understand English.

/mats
hey mat,. gr8 proyect. i cant get it to work though. tried several times. bottom line: what do i do with the control fuses? is my chip fried? -----> I'm down to 2 conclusions: either my Tinys have static damage. or the fuses are wrong and its using the internal oscillator and not the crystal. furthermore it might be dividing the frecuency internally, apparently there is a clkdiv8 fuse or something. Please help ! my girl's BDay looms inexorably closer-->Symptoms: 1)i have the 20 MHZ. (actually ive done this with 3 chips already, maybe one was 10 MHZ, which didnt work either)            2)the Attrac() "nightrider" mode runs at about 1/2 htz                   3)once i press the button and reset to 12 o clock it doesnt advance( maybe it's waaaaay slower and i dont stick around long enough).         4) when i press button, it doesnt update LEDS until i release it changing time to a random time and u have to press for more then 3 seconds for it to do anything at all         . 5) i yank the crstal and it keeps doing the nightrider thing.                                            again Please help.
ok, i've fixed it, yeah!! finally! ---> the Tiny ships with the clkdiv8 fuse programmed ( meaning its "0" ) it also ships with de clksel fuses[3,2,1,0] = 0100 meaning it using the internal 8 mhz oscillator and not the crystal. which gives 1 mhz clock ( ten times slower then should be), you can verify this by letting your clock run for ten minutes and see one minute increment, ten hours and see 1 hor increment. Solution= change CLKDIV8 to "1" ( off) and change CLKSEL to "1111". and voila !! and yes PB4 is pin 16 ( not pin17) and yes, it is military time ( aka : 21 hours for 9 pm). note: fuses are not modified when you programm the chip you have to modify them yourself in the programmer... (look for the device config tab or something) ok now i can say it Excellent job MatSeng! best one yet!
hiromato4 years ago
Hi!

Very nice instructable! I've built the clock, but I had no 10 MHz crystal so i used a 20 MHz one instead. I've been fiddling around with the code to compensate for this but have, so far, been unsuccessful. Without changes to the code one minute on the clock equals exactly 10 minutes in reality. What parameters should i change to make it run correctly?
Why do you have 5 hour lights instead of 4?  Are you doing military time, 24 hours rather than 12?

Very nice clock, BTW.  I want to do something similar as a watch, but I can't find the chip already programmed for a reasonable price, and I don't want to invest in the equipment to do it myself for a single project.
godofal5 years ago
I finished my clock, but it runs way to slow! i made the time 23:29 last night and then went to sleep. at about 09:45 the clock said it was just after midnight! what is wrong?
godofal godofal5 years ago
i got it working, i did the math, rewrote line 65 into
ticks-=169756,4444444444444444444444444443;
and now it works pretty exact, still got to find out how exact over a week, going to try that now :)
godofal5 years ago
u need to change ur handdrawn diagram,it says pin17 controls H16, but in the code it says pin16 controls H16, and its kinda odd to skip a led. also, how can i make the time improvement of the button go faster and the minus 1 minute go earlyer? its now bout 5 seconds for a minute (after that 15 second speed increase) and half a second for decrease of minute. i would like something that goes 1 minute increase every second after the speed increase, and 1 minute increase every 2 seconds before, and right after i push i should be able to release for a decrease of 1 minute. how do i alter the code? il upload some pictures in a slideshow when i get it all done, now its kind of messy with the wiring... also, i used a protoboard and a socket for the IC, seemed handyer to me.
godofal5 years ago
you need to change ur handdrawn diagram,it says pin17 controls H16, but in the code it says pin16 controls H16, and its kinda odd to skip a led. also, how can I make the time improvement of the button go faster and the minus 1 minute go earlier? its now bout 5 seconds for a minute (after that 15 second speed increase) and half a second for decrease of minute. i would like something that goes 1 minute increase every second after the speed increase, and 1 minute increase every 2 seconds before, and right after i push i should be able to release for a decrease of 1 minute. how do i alter the code? il upload some pictures in a slideshow when i get it all done, now its kind of messy with the wiring... also, i used a protoboard and a socket for the IC, seemed handyer to me.
arhodes185 years ago
is there anyway you could help me figure out how to do this out of an old alarm clock? it uses an mm5387AA "controller" i guess its called... this clock is pretty old, at least 15 years or so, so i figured it may be easier to use this controller...
1000=1
0100=2
1100=3
0010=4
1010=5
0110=6
1110=7
0001=8
1001=9
0101=10
1101=11
0011=12
How do you tell minutes? I think I did the binary right.
Never mind, I saw more than 4 marbles on a different step. That is a very good idea, but I don't have time to make one now. Do people sell these? I can picture a computer teacher buying one, or me if they were not very expensive. I am going to favorite this.
you can buy them on thinkgeek.com i think, but i know you can buy wrist watch versions
Flip all of the binary numbers around. You read it from right to left.
Thanks! I guess my Dad taught me wrong. Oh well, I got the basic concept.
MrCruz5 years ago
A micro-controller? Bah. That's cheating my friend. There's no challenge in that ;) Although I have to admit that this is a good implementation...
are there any screensavers that do this?
sotsirh1945 years ago
Can you explain the time algorithm in more detail. I really don't understand it.
sotsirh1945 years ago
How do you get the leds to change. Do you use a +1 to the port since it runs on binary already. like PORTD = minute
minute equals 0111010 which shows which pins are high
arhodes185 years ago
this is really cool, is there any way to get a pre-programmed chip, and what is the power supply on this?
awkrin6 years ago
and how are u going to connect the ic to the computer?
Xellers awkrin5 years ago
You program it once through a usb programmer, and then you soldier everything together. Once you've decided to do this, you wo'nt be getting your chip back... Unless of course you soldier everything to a socket and then put the chip into that. It would also lower the chances of damage to the chip during soldiering. And easier way to do this without a Microcontroller is to use a 555 timer set to pulse once a second hooked up to some 7490 chips that divide the pulses and do the same thing as this. Then, if you only use one chip with 4 outputs, you can hook it up to a 4 line to 10 line demultiplexer such as the 7442 IC to drive a single digit nixie clock. That's what I did... And no MCU...
ckiick6 years ago
Accuracy? How accurate is the clock? Arduino code to keep real time usually drifts by several seconds an hour. Does yours do better? PS: I like the use of Bresenham for the ticker.
fpetir6 years ago
My clock not work, go only with pressed button. What is wrong? Please help!
mwalton6 years ago
I'm so close to being done, but each time I try to upload the source code to the chip I get errors talking about undefined variables and multiple definitions. Can someone please help, I was able to figure out how to use a atmega168 AVR and I bought a Arduino Diecimila so I could hook it up to my computer. But no luck and I even tried the ghetto programming enviro but I can't get that to work either can someone please help me.....
jeff-o6 years ago
Hi Mats, I've got the 20MHz version of the ATtiny2313. I assume I have to change all of the "10000000" references to 20000000, right? Do I have to touch the 1638.4 uS timer0 interrupt or will that take care of itself if the program know what speed it's running at?
beatle6 years ago
WOW! This instructable is just great! Thank you for doing it. I was scaning the Internet for some good DIY binary clock, and your's was the best! One question though, i can not find a 20pF cap any where, not even doble the amount of 10pF ones to conect in paralel, can i use a bit diffenet value, or it is critical? Thanks. And once more- a great instructable!
beatle beatle6 years ago
I managed to found 22pF caps, hope that it will be close enoght. Built the thing,it started flashing,but i had just set the time, i discowered, taht the clock is not ticking! Whay it is so, can anyone tell me? What could cause it? i would really apriciate any help, i have run aout of ideas, tried reprograming the uC, changing uC, checkin for shorts..
pullinsb6 years ago
I absolutely enjoyed this instructable! I am trying to replicate this right now. I am curious as to how hard would it be to add a seconds counter to this schematic? I've seen a binary clock made out of an old harddrive, and it had seconds on it. I think the seconds are a really fun part while watching a binary clock. Great job
matseng (author)  pullinsb6 years ago
Thank you. Seconds would probably really enhance the looks of the clock. Unfortunately there are not enough ports on the Tiny2313 to do that using direct drive. But by adding three transistors and multiplex the hours, minutes and seconds it'd be a piece of cake. By adding three transistors, six leds and removing five resistors and adding a few lines of code. If you're interested I can draw you a new schematic and update the software...
mwalton matseng6 years ago
I would be really interested in this I have an AT Mega just waiting for something to be done with it. I'm going to make this clock but having seconds would be amazing
I tell you what, if you send me the schematic and updated code, I'll build it and send you a pretty picture. Seconds would just be awesome.
rachedi6 years ago
Thanks for the project, quite informative. However, please forgive the ignorance, how do pass the C code you provided to the chip?
zootboy rachedi6 years ago
You need a programmer. This instructable has a nice description of a DAPA cable, which uses a parallel port. You can also make a DASA or ponyser cable, all of which can be found with a little googling or here. These are all in the class of bitbang programmers. If you want more professional porgrammers, you can consider a USBtinyISP, made by Adafruit Industries
zootboy zootboy6 years ago
OOPS! I forgot the most important thing! You need WinAVR to compile and burn the code. It includes programmer's notepad and avrdude to do all this. LINK.

(This is for the windows platform. I am not sure if they have done a mac or linux port yet.)
Charles IV6 years ago
Wow I've always wanted a binary clock but I couldn't find them anywhere except for the internet. So now I can just make one Instead.
sotsirh1946 years ago
is there any way i could do this with a basic stamp or pic microcontroller
sergmag6 years ago
3:45?
bluebasil6 years ago
I like this a LOT. Shame I don't have the resources to program the chip.
(removed by author or community request)
1-40 of 70Next »