I would like know your opinions on my circuit. I have LED strip which is consists from 60 ws2812b chips. I want switch power ON/OFF by N-MOSFET. My question is about using flyback diode. I read that is recommended use it with LED strip to protect MOSFET, but I think it is unnecessary. Next I don't know if is possible combination flyback diode with electrolytic capacitor.

Thanks for your responses

a busy cat

  • 1
    \$\begingroup\$ Why do you think you need a capacitor? \$\endgroup\$ – Transistor Sep 27 '16 at 17:30
  • \$\begingroup\$ @transistor a 1000 uF cap is recommended for smart led strips. Since it's 5V, that's likely smart leds. \$\endgroup\$ – Passerby Sep 27 '16 at 17:37
  • \$\begingroup\$ 100uF is better with lower ESR and just 100uF is specified by supplier Pololu. \$\endgroup\$ – Sunnyskyguy EE75 Sep 27 '16 at 18:57

You should better consider a high side switch since the WS2812B is more than a passive component and could be damaged if input signals persist while GND is switched OFF. VSS will go near to VDD over time and Vi is only allowed to be VSS - 0.5 V to VDD + 0.5 V. The IC could be damaged if Vi left this interval.

A flyback diode or snubber network is only required for loads with decent inductivity which is not the case here.

The capacitor should better be connected to ground permanently to be able to stabilise VDD from the beginning.

  • \$\begingroup\$ Thanks for your response. I will use high side switch with P-MOSFET. I have on you one next question, should I connect 100uF capacitor before or after P-MOSFET? I think, that before MOSFET is better solution. \$\endgroup\$ – Libor Oct 1 '16 at 10:37
  • \$\begingroup\$ @Libor: The capacitor should be connected to your voltage source and ground, parallel to the MOSFET and your LED strips; the MOSFET should not switch the current through the capacitor. \$\endgroup\$ – Simon Oct 2 '16 at 12:40

An led strip, even these smart leds, are not an inductive load. A flyback diode is used across an inductive load, like a motor or relay or solenoid, to protect against inductive field collapse generated current flow. So it's not necessary here.

That said, a smart led strip can just be set to all off, and the current draw should be very minimal at that point. So a mosfet is normally not needed to shut it off, unlike a dumb led strip. A mosfet is also not needed to provide dimming or other features, like a dumb led strip needs.

As the other answer says, if you do float the ground, there may be issues with the data pin still being driven. As high impedance inputs this shouldn't be too much of an issue, but to be safe, make sure you turn your data pin off/Hi-Z/Input. Otherwise a high side p-channel FET or PNP transistor is needed. Since this is 5V, that's not really a problem and could be driven directly.

  • \$\begingroup\$ what Vdrop on5V do you expect .charging up a 100uF with a 9 milliohm MOSFET? \$\endgroup\$ – Sunnyskyguy EE75 Sep 27 '16 at 18:48

ALthough a cap >100uF is recommended by one supplier and perhaps others suggested 1000 uF, no one suggested switching that cap from the same uC.

The cap must be before the switch close to the stripleds to reduce the chance of transient errors in the logic.


General purpose Caps have an ESR of 1~2 Ohms at 100uF and low ESR caps will be 1/10th of that or less. So your 5V rail will spike low from the surge current I=V+/ESR, when switching the cap.

But you need the cap close to the stripleds, to decouple the MOSFET drivers on each chip, so your added "master ON" MOSFET MUST ALSO be close to the power connector, but after the cap.

You ought to understand Ohm's Law by now and fast switching a large cap will result in a surge current determined by V/ESR. THis means the uC board would need 10 of the same caps in equivalent C and 1/10th ESR to just reduce the transient drop to 0.5V or 10%.

precautions included from POLOLU website are

Warning: The WS2812B seems to be more sensitive than the TM1804 on our original LED strips. We recommend taking several precautions to protect it:

Connect a capacitor of at least 100 μF between the ground and power lines on the power input. Avoiding making or changing connections while the circuit is powered. Minimize the length of the wires connecting your microcontroller to the LED strip. Follow generally good engineering practices, such as taking precautions against electrostatic discharge (ESD). Consider adding a 100 Ω to 500 Ω resistor between your microcontroller’s data output and the LED strip to reduce the noise on that line. If the strip does get damaged, it is often just the first LED that is broken; in such cases, cutting off this first segment and resoldering the connector to the second segment brings the strip back to life.

Consider the gate has a TVS for ESD protection if you intend to have loose connectors.

  • \$\begingroup\$ "and you lapland to use a ..." - did you intend to write "and you decide to use a ..."? \$\endgroup\$ – Andrew Morton Sep 27 '16 at 20:43
  • \$\begingroup\$ yes iPad's touch type spell autocorrection is pretty bad eh? \$\endgroup\$ – Sunnyskyguy EE75 Sep 27 '16 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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