0

External speaker/mic with Raspberry Pi 3B+
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

External speaker/mic with Raspberry Pi 3B+

by Hiraghm on Tue Jul 23, 2019 8:23 am

Hopefully someone can help me with these questions...
How would one go about connecting an external speaker to a raspberry pi 3b+, while still being able to use the 3.5mm jack for headphones, and possibly even switch between the two programmatically?
(yes, basically like a cell phone, which mutes the speaker when the headphones are plugged in).

Is the pi's phone jack output-only (TS/TRS), or both speaker/microphone (TRRS)? Is it able to detect when the jack is plugged in?

Thanks in advance for any advice anyone can give me on this.

Hiraghm
 
Posts: 20
Joined: Tue Jul 23, 2019 7:59 am

Re: External speaker/mic with Raspberry Pi 3B+

by adafruit_support_mike on Wed Jul 24, 2019 1:23 pm

The RasPi can’t process input from a microphone on its own, so you’ll need some kind of additional hardware. It’s usually easiest to ise an I2S microphone like this:

https://www.adafruit.com/product/3421

The mic does all the work of converting the data from analog to digital, then transmits the result to the RasPi.

There are also I2S speakers, and you can edit the RasPi’s ALSA configuration to select an I2S device or the standard headphone output as the audio output device.

Another option is to run the output from the RasPi’s audio jack through a plug-detecting jack like this one:

https://www.adafruit.com/product/1699

and connect a speaker amplifier to the normally-closed connections.

There’s no way to do software output switching with the hardware connections of the audio jack, and I don’t know of any way to do plug detection with the RasPi’s existing audio jack.

adafruit_support_mike
 
Posts: 59205
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.