Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

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 ?

share|improve this question
1  
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. –  Vladimir Cravero Aug 8 at 17:35
    
The led strip is 5 meters long, so that's like a 10 meter trace. This must have significant inductance, right ? –  Mike Aug 8 at 17:53
    
@Mike The inductance is a function of the area encircled, not the length of the circuit. –  Phil Frost Aug 8 at 18:02
    
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. –  WhatRoughBeast Aug 8 at 18:19
1  
It might be better to ask a new question rather than append a new one here. –  Phil Frost Aug 10 at 11:27

2 Answers 2

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.

share|improve this answer
1  
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? –  Vladimir Cravero Aug 8 at 17:47
    
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 ? –  Mike Aug 8 at 17:50
2  
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. –  The Photon Aug 8 at 17:50
    
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. –  Phil Frost Aug 8 at 17:51
    
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. –  The Photon Aug 8 at 17:53

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.)

share|improve this answer
    
Yep, the probe is a 10x probe. I managed to "fry" two mosfets when I didn't use D4. –  Mike Aug 8 at 18:55
    
@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. –  Phil Frost Aug 8 at 19:03
1  
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.) –  George Herold Aug 8 at 19:12
    
I just did, see my edited question. –  Mike Aug 8 at 19:15
    
Excellent, Mischief managed then. –  George Herold Aug 8 at 19:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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