Go Down

Topic: Speaker and headphone question (Read 2102 times) previous topic - next topic

arduinokov

Feb 04, 2013, 12:39 am Last Edit: Feb 04, 2013, 12:45 am by arduinokov Reason: 1
I am a bit of a noob, so I have a very basic question  :smiley-red:

I am putting together an Arduino project that is using a small 0.4 amp 8 oHm speaker and a Mono Audio Amp Breakout - TPA2005D1 board from Sparkfun https://www.sparkfun.com/products/11044. I have a 10k potentiometer on the Amp board to adjust the volume. It is working very well. What I was wondering is, is it possible to add a headphone jack for the sound that when the headphones are plugged in, redirects the sound from the speaker's pin to the headphone jack automatically?

Thanks  :)

marco_c

#1
Feb 04, 2013, 01:44 am Last Edit: Feb 04, 2013, 02:48 am by marco_c Reason: 1
You need to get a headphone jack that switches when the plug is inserted. These are readily available. Internal contacts allow the circuit to go to the speaker when there is no plug; when the plug is inserted the speakers are disconnected and the headphones connected.
Arduino libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com

arduinokov

Thanks for your reply. I didn't realize it was so easy. Is that something that is available from Digikey or similar? I've searched but I'm not sure what terms to use.

:smiley-red:

retrolefty

One like this should work assuming we are talking mono speaker, mono headphone.

http://www.taydaelectronics.com/hardware/3-5mm-plugs-jacks/3-5mm-mono-enclosed-socket.html

http://www.taydaelectronics.com/hugo/A-865.jpg

Lefty

arduinokov

Hi,

Yes, mono. Thanks so much for the help :D

arduinokov

Hi,

Could someone point me to a simple circuit for how to use the closed circuit 3.5mm jack to interrupt a speaker?  :smiley-red:

Thanks

Grumpy_Mike

Think about it.

There is a ground on the socket so that goes to one side of the speaker.
There are two other connections on the socket. With no jack in they are shorted together with the jack in one connects to the jack and the other is disconnected from the jack. It is this connection that goes to your speaker, the other one goes to your source.
If you don't know which connector is which then get a meter and find out.

arduinokov

Thanks so much for the help, you explained it extremely well. I'll give it a try.

XD

arduinokov

Thanks for the help, it it working very well testing with just a speaker and the jack. IF you would have time for one more question, I would appreciate it.

For the actual project I am working on, I am using a breakout board from Sparkfun to amplify my speaker https://www.sparkfun.com/products/11044. It's a great little board and it is working wonderfully. I am using a little 0.4W 8oHm speaker and the breakout board for amplification as I have a very confined space to fit my project into.

Would it be possible to introduce the headphone jack into the circuit before the amplification board? Obliviously, I don't want to amplify the headphones, just the speaker.

Your help is very much appreciated.

:)

Grumpy_Mike

Not rearly the arduino does not have enough drive to power headphones. These tend to need a seriese resistor to protect the arduino and that might mess up the input to the amplifier.

arduinokov

OK, thanks very much for the help :)

arduinokov

I was thinking that a switch and a bit of code might work. I could use another pin for the headphone sound and use a switch to choose which pin I use for audio. In "speaker mode", it would go through the amplifier, in "headphone mode", I would use go through a 10k resistor to a headphone jack.

Grumpy_Mike

Quote
I would use go through a 10k resistor to a headphone jack.

If you want to drive an earphone direct from an arduino pin then you only need a 120R seriese resistor to limit the current to a safe level.


Go Up