MOSFET not turning completely off

ebp

Joined Feb 8, 2018
2,332
This is indeed a peculiar problem. Trying to debug without a scope or at least a logic probe is a challenge.

The supply to the processor board is certainly a possibility. I've been assuming some sort of off-the-shelf development board that would have all the necessaries in terms of decoupling.

"Grounding" is often at the root of problems like this, which is why I suggested the tests a few posts back.

With regard to fast-rising voltage, nasty noise on the LED power supply would be a possibility, but it seems very unlikely to me since different supplies have been tested. It is the sort of thing that might arise due to connecting wire inductance with multiple LED strings e.g. long wire to LED supply, one string turns off leaving the inductance of the wire to discharge through ... something. I've seen a bipolar 555s without decoupling generate 15 to 20 volt spikes at their Vcc pins when running on 5 V with less than metre of wire to the power supply, so a very big spike here wouldn't surprise me. But the problem persists with one string.

Nutshell - Can you post some photos of your setup?
 

Thread Starter

Nutshell

Joined Mar 5, 2017
17
To be honest, I didn't expect so many replies on my thread, considering that it wasn't even a problem so big it could prevent the circuit from working properly. It lead to interesting suggestions though, so I'm happy with that.

I finally got it (actually) working, following these steps:
- first of all, I decided to rebuild the circuit using exclusively new parts (including the stm32, jumpers, breadboard... Everything);
- then, while I was rewiring the circuit, I read something that really made me think:
That still leaves the question of what's dropping voltage to supply the STM32. I haven't seen any mention of decoupling caps on the STM32 either. Finally, I wonder about the ground connection between the STM32 ground and the FET source. If there are multiple power supplies involved, and at least one of them is a switcher, there could be lots of noise, so any imperfection in the ground connections could push the Vgs around.
This. When testing with different power supplies, I only worried about the one powering the strip, because the processor was connected to my pc's usb and therefore to my pc's power supply, which is supposed to be incredibly low-noise. But hey - wall adapters and LTC3780 are switching supplies too and the circuit requires them to be common-grounded with the processor. So that could be at least part of the problem.
- Then I connected a fresh new stm32 to the 5V of a molex connector from my pc power supply and the strip to the 12V pin of the same cable. After uploading a simple code to make the led blink (how ironic) switching between HIGH and LOW with a couple of seconds of delay in between, I've finally seen it turn completely on and off without any extra components but the ones in the original design.
- I tried using the old supply for the strip again and there's some flicker, but it's way less bright than before (if you compare them at the same frequency). So, in the end, I guess that using new parts contributed to solving the problem as well.

This still leaves me with an unsolved question though - I tried a really wide range of filtering caps (from 1 to 470 microFarads), applied them directly on both supplies, on the strip, ... Is it possible that the noise was so high no cap reduced it significantly?

Well, I sure learned a lot today - and I hope this thread was useful for someone else too.

Thank you all (again) for helping me out!

So TL;DR: better use the same supply for the processor and the strip next time.
 

danadak

Joined Mar 10, 2018
4,057
One possibility is feedthru via Cgd. One way of taking care of that would use
a pin, set it to open drain, connect it directly to gate, and turn it on (write a 0
to pin) along with setting drive pin to 0. That way it will ground gate of MOSFET
with Rdson of a few hundred ohms or less.

Regards, Dana.
 

Thread Starter

Nutshell

Joined Mar 5, 2017
17
When you used separate supplies, did you connect the grounds?

Bob
Yeah, grounds were connected together. There was kind of a bigger issue with grounds disconnected though - like the circuit not really working as expected. If you want me to do some more tests, I can rebuild the circuit on a breadboard (the old one's now soldered on a perfboard).
 

danadak

Joined Mar 10, 2018
4,057
If you do not have a scope here is a low speed solution for free -

You can start with a PC sound card based scope for free. Will give you basically
audio rang scope, spectrum analyzer, and function generator all using your
PC sound card.

https://www.zeitnitz.eu/scope_en



http://www.instructables.com/id/Use-Your-Laptop-as-Oscilloscope/

http://www.zelscope.com/

http://www.ledametrix.com/oscope/

http://www.virtins.com/downloads.shtml


But first build a simple circuit to protect sound card inputs so you do not
ruin from transients, overvoltage. Google "protect sound card input".


For example http://makezine.com/projects/sound-card-oscilloscope/


Sound card impedance bridge -

http://www.marucchi.it/ZRLC_web/ZRLC/Steber_An_LMS_Impedance_Bridge.pdf

http://www.sillanumsoft.org/ZRLC.htm


Regards, Dana.
 
Top