Digitally switching on/off a WS2812B eco LED strip connected to 3.7V lipo battery

Thread Starter

bmbouter

Joined May 29, 2021
75
I have a 3.7V lipo battery driving the Vin of a WS2812B eco LED strip. My esp8266 can signal the LEDs on/off, but even in the off it drains the battery. I'd like to use a have a component (transistor or BJT?) between the battery anode and the anode of the LED strip that is normall open, but can be closed digitally via the ESP8266.

The WS2812B eco works all the way down to 3.0V, but if I put a transistor in there the voltage drop would cause the battery's usable lowest voltage to go from the 3.0 V currently to 3.0 + Vf, so maybe 3.6 V? That's a lot of battery time lost, so I need a component with a very minimal Vf.

The other concern is to minimize power lost while the esp8266 is holding the LED in the on state. Don't some transistors work off of Voltage being present instead of current? Having the voltage style would be the best here because I want to minimize the power lost while keeping the LEDs in the on-state.

What would you do in this situation?
 

BobTPH

Joined Jun 5, 2013
8,952
Yep, I found that out the hard way. A single meter of WS2812B takes something line 40mA with all the LEDs off.

A suitable MOSFET can have a voltage drop of only millivolts. What is the max current to the strips? That will help choose the particular MOSFET.
 

Thread Starter

bmbouter

Joined May 29, 2021
75
There are three strips, and the total max I measured was 160mA, so maybe double it and plan for 320 mA. It's actually 3 strips so I could use 3 of them in parallel with each being 55mA each or with a safety factor of two say 110mA. Does that make sense?
 

BobTPH

Joined Jun 5, 2013
8,952
The 160 mA sounds like the idle current, i.e. with the LEDs all off. To size the MOSFET, you need the max current when the LEDs are on. That would be 60 mA per individual LED.
 

Thread Starter

bmbouter

Joined May 29, 2021
75
There are 90 LEDs total, 30 per strip, so with 60mA per LED that would be 90 * 60mA = 5400 mA = 5.4A. Per strip that would be 30 * 60mA = 1800 mA or 1.8A.

The LEDs are really bright, so the thing is that I've turned the brightness way down < 20% of total. Also the patterns I use don't run all 3 colors at once, so the 160 mA actually is the effective power usage as measured for all 90 total of the highest power draw pattern. Also the ECO version is supposedly more power efficient versus the normal WS2812B non ECO, but I couldn't find a proper data sheet on the ECO version.

What would be really great is if you could point me to one for the full power and maybe one for this measured power. I'm hoping you can identify the MOSFET type (and why) and which parts of the data sheet are significant. Then I could go read more about those datasheet metrics and learn some too! I'm very excited.

Thank you for all the many replies I've received from you. This community is great.
 

BobTPH

Joined Jun 5, 2013
8,952
I am still puzzled by your current requirements. Maybe the ECO version is better, but 3m of straight WS2812B would use nearly that when off. The fact that you say they can run at 3V indicates that the savings may come from lower voltage rather than lower current.

The MOSFET needs to be sized for the peak current, not average , to ensure the voltage drop.

If it is indeed 160 mA, even a MOSFET with a 1 Ohm on resistance would drop only 160mV.
 

Thread Starter

bmbouter

Joined May 29, 2021
75
Thank you both for the replies. I also doubted my previous measurements so I measured once again, this time using two methods. One was using an INA219 breakout board with an esp8266 monitoring, and the other using a testo 760-2 multimeter. Indeed I see about 160-170mA for the largest power-on pattern. It's surprising to me also, but indeed I have the brightness turned way down.

As an interesting side-note, the base circuitry for the 8266 and AMS1117 uses about 20mA without the LEDs connected. Then with the 90 LEDs connected but showing black it measures 60-61mA total so that's 40 mA for the 90 LEDs quiescent current and showing now light, which is also pretty surprising. I still can't find a proper data sheet on them though.

Regardless I think pointing me to mosfet is exactly what I needed. Thanks!
 

Thread Starter

bmbouter

Joined May 29, 2021
75
Just sharing my calculations here in case they are interesting to others.

I ended up deciding on a [DMG1012T](https://datasheet.lcsc.com/lcsc/1809050424_Diodes-Incorporated-DMG1012T-7_C20512.pdf). The ESP12-F says it works down to 2.7 V and the spec sheet says the IO Vout min could be 0.8 its input (2.7V) so that would be 2.16 V min from the GPIO pin even if operating under minimum conditions. When I look at Figure 1 in the DMG1012T data sheet it shows the 2.0V and higher curves have very nice current flow (certainly more than 160mA, more like 600mA) and also very low Rds(on), e.g. 400mV.

So to consider the voltage drop of the drain-source across the mosfet, if the battery in it's minimum is 2.8V (100mV lost between the battery and the ESP12-F input of 2.7V due to the LDO driving it) then I could expect 2.8V - 400mV = 2.76 V. That's pretty good!
 
Top