Leaking Currents way through LEDs and Microcontroller

Hey guys,I'm using a 18650 Battery Shield combined with a WS2812B Neopixel LED Stripe and an ESP32 Wroom DA Module for a bigger project.
The Battery Shield has a switch to turn off its USB Port - but its 5V/GND Ports are not affected by this switch. As it can be seen in my schematic the LED Strip wont turn off even though the ESP32 is off, because it still gets its 5V from the still activ Battery 5V/GND Ports.
To solve this problem I brought a IRF540N MOSFET wich is used as a switch to interrupt GND connection of the LED Stripe as soon as the ESP32 turns off. This way the LEDs used to turn off the same time the ESP32 turns off.
Unfortunately this is not the case. The LEDs are losing most of their intensity but they keep shining.
My guess I that the current is searching its way through the DIN wire of the LED Stripe. Fortifying this guess - the LEDs turn off as soon as I interrupt the DIN Wire - ESP32 Connection.
So I used a 2k ohms resistor between DIN Wire and ESP32 so that a leaking current would have a much hard way - and it worked! Now the LEDs turns black as soon as I turn off the ESP32 via the Battery Shield Power Switch.
But can it be that way? I tried simulating this situation but there is only 1mA leaking and I dont think this is enough to power 48 LEDs...
So can anyone see whats the problem? Please let me know if you need something elese...

Here is my wiring

And here are my two simulations (with and without 2k ohms - you can see the current in the right corner)


There is another post of me about how to make the LEDs turn of (WS2812B LED Stripe does not turn off completely - #9 by pommesfreak). This post should be more about what the actual problem is.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.