LED Bar Graph -- Multiplexed

This version of the LED bar graph still requires ten pins, but obviates the need for Darlington drivers. The secret is that by using rapid multiplexing, the eye is deceived into thinking more than one element is lit, even though that's not the case. Thus, the current demands on the PIC are trivial. Here's the schematic, which you'll observe is the same as that for the direct-drive LED dot graph project seen earlier.

The PMP code for this is quite interesting. Timer0 is used to generate interrupts at a rate of 1953 Hz. Each time an interrupt occurs, the next element of the bar display is turned on briefly (the previous being turned off, of course). Since there are ten bars, this implies that each is constantly being refreshed at a rate of 195 Hz, far too fast for the eye to detect any flicker; all selected bars really do appear to be lit simultaneously.

Be sure to study the software; this project will make you come away really appreciating just how easy-to-use and powerful PIC Micro Pascal is.

Since the individual LED bars are only lit briefly, you can safely reduce resistor R1 to 100 ohms to bring the brightness back up to normal.

Click to get the source code.
Click to get the schematic PDF.

Next Project: LED Bar Graph -- Charlie/Multiplexed

No comments:

Post a Comment