Powering WS2812B-B through PNP Switch?

lloydrichards
Posts: 6
Joined: Sun Sep 20, 2020 1:12 pm

Powering WS2812B-B through PNP Switch?

Postby lloydrichards » Fri Oct 30, 2020 10:34 pm

Hopefull someone can help me with this. I have 5 pixel LEDs (WS2812B-B) on a custom PBC with the ESP32 WROOM 32D and want to use a PNP Switch to completely cut off the pixels when in deep sleep. Schematic and PCB layout below. Currently my tester code looks like this:

Code: Select all

void setup()
{
    pinMode(32, OUTPUT);
    digitalWrite(32, LOW);
    delay(5000);
    mimir.initPixels();
    mimir.testPixels();
}

void loop()
{
    mimir.testPixels(5, 1000);
    delay(3000);
};
When I give this a shot, nothing works. I've popped voltmeter on it and I'm getting 3.3V off the end of the switch and have even flipped it on and off to make sure it works. But the pixels are not doing anything. I even took the resistor and MOSFET off and bridged with a 0ohm and then the Pixels worked.

I'm using the S8550 (https://datasheet.lcsc.com/szlcsc/18091 ... _C2147.pdf) and a 100K resistor. maybe this is too much? Any help would be very much appreciated!
Attachments
Schematic.png
Schematic.png (46.16 KiB) Viewed 3654 times
pcb.png
pcb.png (191.95 KiB) Viewed 3654 times

username
Posts: 539
Joined: Thu May 03, 2018 1:18 pm

Re: Powering WS2812B-B through PNP Switch?

Postby username » Sat Oct 31, 2020 4:36 am

I looked up 2 data sheets for the WS2812B-B, both say this is a 5v device. The power range is +3.7~+5.3. Using 3.3V you are already below its power threshold. I suspect that by adding the FET it's going to drop that just a bit more to the point where it does not work at all.

becorey
Posts: 92
Joined: Sat Mar 28, 2020 4:18 pm

Re: Powering WS2812B-B through PNP Switch?

Postby becorey » Mon Nov 09, 2020 5:58 am

If you want to use BJT's, you should use a complementary pair instead of trying to drive a PNP with the ESP32. Use the ESP32 to drive an npn transistor which drives the pnp transistor.

https://en.m.wikipedia.org/wiki/Complem ... dback_pair

Attached is a circuit I used for a little different purpose, using the esp32 to activate an 80V rail for voltage measurement.

You could also use a logic-level NMOS to switch the low side (the WS2812 connection to ground)
Attachments
Screenshot 2020-11-11 151307.png
Screenshot 2020-11-11 151307.png (51.65 KiB) Viewed 3518 times

Who is online

Users browsing this forum: No registered users and 99 guests