Note: Schematic is not my best work, but this should pass on information.

I've designed the following circuit; The purpose of this is to have the Arduino Nano control the WS2811 LEDs and also control their power via MOSFET IRF540N.

Problem is: When I ground the MOSFET Gate pin to 0V, the LED's still glow, meaning that there is still a flow going on. I've grounded manually via wire.

Only when I remove the connection from MCU pin D4 and WS2811 pin DI will the LED's go out like intended. So my conclusion is that the MCU pin D4 is Weakley conducting to ground(?).

The only advice that I've gotten is to use a P-Channel MOSFET instead of N-channel. I don't know what options I have at the moment. Would adding a diode in between the MCU and LED help here?

enter image description here

  • \$\begingroup\$ Try making D4 high when D5 is low. \$\endgroup\$
    – Andy aka
    Jan 12 '21 at 12:48
  • \$\begingroup\$ I kind of understand what that would do - but can you elaborate? \$\endgroup\$ Jan 12 '21 at 12:51
  • \$\begingroup\$ It prevents any 0 volt connection via D4. \$\endgroup\$
    – Andy aka
    Jan 12 '21 at 13:01

Do not disconnect a ground of a device that has data connections. That is a sure way to damage your MCU data pin with overvoltage and overcurrent.

When you turn off the FET, the chip inside WS2811 loses the ground connection, and if data pin is low, current can and will flow into WS2811 supply pin and via WS2811 internal data pin protection diodes out of data pin into MCU data pin and from there to GND.

In case of WS2811 has a larger supply voltage like 12V, current can flow into MCU data pin even if pin is high, and it actually tries to power the MCU via internal protection diodes.

The circuit diagram internals of your drawing and how WS2811 actually works, so it may provide a wrong sense of how it works.

  • \$\begingroup\$ Ok - so my only option is P-Channel? \$\endgroup\$ Jan 12 '21 at 13:20
  • \$\begingroup\$ Yes, if you want to control power supply to the chip, you must cut the positive supply with a P-channel FET. Why do you want to cut power anyway? \$\endgroup\$
    – Justme
    Jan 12 '21 at 14:29
  • \$\begingroup\$ Because the WS2811 led strip uses some mA even when the leds are off - so I want to conserve power, since its a battery powered application. \$\endgroup\$ Jan 12 '21 at 15:14
  • \$\begingroup\$ Also - would a diode on MCU pin D4 help me out? \$\endgroup\$ Jan 12 '21 at 15:31
  • \$\begingroup\$ If you put a diode, it will most likely prevent communication. You have to put a P-FET there. \$\endgroup\$
    – Justme
    Jan 12 '21 at 16:44

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.