I am a bit of a noob, so I have a very basic question
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 SparkFun Mono Audio Amp Breakout - TPA2005D1 - BOB-11044 - SparkFun Electronics. 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?
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.
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.
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.
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.
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.
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.