I am working with some friends trying to multiplex. The issue we run into is we aren't sure if we are hitting a limit on transistor switching speeds.

I am unsure if this is a hardware or software problem. (please let me know if I am in the wrong place)

Here's an example of what we have built. Schematic

Where we have an output attached to each transistor. We want to be able to turn them all on or individually. We ran into a software problem and asked on Stackoverflow earlier, here is reference if needed

Here's the problem we run into: LED Cube

This is where I'm not sure to post in Stackoverflow or here:

We always have a row "ghosted" behind. So from the top (Row 3), we have it on and you can see faintly that row 1 (the bottom) is on. If the Row 2 transistor is activated (and Row 3 deactivated) then we have Row 3 faintly on. (with Row 1 being off entirely)

If we just disconnect the ghosted row from its output, it stays ghosted. Somehow it is being tied to our other output.

The Column transistor is a PNP3906 and the row transistor is a NPN2222. According to their datasheets both seem fast enough (but I don't know how to read the sheet effectively)

I have tried adding a pull down resistor to the base of the row transistors with no avail. I also tried paralleling a capacitor to see if maybe it was a speed issue (link to reference, Russell McMahon's answer)

I would be inclined to say that it is a software bug but since the issue still exists with the output disconnected I am unsure.

One more piece of information. We started out every 20 microseconds to switch rows. (turn row 1 on, wait 20 microseconds, turn row 1 off, turn row 2 on, wait 20 microseconds, etc..)

This makes the "ghosted" LEDs much brighter. The picture in this question which are much dimmer are every 5 milliseconds switch rows. However, going from 5 milliseconds to 1 second delay does not change the "ghosted" row

I realize this might be hard to troubleshoot but thanks if you can help

3906 timing [datasheet]:

  • Delay Time : 35ns
  • Rise Time: 35 ns
  • Storage Time: 225ns
  • Fall Time: 75ns

NPN2222 Timing datasheet

  • Turn on Time: 35ns
  • Turn off Time: 285ns

EDIT: Sorry, I didn't mention voltage. From an MSP430G2553, the voltage is 3.3V, directly from an output

  • \$\begingroup\$ How are you driving the transistors? From logic pins of an IC? Is the IC a shift register? More info needed please. \$\endgroup\$
    – Andy aka
    Mar 25 '13 at 9:48
  • \$\begingroup\$ Yes, please explain what's driving the transistors and at what voltage it's operating. I take it this circuit is one "row", the other rows share the same lines to the NPN transistors, and the PNP is "row select"? \$\endgroup\$
    – pjc50
    Mar 25 '13 at 10:05
  • 3
    \$\begingroup\$ To eliminate the possibility of timing problems : (1) turn row off. (2) wait time t1 (say 100us) (3) turn next row on. (4) wait time t2 (say 1ms) (5) goto 1. This "dead time" at (2) will eliminate ghosting IF it's a timing problem. If the ghosting remains, look elsewhere. \$\endgroup\$ Mar 25 '13 at 10:45
  • \$\begingroup\$ @BrianDrummond Doing it that way explicitly has the expected result. That is a relief \$\endgroup\$
    – Dan
    Mar 25 '13 at 11:48

Explicitly specifying a "dead time" between rows is pointing towards a timing problem. Two possible causes of this :

  1. Some overlap between updating the row and column drivers, e.g. on different ports, written in different cycles. This has a simple software fix : (a) turn off all rows (b) update columns (c) turn on correct row. Alternatively, turn off all columns, update row, turn on appropriate columns.
  2. Switching delay in turning transistors off. Q8,9,10 in the given circuit will saturate, which makes their turn off time slow. My answer to this question describes this phenomenon : the question itself describes a hardware fix to the problem (a schottky diode between base and collector). However a simpler answer is to wait through the "dead time" in software, as suggested in the comment above. Obviously times t1 and t2 can be tuned for best visual experience.
  • \$\begingroup\$ Wow, I bookmarked that link because the more I learn the more I don't know. I put a schottky diode like you posted and that solved the problem. Thanks for the amazing info! \$\endgroup\$
    – Dan
    Mar 25 '13 at 12:50
  • 1
    \$\begingroup\$ Great feedback! It's nice to know the theory actually solves real problems sometimes! \$\endgroup\$ Mar 25 '13 at 13:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.