Electronic – PNP transistor turns on at 3.3v

transistors

I have connected a 3906 PNP transistor base to a GPIO pin of ESP32 board. Emitter is connected to 5v and collector is connected to a buzzer. When I program the buzzer (send a HIGH from ESP32), it is permanently on. When I check it against a multimeter, the transistor turns on even when base current is 3.4v (when I though it turns on only if voltage is less than 0.7v).

To cross check the transistor and buzzer, I directly connect base to 5v and the transistor is turned off. Connecting to ground turns on. So, it works correctly when connected directly.

For those who would like to suggest a NPN transistor, I have tried using 3904 NPN transistor and everything works as expected. However the issue is that when programming, all the pins of ESP32 are high by default and the buzzer is ON until programming done.

Can someone tell me how to solve this issue? I need to use PNP transistor only. Thanks in advance.PNP circuit

Best Answer

I suspect you are trying to drive the PNP base with a 3.3V logic signal while controlling 5V to the buzzer. That just isn't going to work. To turn the transistor off (non-conducting) you need to raise the voltage on the base to be close to the emitter voltage, or about 5V. You can't do that with a 3.3V logic signal. You make a PNP transistor conduct by lowering the base voltage about 0.7V below the emitter voltage, not by setting the base voltage to 0.7V above ground.

You might be able to add a pullup resistor from the base itself to 5V to turn the transistor off when the logic output is 3.3V. Select resistor values so that when the 3.3V signal is low the voltage at the base is less than 4.3V. You would also have to select resistor values that limit the current that will flow back into the 3.3V logic output when that output signal is high. This is all just speculation, you haven't provided a datasheet for the device that is driving the base.