Multiplexing 16 LEDS


#1

Here’s the issue I’m trying to make out how I multiplex all 16 LEDS and do what I need them to do by a press of the left button? refer to this crappy diagram below

key

1= Lit
0= not lit

00000000
11100000

as you see from that crappy diagram I’m in need to keep all LEDs on to serve as a power level of the Playmates Toy phaser’s gutted display where the LEDs are gonna be in but how I can multiplex them and have them left on for every left button press?


#2

You have lots of choices. Easiest is one led per I/O pin but there usually aren’t that many I/O pins available and there are current restrictions on the micro’s I/O ports making that impractical for this may leds. Two 74hc595 (two 16 pin dip chips that need construction) will do it on 3 I/O pins (clock, data and output latch) but with limited output current (70 ma for all outputs, so only a bit less than 10 ma per led, which may be too little). For the above you shift the 16 bits in to the registers 1 at a time then pulse the strobe to transfer the 16 bits to the output register to drive the leds. They stay in that state til the next time you change them by pulsing the strobe. Build instructions here:

Charlieplexing:

If you don’t want to build hardware there are prebuilt modules such as these:

runs on the i2c bus, has 20ma output per port (8 bits per module, cascadable so 2 will do 16
leds).

or its bigger brother (1 of these will do you)

http://www.ebay.ca/itm/HT16K33-16x8-LED-Dot-Matrix-Driver-Control-Digital-Module-4-5-5-5V-For-Arduino-/182721886478?hash=item2a8b12b90e:g:qMoAAOSwTtpZll27

which has internal storage for up to 16*8 leds (plus a keypad interface which may help you with your switches). There is an Arduino library available for driving it. Size may drive which solution fits your needs as it will need to fit in the space you have available.

Peter