Pin 0V when i use a transistor

Hi,

I would like to use a transistor to disconnect the DFPlayer mini when the arduino pro mini 3v is not using it, to avoid consomnsion. I use a transistor PN2222 and 1k resistor.

But it doesn't work. When the pin 12 is high i have 0v at the pin when the DFPlayer mini is connected. But when he is not connected i have 3V to pin 12. What doesn't mean ?

Thank you for your answer.

But it doesn't work. When the pin 12 is high i have 0v at the pin when the DFPlayer mini is connected. But when he is not connected i have 3V to pin 12.

I'm not sure I understand... You write a high to pin 12 with nothing connected and it works - you get 3V.

Then, you connect the 1K resistor and the transistor and pin 12 drops to zero?

In that case, your 1K resistor is shorted (or it's way lower than 1K).

...Or your Arduino is bad, or maybe you're not really writing a high to pon 12. (If pin 12 is configured as an input with the internal pull-up enabled, that would give you a "weak" high that would be pulled-down with a 1K resistor.)

...Under normal conditions, a 1K resistor can't change an output state.

DVDdoug:
I'm not sure I understand... You write a high to pin 12 with nothing connected and it works - you get 3V.

Then, you connect the 1K resistor and the transistor and pin 12 drops to zero?

In that case, your 1K resistor is shorted (or it's way lower than 1K).

You understand well. My pin 12 is well configured as output. In a multimeter à check the 1k resistor.
My resistor should ne upper ?

Please post your code.

Symptoms perfectly match a pin that's set to INPUT, pull-up enabled.

Your diagram shows both emitter and collector of the pn2222 connected to grounds.

Hi,
You are trying to low side switch an active component.
You should be HIGH SIDE switching.

Your config, disconnects gnd from the player, so any other player is still at Vcc, other terminals of the player will now draw gnd current through the Tx and Rx pins, so it never completely turns off.

PLEASE draw a circuit diagram, not a fritzy picture.
What is "P", what are its lead outs.

You need to do something like this, switch the high side, so when turned off the player is at gnd.


To turn the player ON, pin12 LOW.
To turn the player OFF, pin12 HIGH.

Tom... :slight_smile:
PS,This will only work if the Arduino supply and the player supply are the same value.

TomGeorge:
You are trying to low side switch an active component.
You should be HIGH SIDE switching.

Can't do that.
TX, RX is TTL logic (normally HIGH).
Switching VCC high-side would most likely phantom-power the player through the serial pins.

Don't know this module, but the datasheet mentions a sleep mode.
Can't you use that, instead of trying to cut the power.

I see this command in the example code.
myDFPlayer.outputDevice(DFPLAYER_DEVICE_SLEEP);
Leo..

I use a transistor PN2222

Which is an NPN transistor but your diagram shows a P on that component which means a PNP transistor. If you use Tom’s circuit you must make pin 11 into an input when you switch off the player to prevent parasitic powering of your module.