16x40 LED Sign question

Post here to let others know of a project you're working on.

Moderators: Chuckt, Garth, bitfogav

User avatar
waywardson07
decided to stick around...
decided to stick around...
Posts: 25
Joined: Wed Nov 24, 2010 5:01 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

16x40 LED Sign question

Post by waywardson07 » Tue May 06, 2014 5:17 am

Hi, I am planning on constructing a 16x40 LED Sign by using 10-8x8 mono color led matrices. I went ahead an ordered 10 common anode(the anodes are the rows) matrices and I am stuck at deciding how I'm going to drive it.

I noticed that many people on the internet like to use a darlington array to drive the rows of the matrix. With the ULN2803 having the ability to sink up to 500mA, that works out fine because (8x5 = 40) and (500/40 = 12.5mA/LED).

What if I wanted to use the darlington array to drive the columns instead.
In my case, I have 16 led's in the column. The darlington array would be able to drive these 16 no problem, but I would need an array for each matrix rather than 2 if I was driving the rows with it. behind each darlington array would be a shift register. I would then scan the columns instead of the rows. and pass in 2 bytes to the rows for each column scanned. Would this method work?

Also, if this method does work, I assume that I can make the display as large as I wanted horizontally without having to worry about led dimming, but the downside would be many more parts used.

I hope all of that made sense. If you understood it, then I would very much like to hear your opinion on it, and whether it would be a reasonable approach.

Thanks,
Gabriel Sanchez

Update: I also realize that if this approach is not doable or it is just too much work. I would have to use something like a UDN2981 instead of a ULN2803 to drive the rows since I went with a common anode display.

Garth
I practically live here!
I practically live here!
Posts: 232
Joined: Wed Jan 16, 2013 1:17 pm
Contact:

Re: 16x40 LED Sign question

Post by Garth » Tue May 06, 2014 8:13 am

(a quick copy-and-paste from one of my web pages:)
In the automated test equipment I designed, built, and programmed in approximately 1990, I drove approximately 75 relays by way of Allegro Microsystems UCN5821A (I think it was made by Sprague at the time) 8-bit, serial-in, parallel-out 16-pin shift registers which are rated for 50V, 350mA, made specifically for driving relays and other heavyish loads. It looks like Micrel sells it now under the part number MIC5821BN. These were mixed in with lots of 4094's in the same serial chain all controlled by the same three pins of the 6522 VIA.

There's also TI's TPIC6 line of logic ICs, with for example the TPIC6A595 shift register that is similar to the 74HC595 but with open-drain outputs that can handle 50V when off and 350mA each when on, even though the IC's power supply and logic inputs are 5V, and it has extra ground pins to handle all that extra current (IOW, it cannot be used as a drop-in replacement for the 74HC595).
http://WilsonMinesCo.com/ lots of 6502 resources

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: 16x40 LED Sign question

Post by brad » Tue May 06, 2014 11:09 pm

It's always quite hard to explain how you want an LED matrix to work. Especially when you are using LED matrix's to make a bigger LED matrix :)

It doesn't matter which way you do it, you will require 7 shift registers (may I suggest the 74595's...) However you could save yourself on the darlington array chips by scanning through 16 columns / rows instead of 40 (2 chips as opposed to 5).

So I guess in answer to your question, yes you can do it as you have stated - you just need to remember that the darlington arrays need to connect to your cathodes. If you are just using a single color LED matrix then this isn't a problem because you will end up with 8 cathodes and 8 anodes per matrix. But if you wanted to use a bi-color matrix then you can't use the arrays (well at least not with any of the bi-color matrix's that I have used) since they all seem to be common anode.

Just so I am picturing this correctly, you said you have 16 columns, does this mean that your display is very tall and skinny? I.E. 16 colums wide by 40 rows high?

User avatar
waywardson07
decided to stick around...
decided to stick around...
Posts: 25
Joined: Wed Nov 24, 2010 5:01 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: 16x40 LED Sign question

Post by waywardson07 » Wed May 07, 2014 12:22 am

Thanks for the replies guys!

My display is actually 16 rows tall by 40 columns long.

My reasoning for scanning the columns rather than the rows is this: If I use (5) 74595 shift registers with 5 darlington arrays between them and the matrix columns and cascade them all together, I could easily send in one bit and shift it down the 40 columns. Then I would only have to worry about an array of 40 words that can be looped through once and sent to the rows.(one full word of data in the rows for each column). This would be my frame buffer and it would be easy on the PIC.

If I was scanning the rows instead, (and I haven't put a whole lot of thought into it yet) then with the same array of 40 words, I would have to iterate over it 16 times for one full frame(instead of once above). Each scan I would be grabbing one bit from each "word" from 0 to 16 and shifting them into the columns. Software wise this is a lot more stressful on the PIC than the previous method. (Edit: Maybe not actually given the same amount of bits will be send to Shift.out and that's the method really doing the work here)

heres an example code to further clarify
lets also assume the frame buffer has been loaded with the data already as well

method 1: (columns scanned(40))

Code: Select all

For index = 0 to 39
     Shift.out(...,frameBuffer(index),16)
     ..latch out
     ..shift scan line(columns)
     ..enable outputs
     ..delay
     ..diable outputs(prevents ghosting)
Next


method 2: (rows scanned(16))

Code: Select all

For rows = 0 to 16
     For cols = 0 to 39
          Shift.out(...,frameBuffer(cols).bits(rows),1)
     Next
     ..latch out
     ..shift scan line(rows)
     ..enable outputs
     ..delay
     ..diable outputs(prevents ghosting)
Next
My second bit of reasoning is that with the rows being powered up by the darlington array.. at 40 LED's I'm only getting about 12.5mA per LED max. With the columns powered up I could (to my knowledge) have a bit higher current running through each LED. I'm not sure if all this is good enough reasoning, but if I'm missing something I would like to know :mrgreen:

oh and another question was brought to my attention from your response brad. You said that the arrays could only be used on the cathodes. for the ULN2803 I know that is true because they will only sink a current through them, but what about the UDN2981. Could this chip be used to source the current through the anodes. The data sheet says that it can source up to -500mA.

and another little side note. I found another chip that could be used if I was going to scan the 16 rows instead. The MM74hc4514 is a 4 to 16 line decoder. It can be used in replacement for two 74595's for scanning.
Last edited by waywardson07 on Thu May 08, 2014 2:03 am, edited 1 time in total.

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: 16x40 LED Sign question

Post by MrDEB » Wed May 07, 2014 8:34 am

Another chip to look at is TLC5917. This is a sink so it goes on the cathode side but requires only one resistor instead of 8. I recall a 16 input is available?? but not sure. This chip is used so all the leds are same current draw which equals in some respect equal brightness.
Another source chip is TD62783.

User avatar
waywardson07
decided to stick around...
decided to stick around...
Posts: 25
Joined: Wed Nov 24, 2010 5:01 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: 16x40 LED Sign question

Post by waywardson07 » Wed May 07, 2014 8:56 am

MrDEB wrote:Another chip to look at is TLC5917. This is a sink so it goes on the cathode side but requires only one resistor instead of 8. I recall a 16 input is available?? but not sure. This chip is used so all the leds are same current draw which equals in some respect equal brightness.
Another source chip is TD62783.
Thanks for the extra info MrDeb! I took a look at the data sheet for the first chip you mentioned. Looks like it functions very similar to the 74595 shift register. I may look into those, thanks for the heads up.

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: 16x40 LED Sign question

Post by MrDEB » Wed May 07, 2014 2:16 pm

Yes it functions similar but it sinks current and only one resistor is required. In my research on this chip I found it is widely used for led displays.
I have it in a project I am trying to finish up but need to construct a 5 x 7 led display using 1000+mcd water clear leds.
Entire circuit to be smd.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: 16x40 LED Sign question

Post by brad » Wed May 07, 2014 9:27 pm

I'm off to bed now, but let me have a fresh look at this in the morning and i'll see what I can come up with :)

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: 16x40 LED Sign question

Post by brad » Thu May 08, 2014 6:51 am

And now I'm awake!

In my previous post, I got columns and rows mixed up! So your design has 40 columns, with each column containing 16 LED's - you then want to activate each of the 40 columns in sequence and send out a word (16 bits) for each of the 40 columns. So if you were to update the screen lets say 25 times per second then it would take:

1/25 = 40ms to draw the screen once, therefor (since there are 40 columns):

40ms/40 = 1ms. So each column would be turned on for 1ms every 40ms. This will certainly work fine the only real problem with scanning though so many columns is that you lose out on brightness due to the ON/OFF time of each column. For example if you just had an 8x8 LED matrix, you now only have 8 columns to scan through so:

1/25 = 40ms and:

40ms/8 = 5ms - so you should be able to see that the LED's will now be on for 5ms out of every 40ms - this results in the screen being brighter overall.

I don't think you need to worry about it though - I think it will look just fine.

As for the darlington arrays, I was only thinking about the ULN2803 which must be used with cathodes - but you are 100% correct about the UDN2981 chips, they can be used for anodes :)

As for the 74hc4514 decoder chip, you could use that but my recommendation would be to keep it nice and simple and just use all 74595's. The best way to use the 74595's is to connect the data input of the first 74595 to one of your microcontroller pins. then from there, you connect the serial output of the first 74595 to the serial data input of the second 74595 then the serial output of the second 74595 to the serial input of the third 74595 and so on. You keep doing this until all 74595's are cascaded together. then you shift out all data for every 74595 bit by bit until they are all full.

Once they are full, you enable their outputs (you would have all output enables connected together and then controlled by a single pin on your microcontroller). Hopefull all of this is making sense!

User avatar
waywardson07
decided to stick around...
decided to stick around...
Posts: 25
Joined: Wed Nov 24, 2010 5:01 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: 16x40 LED Sign question

Post by waywardson07 » Thu May 08, 2014 9:04 am

ok thats some good information brad!!! I totally forgot to take in account the amount of time the lights would be on. I have now decided to do a little test using 2 LED's to help me decide what method I am going to go with.

the row scanning method will be represented by one of the LED's and the column scanning method will be represented by the other.

for the row scanning we are dealing with 16 rows and 12.5mA per LED(40 of them).
for the column scanning method we are dealing with 40 columns and about 20mA per LED.(16 of them)

sooo.. I will connect one LED with resistance to 12.5mA and power it on for 2.5ms and off for 37.5ms and see how bright it is. (1/25 = 40ms, 40ms/40leds = 1ms/led).

I will then connect the second LED with resistance to 20mA and power it on for 1ms and off for 39ms and check its brightness against the first LED.(1/25 = 40ms, 40ms/16LED's = 2.5ms/LED).

This should give me a fairly accurate representation of what my Displays brightness should look like in each case and allow me to decide what method I am going to go with.

I will post the results of my finding back here when I am done 8)
Thanks for the help Guys!!!! :mrgreen:

Garth
I practically live here!
I practically live here!
Posts: 232
Joined: Wed Jan 16, 2013 1:17 pm
Contact:

Re: 16x40 LED Sign question

Post by Garth » Thu May 08, 2014 2:15 pm

They can handle far more current if the pulse width is narrow so they don't have time to get dangerously hot, but I don't know how much efficiency you might lose. It would be worth experimenting. For example, does 10mA average look as bright if it's 400mA on for 1ms and off for 39ms as it does with just 10mA continuous? How about ten times that fast, 100µs and 3.9ms off? Obviously driving a bunch of these at once will require high-current drivers, which no 74xx595 qualifies for.
http://WilsonMinesCo.com/ lots of 6502 resources

User avatar
waywardson07
decided to stick around...
decided to stick around...
Posts: 25
Joined: Wed Nov 24, 2010 5:01 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: 16x40 LED Sign question

Post by waywardson07 » Thu May 08, 2014 4:39 pm

Hey Garth. I just figured that out while playing around with pulse widths and different currents on an led. I'm going to end up using the high side driver for my display. The udn2981 and use that to drive the anodes. It is capable of outputting -500mA. For the 40 led row it will be powering that's going to cut me down to 12.5mA per led.

I wonder if I could connect two drivers. One to the first 20 LEDs in a row and one to the last 20 and have them both go high at the same time giving me twice the current through the LEDs. I guess I'll have to do a little experimenting with that when the parts I ordered get here.

In any case. I'm getting a lot more insight in to how things work discussing it here on this forum.

Thanks guys!!

P.s. I just realized I accidentally ordered really small led matrixes. 19mm x 19mm :?
Oh well, will have to make them do. I'll get larger ones next time.

Garth
I practically live here!
I practically live here!
Posts: 232
Joined: Wed Jan 16, 2013 1:17 pm
Contact:

Re: 16x40 LED Sign question

Post by Garth » Thu May 08, 2014 6:21 pm

Parallelling the driver ICs (even stacking them so as to get two or more in a single socket) should work fine to increase output current.
http://WilsonMinesCo.com/ lots of 6502 resources

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: 16x40 LED Sign question

Post by brad » Fri May 09, 2014 7:03 am

sooo.. I will connect one LED with resistance to 12.5mA and power it on for 2.5ms and off for 37.5ms and see how bright it is. (1/25 = 40ms, 40ms/40leds = 1ms/led).

I will then connect the second LED with resistance to 20mA and power it on for 1ms and off for 39ms and check its brightness against the first LED.(1/25 = 40ms, 40ms/16LED's = 2.5ms/LED).
That is a great idea, I didn't even think of that. It would certainly be a nice simple way of checking the difference between the two methods.
They can handle far more current if the pulse width is narrow so they don't have time to get dangerously hot, but I don't know how much efficiency you might lose.
That's a good point Garth, since you are only drawing current (turning them on) for a very short amount of time, you can safely drive them at a higher current. The overall average current is the the main one you want to be concerned about. Maybe you could experiment with lower value resistors in you two LED test?
I wonder if I could connect two drivers. One to the first 20 LEDs in a row and one to the last 20 and have them both go high at the same time giving me twice the current through the LEDs. I guess I'll have to do a little experimenting with that when the parts I ordered get here.
Do you mean instead of scanning through 40 columns one column at a time, you would scan through the 40 columns two columns at a time? If that's what you are getting at then that also is a great idea because that's exactly how companies make their 32x16 and 32x32 and 64x64 etc. LED panels. For example, if using the 32x16 pixel matrix, you shift in data for the first row and ninth row, you then enable the output of the shift registers to display these two rows. You then shift in data for the second and tenth row, enable the outputs to display these two rows. and so on until you get to the eighth and sixteenth row.

So effectively you get the screen drawn twice as fast (and so therefor it should be twice as bright).

Garth
I practically live here!
I practically live here!
Posts: 232
Joined: Wed Jan 16, 2013 1:17 pm
Contact:

Re: 16x40 LED Sign question

Post by Garth » Fri May 09, 2014 7:26 am

You might want to implement some kind of hardware protection against overcurrent. What I'm thinking of is the possibility of a crash or other timing malfunction (especially before the debugging is finished) leaving a lot more current running through LEDs than they can safely take for more than a few ms. If the driver ICs have enable inputs, they could be driven together by a single circuit using an RC and a gate with a Schmitt trigger input so the enables will go false if clocking stops for more than a couple of ms for whatever reason.
http://WilsonMinesCo.com/ lots of 6502 resources

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 4 guests