Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

controlling hundreds of LED's

Status
Not open for further replies.

control freak

New Member
basically what i have been looking for is a controller to manipulate an
LED matrix(30 x 30). I need to be able to control the intensity of light in red green and blue LED's to make unlimited color combinations, sort of like a monitor but on a bigger scale. In GE's control catalog I have found VersaMax micro PLCs which have expandable I/O points up to 140. Is this the right PLC for the job? I am very new to this area so please bear with me. what if anything do you suggest? do i use more than one PLC? does one output only control one LED? or can you assign more than one LED to one output point? I would also like to simulate the LED's in a windows application. I understand that i am in over my head right now, but hope to someday be able to do this sort of thing... also can this project be done for less than $1000? (i own a computer already so don't include that) the cheaper the more realistic it is for me to accomplish..thank you for your time.
 
Common way to drive larger quantity of LEDs is to multiplex them.
That saves cost of hardware and dramatically reduces wiring.
PLCs are nice and easy to program and sure you can use them
but they are not quite the perfect match for the low power devices
like LEDs. If you still want to use PLC, try to use lower voltage for
outputs so you can use smaller size resistors. I would look into
microcontrollers. There are many starter kits for little money.
Some of them come with number of I/O that would easily do what
you ask for while using few external components.
But all of this might be tricky or difficult to do depending on your
requirements. LEDs are simple devices that are intended to be either
ON or OFF which mmeans that simplest way to control intensity
in some range is using PWM.
This is usually not the problem unless you have to deal with many
LEDs and control them individually (you are looking into some
1000 pcs aren't you?). I'd probably sit down and think hard how
to make this work. Well good luck and let us know how it went.
 
Microcontrollers...thank you!!!
The picture I am getting in my mind is LOTS of wires. I would obviously need to assign an address to each individual LED. I was thinking of deviding the "screen" into quadrants 1,2,3,4. Then assign (x, y) values. For instance for a 30 x 30 matrix, the top left red LED would be:
R(-15, 15)....bottom right green LED: G(15, -15), and so on. Each coordinate would consist of 3 LED's (red green blue)...So if I wanted to set the coordinate (2, 3) to blue, I would tell the microcontroller to set the intensity of

R(2, 3) = 0;
G(2, 3) = 0;
B(2, 3) = 1;

As far as PWM...please excuse my nubie-ness....power management right???i hope...would i use a potentiometer to control the intensity levels(dimming levels) to form unlimited colors.... Would i need 30 x 30 x 3 potentiometers if so? Also it is important to be able to set up a loop to manipulate the colors. Thank you again for your help...I really do appreciate it.
 
PWM = Phase Width Modulation. This procedure helps to control how much time your high signal lasts. You can make your led to flash in different speeds so human eye can feel the LED is dimming.
 
LED matrix

basically what i have been looking for is a controller to manipulate a LED matrix(30 x 30).
What speed (data rate) do you plan use the display at?

I need to be able to control the intensity of light in red green and blue LED's to make unlimited color combinations, sort of like a monitor but on a bigger scale.

The RGB points are physically larger, but 30 x 30 is a much smaller scale in terms of resolution. (This is not a bad thing if you're trying to achieve fast update rates).
 
RGB^3

A few more comments that may help put things in perspective

would i use a potentiometer to control the intensity levels(dimming levels) to form unlimited colors.... Would i need 30 x 30 x 3 potentiometers if so?

No. It's an imperfect analogy, but think of an etch-a-sketch where you have to carefully tweek the knobs to draw a picture (x2700 knobs). To draw a new picture, you have to erase the slate and start over. You want a dynamically variable means of adjusting LED intensity, example methods being digital-to-analog (D/A) converters or pulse-width modulation (PWM). Either way, you're looking at a lot of hardware :shock: .

Suppose you had Black-to-White LEDs. To display a monochrome image, you'd want at least 6 bits of resolution in the D/A. For RGB, you can skimp a little on the red and blue (red, blue and green all contain some luminance information, but green contains the most). So maybe a 6-bit D/A (or the PWM equivalent) for green, and 5 bits for red & blue.

Multiplexing could reduce the number of necessary PWM generators (it's all part of the same concept, timeslicing), but only to a limited extent, as RGBrainbow pointed out.

It's a nice idea that sounds simple, but would be difficult to implement in a practical manner using standard LEDs and off the shelf controllers.

//Edit - though it's probably doable with fast 6-bit D/A converters. Three FAST 6-bit D/As could be fed intensity data in real-time to handle a 30 x 30 LED matrix.
 
RGBrainbow said:
Hi,
the disadvantage of multiplexing LEDs is the reduced maximum brightness of the LEDs. The more LEDs are driven, the smaller is the timeslot for a single one. Balancing the brightness by rising the LED current only works up to the LED's Imax which is normally ways too low to equalize the loss of brightness.

That isn't normally true, if your LED is rated at 100mA you can quite happily pulse it at 1A with a 10% duty cycle, or 10A at 1% duty cycle. It's how multiplexing is normally done, which is why it's very important that the multiplexing doesn't freeze and leave a single row of LED's switched on.

When designing a multiplexed LED system you would normally design it to give the same brightness as a non-multiplexed one, simply by increasing the current pulses accordingly.
 
off the shelf

Actually, I'm wondering if you couldn't adapt a PC video card that has separate RGB outputs. These have 3 video speed DACs already built in, though you'd have to add some multiplexing hardware for LED selection and figure out which of the cards' timing signals to trigger off. A firmware programmer's manual for the card would also be useful. Not a simple exercise but also not re-inventing (a difficult part of) the wheel.
 
I think an FPGA is more suited to this application than a microcontroller. With a PQFP208 (which can be hand soldered) you'd have ~150 I/O lines. You could set up 90 PWM generators one each for RGB *30. You have 30 enable lines for each of the rows. You then just enable each line and output the appropreate PWM signal for all 30 rows. A mid-sized Spartan 2E should have enough built in block ram to hold all your pixel values. You can also implement a simple 8 bit microcontroller bus for a microcontroller to change the Pixel Values.

Digikey has Spartan 2E FPGAs for about $20 each. And Xilinx has free design tools.

Hope this Helps
Brent
 
you guys are very helpful...i hope to be able to pull this off...i am confident i can, but doesn't sound like an easy project....gotta fire up my solder gun...please let me know if there are any more thing/pointers which would help me out...thank you agian for your time!!
 
i was doing some searching for info and found this....what do you guys make of this??

**broken link removed**
 
Hi,

Nigel wrote:
...if your LED is rated at 100mA you can quite happily pulse it at 1A with a 10% duty cycle, or 10A at 1% duty cycle

I don't think that this will work with all types of LEDs.

Some time ago i multiplexed 180 LEDs (60 RGB) with one PWM of a PIC16c64. The result of rising the current according to the brightness loss (20mA normal -> ~3.5A multiplexed@~0,5% duty cycle) were black LED-cases because the higher current had toasted the bond wires of the LEDs after a while.

So testing the LEDs You want to use is recommended.

regards
joachim
 
RGBrainbow said:
I don't think that this will work with all types of LEDs.

Some time ago i multiplexed 180 LEDs (60 RGB) with one PWM of a PIC16c64. The result of rising the current according to the brightness loss (20mA normal -> ~3.5A multiplexed@~0,5% duty cycle) were black LED-cases because the higher current had toasted the bond wires of the LEDs after a while.

I suspect you probably had a problem somewhere, 180 LED's gives plenty of scope for mistakes!. Obviously you have to multiplex at a reasonably high frequency - otherwise you can toast them on a single pulse.

The values you give above look completely wrong as well, if you're multiplexing 180 LED's you should have then connected in a matrix - say 18x10 (for easy figures), so your current limiting resistors should provide either 360mA or 200mA - not 3.5A.

The only LED's I've seen which appear not to permit high current pulses in this way are the extremely bright ones - the type that have heatsinks built in! - the specs gives both constant and pulsed current values.
 
Hi,
@Nigel Goodwin: No, everything worked fine (hard- and software). There were 60 common-cathode-RGB-LEDs.
Due to the algorithmic way of producing the display content the common cathodes were driven by 4 4514-ICs (plus transistors of course) The 60 anodes of each colour were connected together driven by a transistor plus current limiting resistor. The LEDs were driven one after the other, refresh rate was about 60Hz. Maximum 'on' time of 1 LED was ~90µs followed by 16,5ms 'off' and this 60 times per second. Plenty of time to cool down. I started with the resistor for the nominal 20mA (what didn't put out much light) and then trying lower values until reaching the theoretical 3,5A. After a while the LEDs showed a 'blackish' coating from the inside (like a long used light bulb) and then fell out. The reason ? The bond wires were gone. Maybe this was a specific problem of the LEDs I used.
Because I'm working on RGB-stuff for lighting use since then every LED gets it's own PWM channel driving it at nominal current -> no problems.
regards
joachim
 
i have been doing some more reasearch....bought book microcontroller prject book at Barnes and Noble today...it's for PICBasic and PICBasic Pro compilers for PIC 16F84 microcontroller...any comments on this? seems like it would do what i want eventually after many hours of learning/error...i started reading and found that the chips are relatively inexpensive which leads me to believe i must use a lot of them for 2700 LED's...i think i will first try 3 LED's and then take it from there. I am assuming i should get a PIC with flash memory so i can reuse it later for bigger project.
 
# of DACs or PWM generators required?

Something I hadn't considered in my earlier posts was the persistence time of LEDs vs. phosphor CRTs. For 2700 LEDs, bmcculla's FPGA suggestion has a better chance of working than a bunch of PIC16F84s, but probably still falls short (side note, PQFP-208 packages can be hand-soldered, my limit is a PQFP-160 (same physical dimensions as a PQ208 with a larger pin-pitch), unfortunately this package has fallen out of favor with FPGA vendors. Try soldering a dummy part/sample to get familiar with the level of difficulty :) ).

Multiplexed displays often have around 4 - 8 digits (25% - 12.5% duty cycle, with a corresponding increase in peak LED current to maintain intensity). Even with 90 PWM generators, 30 multiplexed RGB columns only allow a 3.3% duty cycle for each pixel at full brightness. That 3.3% is then reduced by the PWM value (PWM output at 25% = 0.8% duty cycle)

Realize that multiplexing and PWM are based on the same idea, and the only way to increase the time slot alloted to each LED is to increase the number of PWM generators (or DACs) and run them in parallel. I don't know how many DACs or PWM generators would be required to get adequate intensity from a 30 x 30 RGB LED matrix, but it's probably more than 90.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top