Author Options:

How do I best program LEDs into working as a clock? Lighting up every minute and hour? Answered

I'm working on a table top fountain in acrylic shaped like the Yin-Yang. An extra feature is that this fountain is going to contain LEDs along the form. As an extra EXTRA feature I want to turn it into a clock at the same time.
Details about the fountain - One half is being lighted up with blue LEDs and the other half with white ones, to reinforce to Yin-Yang-symbol. These will represents the minutes. Then I'll have 12 red LEDs representing the hours.

SO the big Question is as follows - What's the best way to make this happen? Also, I would love it if I could choose between the three options of
1. Full-lighting mode (every LED is turned on)
2. Clock-mode (ordinary lights turning on for every minute and then an extra colour for every hour) and
3. Auto-switching between 1 and 2.

This will be turned into an i'ble and of course credit will be given as it's due!


So, 60 +12 LEDs ?


maybe more than 60, I haven't bought the LEDs yet or done any estimate of how many I need, but I think it's going to be more than 60, say approximately 100+ atleast excluding the 12 needed for marking hours.

Do you want to switch them ALL at the same time, or can you permanently group some of them ?

Can you program an Arduino computer ?


The first mode is when all light are lighted up enforcing the Yin-Yang-figure so yes ALL at the same time.
When it comes to showing the minutes, i can group the right amount of LEDs together, that's not so hard to do.

I've never done any arduino programming before so this will be completely new for me. Don't have a grasp of it but if I'm going to learn it then this project would be great for it.


There is a schematic that will work for you at my "carbarduino" project - its only designed for 64 LEDs, but you can add another chip very easily and drive 128. They might not be bright enough for your application though, in which case I suggest you use chips like these

These will drive LEDs at the right kind of current and voltage automatically.

I've started reading up on Arduino, although I'm not understanding much of it so far, but I came across this basic tutorial about fading LEDs.
Do you think it would be possible, for the first hour, light up the LEDs one minute at a time, and then let them fade out the next hour and repeating the circle?

It shouldnt be hard with an ardunio (and maybe an RTC) and a few shift registers

How big is the clock? If it is too small this might not work but im not sure...

I think 12 leds around the clock

4 LEDS between each of the 12 LEDS

this gives us 60 LED's (maybe add another set of 12 wehere the hours go, possibly a different color but slightly outside of the 60 LED ring

Light up whatever LED on the 60 led circle (or maybe the minute and the 2 around it might give you a getter look)

As for switching, that is totally not a problem, with an RTC you could just set a specific time to switch or with a few sensors even have it change to a clock when someone approaches.

Another way is to have a ring of leds (60?) and then outside of that ring have groups of LEDS arranged in numbers (either grouped or laid out to roman numerals or other) outside of the ring.

Hope I havnt confused you too much, but I would be happy to help (if I have time, school is off and on in terms of free time..)


possibly with shift registers you could also use PWM, and make dimming sequences for the clock/fixture

oh, and "Light up whatever LED on the 60 led circle (or maybe the minute and the 2 around it might give you a getter look) " means to light up a minute :)

it's not thick enough for two rows of LEDs but the placement of the LEDs ain't the problem, it's the programming and controlling of these particular settings that I want to have.
SO arduino is my best bet then?

maybe not the absolute best- but its pretty easy and for your application the programming wouldnt be especially difficult. The hardest part of the programming would be the RTC (I just havnt used one so im not sure exactly how to use it) and the shift registers (also havnt used). I say for your application it would work very nicely. It only costs about 30$ for a board anyway, and a few $ for shift registers and an RTC. A few other options are harder (a harder one would be to do no programming at all and just use chips- it would be hard to find all the right chips and get them to do the application correctly) . Another option is to use a PIC. They are similar to an arduino in the sense that they are programmable. I havnt used a PIC, so I dont know how to use them but they are also pretty popular.

Been reading about a little bit found this


which is without programming (I didnt read it through all the way but it seems like it might fit your idea)

and for an rtc


possibly? or depending on how accurate you need, as DS1307 RTC would work fine but it can drift +- 2 seconds a day, based on temperature.

And as for LEDS, of you want more than 60 you could just double it (120 leds) and group them in twos....
The project will consume quite a bit of power with 120 leds, so I wouldn't recommend powering it with batteries.