LEDs
LED's pulsed for say 200% of their 'normal' current at a 50% duty cycle appear brighter than 100% current for 100% duty cycle even though the maths says that it's all the same average current. Provided the refresh rate is sufficiently high. Your eye retains an image for ~ 1/60th second. If you go slower than this, the image fades and you can perceive the flicker. If you go faster, the decay rate is such that it can appear brighter. This may have been the reason for the choice of 60 cps AC power line.
The attack time is significantly shorter than the release (or decay) time, making the eye tend to be a peak sensing device rather than an RMS detector. The human eye is responsive to the peak value of illumination. It is assumed here that the pulses have a repitition rate greater than 24 pulses per second. Otherwise, the perceived intensity is also a function of the repetition rate. Above about 40 pulses per second this perceived increase in brightness levels out and is no longer a factor. this varies greatly between men and women, eye (and hair!) color (melanin content), age, and heritage.
As the number of multiplexed LEDs increases, the percentage of *on* time per LED becomes progressively less and less. Eventually you reach a point where you can't get the necessary current into the device in the required time without damaging the device. You can generally have about eight LEDs or displays being multiplexed before you begin to experience problems. For larger numbers of displays you break them down into groups of 8 and multiplex the groups in parallel.
When pulsing LEDs it is important that the LEDs not be accidentally left ON without pulsing them. If left statically ON for too long you can damage them permanently. The digit strobes need to be turned off explicitly early in the start-up sequence. It is also useful to sometimes explicitly turn off all strobes at certain places, such as at the beginning of your main programming loop.
Note also that if you are providing unequal timing to the digit selects, then one or more of the digits will appear MUCH brighter than the others. (This bug can be turned into a 'feature' if you need to highlight a particular digit.)
You can't pulse LEDs with large currents by just connecting directly to the port pins of a PIC, since the PIC prt pins will only source/sink a few tens of milliamps. Use a transistor to activate the LEDs, and make sure you use sufficient base drive by keeping the base resistor something like 330 ohms instead of several thousands of ohms. A small capacitor in parallel with the base resistor can sometimes help to speed up the turn-on and turn-off of the transistor.
Another advantage of driving the LED from a local capacitor is that you increase the current delivered *to* the LED while reducing the peak currents being supplied via the power bus.
This in turn reduces strange intermittent problems that sometimes arise due to the power gulping that would otherwise take place. You still have to be careful about ground return paths, because the current that the capacitor dumps into the return path can wreak havoc with the poor PIC if you have not explicitly designed the PC layout with this factor in mind. Hint: keep the capacitor ground as close to the transistor's emitter as you can. Then connect this emitter/capacitor node to the regular ground via a separate trace. This way the base current flows into the regular ground bus, but the capacitor *discharge* current is kept pretty much isolated because it is in a tight local loop.
Allan King says:
BUT, it is almost as easy to make your own protoboard LED matrix as just solder LED's into a premade double-sided board. And it's EASIER to make your own than putting together most single-sided premade boards, because the rows require jumpers to go over at least every other column with single-sided boards, and that's *IF* whoever laid out the board thought of the pattern to not need a jumper over every column. Half or as many wires as LED's to stuff and solder. I put a mini-description in the ASM notes, but will make it a bit more clear with a diagram and better instructions here. And a lot of people might just not read far enough into the ASM to see the instructions and how easy it can be to make their own sign.1. You can make the matrix really tight, or loose if you want a bigger sign, but too far apart for the dot size and brightness will make it hard to read close up. Since I usually need mine for testing not display, I make them really tight to save space. Solder LED's into the protoboard, orienting them like on the left below. Solder them in one column at a time, making sure to do it in order so the + lead will be on the outside edge of each row, and only solder the + lead of each LED to hold them in. It's hard to solder down through all the leads if you don't do it one column at a time, so you're only soldering the leads at the edge of the forest. Then cut all leads down to 1/4 or 3/16 inch or so. Exact lead height's not critical here, just short enough to solder down through easily and be stiff for pushing the paper on, but still long enough for the higher layer.
2. Then take bare wire and solder it straight against the - leads and board pads for each column like on the right. Then cut the - leads as short as possible against the column wires.
+- +- +- +- +- +- +- +- +- +- | | | | | +- +- +- +- +- +- +- +- +- +- | | | | | +- +- +- +- +- +- +- +- +- +- | | | | | +- +- +- +- +- +- +- +- +- +- | | | | | +- +- +- +- +- +- +- +- +- +- | | | | |3. Now you just have the + leads sticking up at ~1/4 inch and the columns wired and flush. (*Good idea part is here!*) Push some heavy paper onto the + leads and flat against the columns wires to insulate the columns from the rows. With just the + leads exposed, you can now solder on row wires similar to how you did the columns, and cut the + leads against the wires. Just try not to start a fire soldering against the paper. Good idea to also put another paper layer over everything so the rows won't short together if you touch it against something metal while it's on.
When I made my original handmade matrix I cut all the leads, then had to bend the bus wire up and over each column wire to connect the + leads. A real PITA. Then hit on leaving the plus leads higher and doing them 1/4 inch in the air, since it's a lot easier if you can solder the row wires without having to work them around the columns. Quickly thought of the paper insulation after that to keep things close. Needless to say the paper insulator idea is a heck of a lot faster than bending the row wires over the column wires and less tedious, and much less likely to short something than without the insulation between columns and rows. It really is only a little more work than even just soldering LED's into a custom double-sided board by hand, without the expense of the board, and definitely easier than dealing with the jumpers and LED's for a single-sided board. And the paper sandwich lets you put the matrix wires flat together, keeping the whole assembly reasonably thin as well as making it not so delicate to handle.
Now just hook up your 4094's in a serial chain from right to left (the oldest (first) bit clocks in on the right, and ends up on the left), with 2003 buffers with resistors to sink the column wires. 33 ohm resistors seem to work well here, with good brightness, but are probably technically too low for the 2003's. PNP row transistors are needed, and these have to source up to the full row's worth of current. Probably should use bigger ones than 2907's with 40 LED's with 33 ohm resistors! ;) The whole sign with all 280 LED's on at full scanning brightness only draws about 1.5A at 5v though, so they probably won't die since each transistor only takes 1/7th (or 1/8th if you do a by 8 matrix) of that. But that may be a limit of the converted modem test supply and not what this sucker could pull down. Then just add a pic to run all of this (a link to some simple 16F84 software is on my page at the bottom) and you have a sign!
Hope you find this useful,
See also: