Binary Marble Clock

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 1What you need

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...
« Previous StepDownload PDFView All StepsNext Step »
70 comments
1-40 of 70next »
Mar 6, 2011. 9:12 PMChein says:
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 :)
Jul 4, 2010. 7:13 PMluisma.suarez says:
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.
Jul 6, 2010. 8:50 PMluisma.suarez says:
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!
Dec 12, 2009. 3:06 PMhiromato says:
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?
Oct 8, 2009. 4:10 AMaliasjanedoe says:
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.
Sep 13, 2009. 1:47 AMgodofal says:
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?
Sep 20, 2009. 5:07 AMgodofal says:
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 :)
Sep 13, 2009. 1:46 AMgodofal says:
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.
Sep 12, 2009. 2:12 PMgodofal says:
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.
Sep 1, 2009. 5:20 PMarhodes18 says:
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...
Feb 5, 2009. 3:49 PMcantthinkof bettername says:
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.
Aug 10, 2009. 3:07 PMXamith says:
you can buy them on thinkgeek.com i think, but i know you can buy wrist watch versions
Mar 6, 2009. 5:05 PMLuminousObject says:
Flip all of the binary numbers around. You read it from right to left.
Mar 7, 2009. 9:23 AMcantthinkof bettername says:
Thanks! I guess my Dad taught me wrong. Oh well, I got the basic concept.
Jun 27, 2009. 6:00 PMZeroTruths says:
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...
Mar 6, 2009. 4:13 PMcantthinkof bettername says:
are there any screensavers that do this?
Feb 8, 2009. 10:08 AMsotsirh194 says:
Can you explain the time algorithm in more detail. I really don't understand it.
Feb 5, 2009. 2:59 PMsotsirh194 says:
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
Dec 8, 2008. 7:26 PMarhodes18 says:
this is really cool, is there any way to get a pre-programmed chip, and what is the power supply on this?
May 23, 2008. 12:23 PMawkrin says:
and how are u going to connect the ic to the computer?
Sep 30, 2008. 4:47 PMXellers says:
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...
May 27, 2008. 10:05 AMckiick says:
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.
May 23, 2008. 10:08 AMfpetir says:
My clock not work, go only with pressed button. What is wrong? Please help!
May 14, 2008. 2:32 PMmwalton says:
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.....
May 11, 2008. 3:46 PMjeff-o says:
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?
Apr 19, 2008. 12:55 PMbeatle says:
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!
Apr 21, 2008. 3:36 PMbeatle says:
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..
Feb 21, 2008. 8:26 PMpullinsb says:
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
Apr 19, 2008. 11:09 AMmwalton says:
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
Feb 22, 2008. 3:02 PMpullinsb says:
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.
Mar 6, 2008. 12:49 PMrachedi says:
Thanks for the project, quite informative. However, please forgive the ignorance, how do pass the C code you provided to the chip?
Apr 18, 2008. 10:22 AMzootboy says:
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
Apr 18, 2008. 10:24 AMzootboy says:
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.)
Mar 26, 2008. 8:33 AMCharles IV says:
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.
Mar 20, 2008. 1:05 PMsotsirh194 says:
is there any way i could do this with a basic stamp or pic microcontroller
Mar 7, 2008. 1:18 PMsergmag says:
3:45?
Feb 17, 2008. 7:58 PMbluebasil says:
I like this a LOT. Shame I don't have the resources to program the chip.
Feb 14, 2008. 7:21 PMDELETED_craz meanman says:
(removed by author or community request)
1-40 of 70next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
11
Followers
10
Author:matseng
Swedish expat living now living in Malaysia after spending some years working in Dubai.