I am trying to control an RGB LED (with common cathode configuration) with a BC327 PNP transistor. The LED is powered by a 5V line. The base of the transistor is controlled by a BC548 NPN transistor connected to the GPIO of an ESP-01 module (ESP8266). I attach the circuit diagram below.
The values of the resistors connected to the GPIO are selected in such way so that the GPIO is pulled up during boot in order to boot properly.
I can control the brightness of each LED from the ESP-01 but, the problem here is that the LED is flickering when the PWM is supposed to be off.
Do you have any insights on why this might be happening?