Skip to main content

Reply to "MP3 Sound for Crossing Gate"

ken's trains posted:
... I measured the voltage drop across the player when powered and it's only 3.8V. I checked the spec.s on the 3904 and it says it can sink 170ma max. With 5VDC direct to the player it works fine. I don't understand what is going on. I know there is a voltage drop across the transistor, but it I measured it and it's very low (maybe 100mv).

Just to clarify.  If starting from 5V and there's 100mV drop across the transistor how can there only be 3.8V across the player?  I'd think there'd be 4.9V?

Anyway, I suspect the noise is because you're switching the DC- or ground of the MP3 player (rather than the DC+) side.  From the amplifier's perspective, it interprets the incoming signal referenced to its DC-.  Any difference between the DC- of the MP3 player and the amplifier will be interpreted as audio.  Yes, you are in the saturation region but saturation is not a binary on/off condition.  Consider that if you're drawing 20 mA, that 100mV drop means the transistor effectively looks like a 5 ohm resistor (R = V / I = 0.1 / 0.02) which is horrible when compared to a 5 cent electro-mechanical switch.  OK, it's an apples-orange comparison but the point is any variation in current in the MP3 player will shift the DC- voltage via this 5 ohm resistor.

So I suppose you could lower the 1K but I don't think you'll get much bang for the buck since you're already in saturation while you can drive it harder into saturation at 100mV I'm not sure there's much more to gain.  You could use a better transistor such as a 10 cent switching N-channel FET which would have an effective "on" resistance of under 0.1 Ohms...but I don't think you have these just lying around.

But my opinion is to try switching the DC+ to the MP3 player.  For example, do you have a PNP 2N3906 lying around (the complementary part to the NPN 2N3904).  It would be the same configuration as the NPN circuit except switching DC+ when the Arduino pin is "low". 

Now as to why the Arduino output pin does nothing when driving the MP3 directly.   Seems I had a recent discussion with someone who was messing with converting between 3V and 5V signals in an Arduino environment.  Just want to confirm you have "genuine" 5V Arduino outputs.  Anyway, I don't know exactly which module you have but usually best to go the source datasheet such as the ATMEGA32 microcontroller chip which would show an output capability (with 5V chip supply):

atmega32a 5v source

So this suggests an output of about 4.5V when loaded by 20mA as you measured.   But if you removed the battery and only have a 1uF capacitor on the MP3 player, the ability to handle current peaks is restricted.  That is, while 20mA is the average current, I can easily see current peaks of maybe double that when, for example, the MP3 module initially starts up or when it goes to the SD card to fetch the next block of MP3 data (or whatever).  So a surge current or startup current of, say, 40mA would drop the Arduino output voltage to just under 4V which might starve the MP3 player from doing anything.  Not sure what's happening but that's one explanation.  You could try increasing the 1uF capacitor to, say, 100uF or whatever value you have lying around.  This might even help with the 2N3904 low-side switch problem (noise from a shifty ground).

As to the pop.  I think you were messing with increasing the capacitor on the amplifier.  But if the amplifier is continuously powered, changing that capacitor will not help when you turn power on/off to the MP3 player.  The pop is coming from the jolt in voltage from the player.  If you powered the two simultaneously, then the pop from the MP3 player would be masked by the amplifier which delays its amplification proportional to the capacitor.  I apologize if I misled you on the effect of increasing that capacitor if you are separately powering the MP3 player and the amplifier.

Actually, as I write the above, I wonder if you could solve two problems by simultaneously powering the player and the amplifier.  I realize you'd need a beefier transistor but any DC- noise would be common between the two devices and ought to be rejected.  And in this case, the startup pop rejection of the amplifier would mask any startup pop from the MP3 player.  I realize you probably didn't go this route if you only have a low-current 2N3904 NPN in your stash.  If this was why you only switched power to the ~20 mA player and don't have a 500mA or 1A transistor, I can try this for you.  Let me know.

 

Attachments

Images (1)
  • atmega32a 5v source

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
×