View previous topic :: View next topic |
Author |
Message |
tEaM
Joined: 29 Nov 2013 Posts: 26
|
24x12 matrix bicolor LEDs |
Posted: Thu Nov 20, 2014 8:25 am |
|
|
Hi friends
I am developing a matrix of LEDs, 40x50 leds and I like sharing this development with you.
I need control 2000 leds, I'm thinking of using one of the following options:
Options 1:
250 shift register in cascade (250 * 8 = 2000 leds)
Options 2:
32 matrix of "8x8 matrix" = 2048
for 8x8 matrix, I using 1 shift register for column and 1 shift register for row
From your experience, what is the best option?
Or is there a better option?
Regards
Last edited by tEaM on Tue Nov 25, 2014 2:09 pm; edited 3 times in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Thu Nov 20, 2014 8:37 am |
|
|
Several factors to consider...
1) timing ! The longer the 'shift register' chain is the longer the delay to light the last LED.Refresh time needs to be calculated
2) choice of PIC for the brains ? Again, speed is necessary,though I/O pin count is as well...,what else does it HAVE to do ?
3) I'd divide it into smaller 'units'. have a PIC control say a 4 '8x8' LED displays, or 8 depending on 'timing' again.
By having several 'PIC/LED' units you then would have a 'Master PIC' doing the grunt work of decoding the 'LED pattern' and ending that data to the other PICs probably though SPI . Another benefit is repair. A bad LED in one 'unit' can be easily replaced at a lower cost than the whole 2000 LED unit.
If you use a 2048 LED approach, then only 256 bytes of memory are needed for pattern storage,much easier than 2000(an 'odd' number to deal with)
hth
jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Thu Nov 20, 2014 10:04 am |
|
|
The last time I did something like this, I used an FPGA. The PIC wrote to what it saw as a small memory. 8bit * 512 addresses (for me), and the FPGA implemented the latches at the memory cells, and continuously scanned the data out of these generating the row/column multiplexing (128*32 for me). |
|
|
tEaM
Joined: 29 Nov 2013 Posts: 26
|
|
Posted: Thu Nov 20, 2014 12:22 pm |
|
|
@ temtronic:
The refresh is not critical. The system can operate with a refresh 100ms.
Having a PIC MASTER and several SLAVES will increase (much) development time.
I am considering using a "PIC32MX795F512L". Processing capacity also should be no problem.
@ Ttelmah:
I never used FPGA. I agree that FPGAs are very nice for large multiplexing systems.
But as I have no experience in FPGAs, development time was very high.
Regards
tEaM |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Thu Nov 20, 2014 1:35 pm |
|
|
From your slow refresh rate(10 Hz), I assume you're going to have a static display and not something like a clock, timer or scrolling display of data.
I don't use the 32 series so I can't speak as to it's performance.
You will have to do a detailed power consumption calculation though ! 2000 LEDs do use a lot of electrons to make photons. Worst case is all LEDs off to all LEDS on. Be sure your supply can handle that demand *5 to reduce risk of PIC resetting. As well be sure ALL traces handling the LED current are oversized. You don't say how the LEDs are going to be physically arranged but that will affect conductor size, layout, etc.
hth
jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Thu Nov 20, 2014 3:22 pm |
|
|
I'd have to say that the master/slave system, would in my opinion, reduce development time.... Trying to do it all in one chip is more complex than doing a small part. |
|
|
Jerry I
Joined: 14 Sep 2003 Posts: 96 Location: Toronto, Ontario, Canada
|
|
Posted: Thu Nov 20, 2014 6:49 pm |
|
|
Hi,
I have worked with a company that designed these type of displays. In my opinion direct drive system is the best using a 8 bit shift register like a 74hc595, or specialized LED driver many MFG make them to drive 8 leds at constant current, 16 bit drivers also available. Also all boards were designed to be 8 bit or 16 bit multiple. Using a direct drive option is also the most expensive option.
So your matrix of 40 x 50 would not be good, either 40 x 48 or 40 x 56.
This way if for example using 8bit driver 40x48 display would use 6 74hc595 chips horizontally x 40 rows for a total of 240 chips. The next step is to decode the row you would be loading. Now do this fast enough so you would not get flickering. In the old days we used to use a 1mhz Motorola 6800 which was adequate for text. But if your trying to do graphics and animations. I have used 8 bit pic no problem 10mhz would be fine, but if you want more control use the PLL x4 for 40MHZ. 18F6722.
But I have also used a 18f252 with same success.
The trick is how you load the data into the shift registers. Remember that you have to load 40 rows with six byes of data fast enough that the data appears to be on all at once. Then refresh it for animations.
Its all about how the data row is decoded then loaded.
Now after you have mastered the data transfer let give the leds levels of intensity/shading, next add colour.
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Thu Nov 20, 2014 8:00 pm |
|
|
rethinking this as the snow keeps falling.....
It might be done with 5- 74hc595 'row decoders' and 4 - 74hc154 'col decoders' needing very few I/O pins of a PIC.
Proof of concept would be to use one 595 and one 154 configured as an 8 by 16 matrix of LEDs. Obviously need some additional components like transistors and resistors but seems possible.
Since your refresh rate is only 10 Hz ( 100ms), it should be easy enough to test.
The real 'fun' is in creating the code. Be sure to carefully document the 'bit maps' and masks for the LED matrix !
hth
jay |
|
|
VernonAMiller
Joined: 11 Sep 2014 Posts: 25 Location: Contoocook, NH
|
|
Posted: Fri Nov 21, 2014 3:39 am |
|
|
The great thing about the 74HC595 is that it has separate shift and output registers; so, you can shift the data in at your leisure, and then transfer it to the output registers in one atomic operation.
I'm a fan of the ULN28xx chip for the low-side driver. In my experience they are practically indestructible.
I'd look at the ON Semi AMIS-39101 as a high-side driver. It has separate Vcc inputs for each driver. Might be overkill depending on how much current you're talking about.
VAM |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sat Nov 22, 2014 3:42 am |
|
|
temtronic wrote: | rethinking this as the snow keeps falling.....
It might be done with 5- 74hc595 'row decoders' and 4 - 74hc154 'col decoders' needing very few I/O pins of a PIC.
Proof of concept would be to use one 595 and one 154 configured as an 8 by 16 matrix of LEDs. Obviously need some additional components like transistors and resistors but seems possible.
Since your refresh rate is only 10 Hz ( 100ms), it should be easy enough to test.
The real 'fun' is in creating the code. Be sure to carefully document the 'bit maps' and masks for the LED matrix !
hth
jay |
Which ever way you go, proof of concept on a smaller scale has to be a good idea.
Whilst on this proposed version you might also learn something useful by pretending that you have actually got a full sized display.
In other words, treat the single 595 as though it were the first of a string, (feed it with dummy data for the missing rows.
Treat the 154 as one of 4. (feed dummy column data to the missing column drivers, your one device will only be on for 20% of the time).
That way you can test the timings for the full scale version and the brightness you can achieve.
Many beginners don't appreciate is that for your proposed matrix ALL the elements of one set of drivers HAVE to be capable of driving the entire display.
For jay's proposal, that's ALL 64 column drivers.
So for an average 1mA per LED that translates to 2A per driver.
For 10mA per LED you need 20A per driver!
Things get interesting when a fully lit column is next to a blank column.
I can see the attraction from a component count point of view of doing a big single display matrix.
Depending on the number of units you're intending to build, the master/slave approach has considerable merit.
Mike |
|
|
tEaM
Joined: 29 Nov 2013 Posts: 26
|
|
Posted: Sat Nov 22, 2014 5:57 am |
|
|
I'm thinking of starting with this set:
With this, I can control 192 LEDs and only using 3 shift register.
I can not increase more because the ULN2803 only provide 500mA per port. If each led consuming 20mA... 20mA * (8 + 8 + 8) = 480mA. Is the limit!
If I get 4 sets in series(per column), get 96 leds per column! With 3 sets in series(per row), get 24 leds per column! With 96x24 leds, I get 2304 leds!
Only 24 sets! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Sat Nov 22, 2014 6:24 am |
|
|
As Mike pointed out you need a LOT of current for your matrix and your schematic shows why 'big displays' like 'jumbotrons' are made up of smaller modules composed of a 'communications' PIC,drivers,LEDS and power supply.
As you've found out you can't drive all the LEDs from a single driver but you need to re read the datasheet of the 2003. While the maximum current is 500 ma per section there is a maximum Power Dissipation of less than 1.5 Watts. You cannot drive more than 1 section fully on at a time without burning it up.First you'll burn your finger if you touch it, then poof,busted.
That's why I said you'd need transistors( or FETs) to drive the LEDs.
The design you've presented will need 40 - 595 and 10-2803 for the matrix.
It's actually a LOT simpler( and cheaper) to simply use one PIC per 8x8 LED matrix.Virtually any 18 pin PIC will work with one port being the 'row' and one being the 'col' driver. I did a test using a 2" tall 8x8 and no current resistors were needed though they should be there. If you choose a PIC with a hardware UART then a 'Master PIC' can talk to the 'Slave' PICs to update the data.Overall this becomes a very easy project. The slave PICs only have 64 bits or pixels to control to refresh timing is NOT critical unlike controlling 2048 pixels from one PIC. You can use RS-485 for communications, ideal, like it was designed to be used this way ! 32 modules allows for easy testing,programming and replacement as well as easier power supply design.
just another way to look at it.....
hth
jay |
|
|
tEaM
Joined: 29 Nov 2013 Posts: 26
|
|
Posted: Sat Nov 22, 2014 9:27 am |
|
|
Yes, I'm convinced!
I'll use one PIC slave to control each 8x8 matrix.
I'll use Rs485 comunications between the master and the slaves!
This is the best options for my 8x8 matrix?
Or I'll forget the shift registers and I will work with 16 mosfets connected directly to the PIC ports, controlling the columns and rows!
Regards |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sat Nov 22, 2014 12:15 pm |
|
|
One crucial question.
What average current Iave do you need for each LED to give required brightness?
You can answer this question by passing direct current through one (or more) LEDs in your chosen matrix.
The answer to this question determines the current capabilities of both row and column drivers.
Assuming you are multiplexing by columns:-
1) The row drive capability is ~8 * Iave.
2) The column drive capability ~64 * Iave.
For low enough Iave you may not even need row drivers, the PIC itself can handle the current.
(Saves a awful lot of components. You can then get away 1*PIC, 1*8 way Rnetwork, 1*ULN2803 and 1 off 8** LED matrix per module. )
Mike |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Sat Nov 22, 2014 2:42 pm |
|
|
As I said in my last post, A PIC 18F46K22 (my go to PIC) and a 8x8 LED matrix, NO resistors and it performed fine. Good brightness too!
So you don't really need the 2 74hc595 or the 16 FETs or any resistors.
So if I was making it each module would consist of
1- PIC16F648a, maybe there's a cheaper one with UART ?
1- RS485 8 pin device
1- 8x8 LED matrix
2- headers for RS485 daisy chaining
2 - headers for power.
If designed right it'd be 'square', within the LED matrix outline, making it super simple to create any X-Y layout of pixels.
hth
jay |
|
|
|