# Any way to make LEDs mimic analog seconds movement on a clock?

Discussion in 'Electronic Design' started by Largo, May 19, 2005.

1. ### LargoGuest

I wish to take digital clock seconds "00 to 59" and translate the
segments into 0 to 60 incrementing LED'S. IOW the digital display
converted to "analog" ring of LED's around the clock face. Thus my
digital clock display's "hh:mm" and a ring of LED's (60 for each
second). They must start at the 12 O-Clock position when seconds
makes 00.

Looking at the MAX 7219 to drive the individule LEDs. How can I
decode this?

Largo

2. ### Luhan MonatGuest

If I understand what you need to do, drive 60 individual LEDs, the
minimum drive line count is 16 (8 x 8 matrix). PIC16F870 has enough
lines plus some for I/O. Matrix LED anodes on Port-B, cathodes on
Port-C. Drive 1 line high, and one low from each port. Float the rest.
Then move on to the next line for a count of 60.

The PIC's all have 25ma current limit so resistors are not needed. This
is a 'one chip' solution.

3. ### Spehro PefhanyGuest

9 port lines are enough to directly drive 60 LEDs.
I think I'd like to see 9 current limiting resistors in there. The
maximum current is not well defined.

But converting the drive from two digits of an existing digital clock
into unary sounds pretty unpleasant.

Best regards,
Spehro Pefhany

4. ### Tim WescottGuest

Spehro Pefhany wrote:
snip
It's probably easier to make a whole clock with a PIC than to decode the
digits...

5. ### Luhan MonatGuest

Spehro Pefhany wrote:

How do you do 60 LEDs with 9 lines?

6. ### Spehro PefhanyGuest

Connect two antiparallel LEDs betwen each unique pair of lines (series
resistor on each line assumed). The maximum number of LEDs with n
lines is thus n*(n-1) for n>=2. To drive a single LED you tristate all
but two lines, on those two you make one high and the other low. The
antiparallel LED is turned on by reversing the polarity, of course.
Only one LED can be on at once, but that's okay for this application
(and multiplexing can increase the number that visually appear to be
lit, within reason).

Best regards,
Spehro Pefhany

7. ### DonaldGuest

antiparallel ???

Could you please post a simple schematic.

I don't get it.

8. ### Spehro PefhanyGuest

Okay, sounds like dinner's almost ready, let's see if I can get it
done and scanned.. ah, in the nick of time:

http://www.speff.com/12_from_4.jpg

This is an example of driving 12 LEDs from 4 port lines.

Best regards,
Spehro Pefhany

9. ### Jim ThompsonGuest

I pondered this myself for use with a WWVB clock.

Reset a 60-long shift-register at 00, then clock it at one second
intervals.

MAYBE smaller, use counters and decoding logic.

...Jim Thompson

11. ### Ken SmithGuest

To make the design easier you can:

Do it in two steps. The first could be a PROM look up table with 128
elements, 10 of which will ever be addressed. From there it is a simple
decode.

Since this is only got to work at 1Hz like time frames: you could just
make a table of LED states and search down the list for one that matches
the clock's output. There could be a second table that gives the port
state for the LED drive.

12. ### Spehro PefhanyGuest

On Fri, 20 May 2005 13:55:10 +0000 (UTC), the renowned
And, on the input end, de-multiplexing the digit data (most likely)
and level-shifting the LED drive (assuming it's an LED clock)- maybe a
bunch of comparators.

I did something like this ages ago using a few 4051s to mux static
3-1/2 digit LED drive into a single comparator. Plus some magic to

Best regards,
Spehro Pefhany

13. ### MSCGuest

Several electronics stores (in Europe at least) sell kits made by a
company called Velleman. One of their kits is a roulette wheel, which
uses a PIC to drive 36 LEDs. The circuit for it is here:

It's the same principle as Spehro's, just taken a few stages further
(and so far as I can see, still a fair bit of room for expansion).
Very cunning!

Mike

14. ### Luhan MonatGuest

You are most exactly correct on this. I'll keep it in mind next time I
need to run a shitload of LED's from just a few line.

15. ### Spehro PefhanyGuest

I think the Velleman design is a sub-optimal variation that, in
return, for the extra port lines, allows an inexpensive single-sided
PCB layout

Best regards,
Spehro Pefhany

16. ### Anno SiegelGuest

Nice drawing

It could also be arranged in a matrix with diodes across each crossing
except the main diagonal, all the same orientation. The port lines
are connected to both the rows and the columns of the matrix. That are
n^2 - n = n*(n - 1) diodes. To light the diode at i,k (i != k), make
line i high, line k low, and make all other lines hi-z.

Anno

17. ### Fred BloggsGuest

I would forget the 7219 and use two M74HC42 available from Mouser. The
74HC42 are BCD to decimal decoders which means you input a 4-bit BCD
code in the range 0-9 and it activates 1 of 10 outputs low. So you
arrange the 60 LEDs into 6 groups of 10, use the MSD of the clock
seconds for input to one 74HC42 to select one group of 10 LEDs, and then
the clock LSD inputs to the second HC42 to select the 1 of 10 LEDs in
the group. This requires 2x 16-pin 74HC42, one current limiting
resistor, and six cheap transistor+ base resistor like so- how you
extract the seconds MSD and LSD depends on what's in the clock:

View in a fixed-width font such as Courier.

18. ### LargoGuest

This sounds very helpful. I wish i could just recode the PIC based
digital clock since all the PIC code is offered from this site:
http://hobby_elec.piclist.com/e_pic6_76.htm

The circuit already uses a BCD decoder for driving six 7-segment LED
displays. There a link to the circuit I refer which I purchased most
of the parts. It uses a PIC and also a CPLD for 3 to 8 decoder, some
divider for time accuracy and debounce logic. I use a 10Mhz metal-can
oscillator for the time keeping input. I cannot find the oscillator
used in the original description. Perhaps the circuit shown to the
group can loosen a few extra suggestions. Thanks for your
suggestions.

This circuit can be found on this link:
http://hobby_elec.piclist.com/e_pic6_71.htm

Largo

19. ### Fred BloggsGuest

It looks like the simplest add-on that does not require a programmable
part would be some simple logic to detect 00 written to DSP5,6 digits-
this then resets two BCD counters like the 74HC162 or 74HC192- these
counters then increment with each TR6 strobe (assuming the update is 1
sec)- the BCD counters are used to drive the MSD, LSD of the 74HC42 circuit.

20. ### Fred BloggsGuest

Looks like the DSP6 strobe is going to be several KHz- so scratch that
idea. Why don't you learn how to re-program the PIC- or ask the kit
maker to do it, so that RC0-RC6 output a 4-bit BCD instead of 7-segment
when addressing DSP5,6- then 2x 4-bit latches capture the data and drive
the 74HC42 circuit.