Hi, im using 5 digital pins and one 4067 16channel multiplexer to multiplex 16 x 5 LED's. To multiplexer pulls the LED's to ground. (Its for my 16steps sequencer)
The problem im having is that, some led's glow faint when they should be off... I have the feeling im missing some diodes? but dont know where?
here is the schematic, Ow before the LEDS are 220 ohm resistors ofcourse.
Sorry but that is just not the way to multiplex LEDs or the way to use that multiplexer.
You seem to be feeding 5V into the vase of your transistors with no current limiting resistors at all.
That circuit is just pants.
Hm, well maybe speed isnt the real issue, but its just that i have to wire up all the 80 leds seperatly... If i multiplex them per 5 (per step on the sequencer), i have 5 wires and then i can connect them all to them on the frontpannel.
You should use a DIGITAL multiplexer (and of course also base resistors).
The analog multiplexer outputs (well, "throughputs") will become high impedance when de-selected.
You can mend this by base pull-downs (100k or such)
OTOH the internal resistance of the analog channels (100 ohms) results to a current limitation (45mA) that MIGHT be acceptable to your transistors.
Yes, that should work. One typically would connect R3 directly to the base to stress its intention, but that makes no difference at all.
Edit:
.. and it would suffice to have just ONE base resistor (1k or such) at the 5V INPUT of the multiplexer rather than 8 at the outputs. But you need 8 base pull-downs, of course!
I had similar issues when I made a 4051 multiplexer setup. What I found was the chip control lines were floating when in the low state. I put a high value resistor (~47k) on each of the control lines connected to ground. This solved the issues. You might want to try it on your A, B, C, and D control lines. Putting resistors on the chip I/O lines might introduce errors if analog signals were being multiplexed.
Unpredictable outputs may occurr with a 4051 type chip (this is the chip I have experimented with) when the input control lines (A, B, C, and D in the post) are either not driven at ~5v input or not connected to ground.
If the arduino digital output pins do not sink to ground when in the "low" state, then the control lines to the multiplex chip my "float" and produce undesired results.
The solution provided might just be a workaround for the real problem.
Easy enough to to test. In the origional wiring configuration, jumper the low control pins to ground and see if the dim leds go dark.
So, what is causing the problem other than your usual "..and this is not the way to use an analogue multiplexer."? I've never tried driving transistors with the 4051. The fact that the transistor is connected to another 5v source could be introducing issues by having some backfeed to the 4067 output pins. One could check this by adding a diode between the chip output pin and the current limiting resistor, and removing the grounding resistor. Also, pin 15 (E bar) on the 4067 chip probably needs to be connected to ground if not already done so. I'm interested in finding a cause and not just a fix.