I have a board with a 16x10 led matrix.

The columns are switched with DMG9933 Dual P mosfets.
The rows are driven with a constant current led driver ST STP16CPC26 (similar to TI TLC5956)

I noticed this problem because there where some ghosting between the columns.
I tried to solve it in software, by adding more blank time. That didn't change anything. The blank time was longer then the on time. Lowering switching speed didn't help either.

I made a diagram of a single LED.
Adding R1 Helped mitigate the problem. R1 needs to be added once per column, not for each LED.

Here is a diagram of a single of a single LED

Without R1:
Green is the gate and blue is the drain. Without R1

With R1:
Green is the gate and blue is the drain. enter image description here

I though at first that it might be leakage current, but this transistor supposed to have that under 10na so i doubt that's the cause. I've built 2 of these boards and both exhibit this problem on all 10 columns. There should be very little capacitance between the LEDs and the drain.

So what is the cause of this? Is this the fault of the led driver maybe?

  • \$\begingroup\$ As drawn you have the MOSFET backwards -- the source should be connected to +3V3, and the drain should be connected to the LED string. I would expect, however, that the diode would hold the LED voltage up more if that were true in your circuit. \$\endgroup\$
    – TimWescott
    Commented May 18, 2019 at 18:01
  • \$\begingroup\$ Assuming your real FET is connected correctly, I suspect it's the capacitance of the LED itself. \$\endgroup\$
    – TimWescott
    Commented May 18, 2019 at 18:13
  • \$\begingroup\$ @TimWescott Thanks for pointing that out, it is connected correctly, i just messed up this quick schematic. Uploaded the correct schematic. \$\endgroup\$ Commented May 18, 2019 at 18:44
  • \$\begingroup\$ I'd take a closer look at the STP16CPC26 datasheet, section 9.3 'Generators voltage drop': "In order to correctly regulate the current, a minimum dropout voltage must be assured across the current generators.". For your 20 mA, this is around 170 mV. When you turn off your FET, this voltage isn't available. I can't categorically say that's causing the problem but you should comply with the dropout voltage requirement. You can then see if it fixes your problem. Try connecting at 10K resistor between 3V3 and the LED cathode, remove the 1K and see what waveforms you now get. \$\endgroup\$
    – TonyM
    Commented May 18, 2019 at 19:46
  • \$\begingroup\$ @TonyM I'll try that resistor, but i doubt that's the problem, because when this problem occurs the led driver is turned off. \$\endgroup\$ Commented May 18, 2019 at 20:12

2 Answers 2


All diodes have a capacitance which reduces with reverse voltage, which does not occur here. The capacitance also increases with rated power.

This is a very old known issue when multiplexing any LEDs.

Beware that the Abs. Max/rated current is < 4:1 on most LEDs and in often 1.5:1 in small LEDs.

  • 1
    \$\begingroup\$ Can an LED have this much capacitance? I mean i tried it with a 10k resistor first, that did make it better, but it was still visible. I don't know if it makes a difference, these are 0805 leds. I'm running the LEDs at 20ma, that's their rated continuous max current. \$\endgroup\$ Commented May 18, 2019 at 18:48
  • \$\begingroup\$ Yes it does seem like nF is too much. WHat else is there? \$\endgroup\$ Commented May 18, 2019 at 21:18
  • \$\begingroup\$ Not much, besides the LEDs there are 4 rotary encoders and 6 buttons, and 4 connectors. The schematics are up on github \$\endgroup\$ Commented May 19, 2019 at 7:43

I guess you may have it solved, already, but here is my contribution. I have had the same problem due to the input capacitance of the MOSFET. You see, when it is off, the gate is at VCC and the capacitance between gate and drain will work to supply some current to the LED (mostly due to the switching from STP16CPC26 output). The best would be to use a N-Channel MOSFET and keep the gate at 0V when this LED shall be off. This way the input capacitance would be grounded and no current shall flow.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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