3
\$\begingroup\$

I'm trying to PWM a 5 meter RGB LED strip with a microcontroller. With this setup:

schematic

simulate this circuit – Schematic created using CircuitLab

I have built it on a breadboard and probed the drain with my (new) scope and saw this huge overshoot:

Drain voltage

Drain voltage

Why doesn't the diode catch that spike? I though an 1N4148 would be fast enough. The power supply is a 12V 6A switching power supply from eBay. Is that why the voltage drop as low as about 8V?

Here is the gate voltage:

Gate voltage

Gate voltage

The high frequency spikes are from the 12V rail it seems, here how the 12V supply rail looks like:

12v rail noise

I realize that breadboards are crap for signal integrity especially since I have used crappy long jumper wires but I had never guessed it would be this bad.

So why doesn't the diode catch those spikes ? And how can I reduce them? Also, is this power supply a total crap?


EDIT:

I have placed a couple of caps to decouple the power supply, there is still an overshoot:

Drain

I've added a 100nF ceramic cap across D4 and the overshoot is totally gone: Drain with Cap

It looks good now, but notice the 2nd channel (in yellow). That's the power supply (which is a lot cleaner with the decoupling caps). Now another question comes in mind:

Why is the Drain voltage only about 6v when the leds are off ?

\$\endgroup\$
7
  • 1
    \$\begingroup\$ the 1n4148 is not fast enough, the question remains beacuse the leds are not inductive enough to produce such a spike. I'd point my finger to a crappy power supply, but that's just a guess. \$\endgroup\$ Aug 8, 2014 at 17:35
  • \$\begingroup\$ The led strip is 5 meters long, so that's like a 10 meter trace. This must have significant inductance, right ? \$\endgroup\$
    – Mike
    Aug 8, 2014 at 17:53
  • \$\begingroup\$ @Mike The inductance is a function of the area encircled, not the length of the circuit. \$\endgroup\$
    – Phil Frost
    Aug 8, 2014 at 18:02
  • \$\begingroup\$ The fact that you can see those PWM spikes on your ground and all your signals tells you that you have a major scope connection issue. \$\endgroup\$ Aug 8, 2014 at 18:19
  • 1
    \$\begingroup\$ It might be better to ask a new question rather than append a new one here. \$\endgroup\$
    – Phil Frost
    Aug 10, 2014 at 11:27

2 Answers 2

7
\$\begingroup\$

You have no capacitors across the power supply. That's going to cause problems, even with a good power supply.

Furthermore, "crappy long jumper wires" and "breadboard" throw stray inductance everywhere. You will see voltage overshoot whenever current abruptly changes according to \$v = L\:\mathrm di/\mathrm dt\$, where \$L\$ is some value determined by the crappiness of your long jumper wires, and the loops formed by your breadboard connections.

You also haven't given details of your measurement setup. If the ground lead of the scope is not very near the probe tip, this introduces even more inductance into your measurement device, and you will measure more overshoot than there is. At fast MOSFET switching timescales, even the inductance of the alligator-style clip typically provided with the probe can be significant.

I would hazard a guess that this problem isn't a problem, if you add some capacitors across the power supply, and build the circuit with a reasonable layout mindful of stray inductance.

\$\endgroup\$
10
  • 1
    \$\begingroup\$ can stray inductance produce such a high (2Vcc) spike? I mean, that's what we see so it's happening, but aren't there any other reasonable culripts? \$\endgroup\$ Aug 8, 2014 at 17:47
  • \$\begingroup\$ This is exactly what I'm asking. I just threw this circuit together really quickly, and slacked off with the wire length and caps. Could there be any other reason for those spikes ? \$\endgroup\$
    – Mike
    Aug 8, 2014 at 17:50
  • 2
    \$\begingroup\$ It looks like he's trying for a shut-off time around 1 ns. If he starts with 100 mA, it only needs 20 nH of stray inductance to generate a 2 V spike. Pretty easy to get 20 nH in a breadboard ratsnest. \$\endgroup\$
    – The Photon
    Aug 8, 2014 at 17:50
  • \$\begingroup\$ Also if you introduce inductance in your scope probe (usually by connecting the ground far away from the thing being measured), then you will measure more overshoot than there actually is. \$\endgroup\$
    – Phil Frost
    Aug 8, 2014 at 17:51
  • \$\begingroup\$ I just looked again and the turn-off time might be more like 50 than 1 ns. Even so a really bad breadboard could have enough excess inductance to cause this scale of problem. \$\endgroup\$
    – The Photon
    Aug 8, 2014 at 17:53
1
\$\begingroup\$

Maybe this is just a measurement problem. Are you using a nice x10 scope probe? It could all just be ringing in your lines. (I don't think you need D4, it would be needed with an inductive load, but not here.)

\$\endgroup\$
5
  • \$\begingroup\$ Yep, the probe is a 10x probe. I managed to "fry" two mosfets when I didn't use D4. \$\endgroup\$
    – Mike
    Aug 8, 2014 at 18:55
  • \$\begingroup\$ @Mike I'd guess that the problem isn't what you think it is, and D4 is masking the real problem that is frying your MOSFETs. \$\endgroup\$
    – Phil Frost
    Aug 8, 2014 at 19:03
  • 1
    \$\begingroup\$ Hi @Mike, Hmm that's wierd. How does a little 1n4148 save a big FET? So maybe there is some inductance in the 5m string... could you add some C in parallel to it? (C across the diode string.) \$\endgroup\$ Aug 8, 2014 at 19:12
  • \$\begingroup\$ I just did, see my edited question. \$\endgroup\$
    – Mike
    Aug 8, 2014 at 19:15
  • \$\begingroup\$ Excellent, Mischief managed then. \$\endgroup\$ Aug 8, 2014 at 19:19

Your Answer

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

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