WS2812 Shutdown - Page 1
Forum section: electronics / projects

author: bfrigon
author_rank: Contributor
timestamp: September 05, 2018, 01:12:19 am
content: Hi,I have 34 IN-PI554FCH RGB leds (WS2812B clone). The project will be powered from a DC wall wart but also has a battery backup. In low power mode, simply turning the leds off is not enough as they still draw around 1 mA each even when off.I searched on google... The solutions i found suggest using a P MOSFET as a high side switch to turn off VCC going to the leds when not needed. As i understand, using a high side switch instead of a low side is better as disconnecting the ground would allow too much current to flow from VCC to the data pin and damage the IC.But what if VCC is disconnected and the data pin is left high. Wouldn't that do the same thing by trying to power the entire IC from the data pin. There is a 470 ohm resistor on the data line, so worst case scenario, about 10mA is going to flow from the data pin of the first led to ground. Would that damage the led if i forget to set the data pin to low before turning VCC off?Or maybe i am overthinking the problem...

author: ajb
author_rank: Super Contributor
timestamp: September 05, 2018, 01:19:47 am
content: No, you're not overthinking the problem. At 5V, a 470R resistor will limit the current through the signal pin to a bit more than 1mA, which probably isn't enough to hurt anything, but to be on the safe side it's a good idea to set that pin (presumably on your microcontroller?) low or to a high impedance mode (which means configuring it as an input, usually).Another option, if for whatever reason you can't rely on turning off the data pin, is to use a small buffer device that is designed to have its inputs driven when unpowered, and power this from the switched LED supply. There are some single logic gates in SOT packages that would work nicely here, and as a bonus they can be used to level shift the data line if you're using a 3.3V MCU.Regarding your power switch schematic, the NPN transistor is only necessary if you're trying to switch a higher voltage than your MCU supply. If your MCU is running at 5V, then you can drive the gate of the P-channel MOSFET directly (just make sure that it's a logic level part, and put a resistor from the gate to the source to make sure it stays off until you want to turn it on).

author: bfrigon
author_rank: Contributor
timestamp: September 05, 2018, 02:48:21 am
content: Quote from: ajb on September 05, 2018, 01:19:47 amThank you ajb!That's a good idea. I prefer this than to rely on software to make sure things don't blow up.I found the SN74LVC2G34, on the datasheet, it says :The SN74LVC2G34 device contains two buffer gates that each perform the Boolean function Y = A. This deviceis fully specified for partial-power-down applications using Ioff. The Ioff circuitry disables the outputs, preventingdamaging current backflow through the device when it is powered down.I believe it is more than adequate for this purpose here and it also has 2 gates (I need to control two sets of leds independently).As for the power switch, i run the MCU at 5V... I was not entirely sure i could drive the gate directly...