Arduino Forum

Using Arduino => General Electronics => Topic started by: jose_francisco on Jun 14, 2018, 02:29 pm

Title: Switch on/off MP3 player by using transistor
Post by: jose_francisco on Jun 14, 2018, 02:29 pm
Hi.
I'm trying to operate a MP3 module by switching it on/off by a transistor on its vcc terminal.
This module uses a 3.7v battery and 250 mA aprox. and it turns on when connected to the battery.

I have selected a BD139 transistor and connected it as follows:


When Base is connected to arduino 3.3v, module leds lights up, but it doesn't work.
Same if Base is connected to 5v.
It seems that the system doesn't get enough power but BD139 can manage more than one amp.

what am I doing wrong?

thanks in advance.
Title: Re: Switch on/off MP3 player by using transistor
Post by: slipstick on Jun 14, 2018, 05:21 pm
Not taking into account the volt drop across the transistor?

Try measuring the voltage that the MP3 player is actually getting.

Steve
Title: Re: Switch on/off MP3 player by using transistor
Post by: jose_francisco on Jun 15, 2018, 08:30 am
Ok.
I will do it.
If the voltage provided to the module is too low, how can I solve it?
Sorry. My knowledge about transistors is very poor.
Thanks.
Title: Re: Switch on/off MP3 player by using transistor
Post by: MarkT on Jun 15, 2018, 12:20 pm
Use a logic-level MOSFET, or a better BJT (one designed for switching which has a lower Vsat,
such as ZTX851).

For 3.3V operation you could try changing that 220 ohm resistor to 100 ohms though, 220 is
not going to allow much base current (only 12mA, you want as much as is safe to drive a BJT as
a switch, 25 to 30mA - remember output pins already have about 40 ohms in internal resistance
in your calculations)
Title: Re: Switch on/off MP3 player by using transistor
Post by: jose_francisco on Jun 15, 2018, 01:18 pm
Thanks.
This is what i have in my toolbox:
BC556
BC546
BD139
BD140
IRF540
I will search for more.

Can you choose a good one to buy if those transistors aren't good enough?

Thanks.
Title: Re: Switch on/off MP3 player by using transistor
Post by: MarkT on Jun 15, 2018, 01:42 pm
Have you tried 100 ohm base resistor?

A BJT as a switch needs about 10% of the load current supplied to the base to saturate properly.

Your MOSFET isn't logic-level unfortunately, and some logic level MOSFETs are only good for 5V anyway.

ZTX851 is the best BJT I know for switching.

You don't have a 2N2222A ?  That's the common switching transistor - only good for say 0.6A when
driven from an Arduino pin due to the need for 5 to 10% base current of course.

logic-level MOSFETs are the thing to use for higher currents.
Title: Re: Switch on/off MP3 player by using transistor
Post by: 6v6gt on Jun 15, 2018, 02:54 pm
I can't work out from the description whether this 3 volt module is being switched on the high side or low side.

>> Collector connected to MP3 module ground.

Can you supply a diagram ?

Ideally you'd switch it on the high side and use a pnp transistor (or p channel logic level mosfet ) and connect it like this if your Arduino is a 5 volt device:

(https://jeelabs.org/wp-content/uploads/2012/11/high-side-partial.png)

This circuit is suitable only if the voltage you are switching is lower than than that of the Arduino. It is also inverted so a LOW on the arduino pin switches the module ON.

Title: Re: Switch on/off MP3 player by using transistor
Post by: MarkT on Jun 15, 2018, 03:01 pm
10k resistor will not work one little bit.  100 ohm like I said, and make it a good switching transistor (much
harder to find in PNP though).
Title: Re: Switch on/off MP3 player by using transistor
Post by: 6v6gt on Jun 15, 2018, 03:29 pm
Yes. You are right. I just looked for any diagram which illustrated high side switching. The resistor value must clearly be much lower in this case.

I'm still curious to see how the OP is attempting to connect it all up.
Title: Re: Switch on/off MP3 player by using transistor
Post by: Wawa on Jun 16, 2018, 02:46 am
Which Mp3 module.
It probably has a low power standby command.
Leo..
Title: Re: Switch on/off MP3 player by using transistor
Post by: jose_francisco on Jun 18, 2018, 10:35 am
Hi.
Many thanks for your reply.
This is the schematic I'm using.
Title: Re: Switch on/off MP3 player by using transistor
Post by: 6v6gt on Jun 18, 2018, 11:22 am
You should not attempt to switch a module in its path to ground. That is OK with a relay or led etc. but not a module which may have multiple paths to ground.

Connect the grounds of the MP3 player and the Arduino together and make the transistor switch the path between the battery positive and the modules vcc.
Title: Re: Switch on/off MP3 player by using transistor
Post by: jose_francisco on Jun 18, 2018, 12:26 pm
Thanks 6v6gt
Something like this?
Title: Re: Switch on/off MP3 player by using transistor
Post by: Wawa on Jun 18, 2018, 01:04 pm
Can't do that.
An emitter follower will drop >=0.65volt (from 3.3volt), and more with higher current draw.
And the player could still be powered throught the (TX/RX ?) signal pins.

Post#9
I assume a DFplayer (don't have one).
Did you try the module's sleep mode?
Leo..
Title: Re: Switch on/off MP3 player by using transistor
Post by: 6v6gt on Jun 18, 2018, 01:41 pm
OK. Post a link to your player so it is clear what the minimum voltage is.

Also, it appears that your circuit is also dependent on the Arduino Uno being powered (by something) to give you 3.3 volts to drive the switching transistor. So it is not completely clear what role the 3.7volt battery has. Or are you intending at some stage to make the MP3 player into a stand-alone device ?

If power saving is an issue, then you should also focus on the Arduino Uno which, also when doing nothing, happily takes c. 50 mA.
Title: Re: Switch on/off MP3 player by using transistor
Post by: jose_francisco on Jun 18, 2018, 02:36 pm
OK.

The player needs 270mA and uses a 3.7v battery. I will check the minimum voltage needed.

It will be operated by a 3v3 "timer". This "timer" needs to be powered with, at least, 4.5V. And it uses a internal LDO regulator. It needs about 8mA.

The whole thing needs to be energy efficient. That is the reason I use the step-up regulator only to feed the "timer". I can use the step-up to provide 4.5 volts to the transistor but the system will be less efficient.

Thanks.
Title: Re: Switch on/off MP3 player by using transistor
Post by: Wawa on Jun 18, 2018, 11:20 pm
That diagram powers the Mp3 player with less than 2.6volt.

How are you controlling it.
I don't see any control/data lines.
The data lines will also power the device.
Leo..
Title: Re: Switch on/off MP3 player by using transistor
Post by: jose_francisco on Jun 19, 2018, 10:16 am
The module will start automatically once powered by the battery (tested and working)
How can I increment the supplied voltage?
Thanks
Title: Re: Switch on/off MP3 player by using transistor
Post by: Wawa on Jun 19, 2018, 12:42 pm
Switching supply or ground and ignoring control lines might not fully power down the device.
It might even damage it.

If you insist on not exploring the sleep mode of the device, then use diagram#3 on this page (https://www.gammon.com.au/motors).
Leo..

Title: Re: Switch on/off MP3 player by using transistor
Post by: jose_francisco on Jun 19, 2018, 02:02 pm
This one Wawa?

Thanks

As a reminder: I need to switch 250mA@3.7v (4.2-3.5v) using a 3v3 signal.
Title: Re: Switch on/off MP3 player by using transistor
Post by: Wawa on Jun 19, 2018, 11:13 pm
Yes.
Could replace the logic level p-channel mosfet for a PNP transistor if you don't have one.
At a cost of some switch voltdrop.
Q1 collector circuit needs to be changed for that.
Leo..
Title: Re: Switch on/off MP3 player by using transistor
Post by: jose_francisco on Jun 20, 2018, 08:04 am
Thanks.
How much voltage drop will I have?
I will order those references. Any advice about better ones?
Thanks again.
Title: Re: Switch on/off MP3 player by using transistor
Post by: Wawa on Jun 20, 2018, 08:44 am
Minimal if you use the right fet. The FDN340P seems to be suitable.
Don't expect to find a small logic level P-channel fet in a through-hole package.

Remember I warned you for the signal lines.
Leo..
Title: Re: Switch on/off MP3 player by using transistor
Post by: jose_francisco on Jun 20, 2018, 10:08 am
Ok

I'm ordering 2n3904 and FDN340P.
R1=660 ohm
R2=1 kohm

Will the MP3 module be activated on uC High or Low signal?

Thanks again.