natetallent
Posts: 4
Joined: Wed Jun 06, 2018 8:44 pm

rpi3 gpio speakers

Wed Jun 06, 2018 9:15 pm

i want sound but every other post basically refers to a separate unit for a speaker or solutions for nothing but buzzers/beepers. i dont care about sound quality necessarily and i just want out of the way crappy speakers for gaming videos and stuff like that. i found this on amazon and i was wondering if there was a way to some how connect them to the gpio and
https://www.amazon.com/uxcell-Metal-Int ... 5T373W3X2
if these arent a good option can someone please give me a suggestion or two

i have a rpi3b in a smart pi touch case and the official rpi 7 inch touchscreen with a usb battery pack that supplies enough power (5v 3a)

klricks
Posts: 6501
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: rpi3 gpio speakers

Thu Jun 07, 2018 12:30 am

natetallent wrote:
Wed Jun 06, 2018 9:15 pm
i want sound but every other post basically refers to a separate unit for a speaker or solutions for nothing but buzzers/beepers. i dont care about sound quality necessarily and i just want out of the way crappy speakers for gaming videos and stuff like that. i found this on amazon and i was wondering if there was a way to some how connect them to the gpio and
https://www.amazon.com/uxcell-Metal-Int ... 5T373W3X2
if these arent a good option can someone please give me a suggestion or two

i have a rpi3b in a smart pi touch case and the official rpi 7 inch touchscreen with a usb battery pack that supplies enough power (5v 3a)
The speakers cannot be connected directly to any GPIO. The RPi has audio output available in the 4 pole TRRS jack. You also need an audio amplifier to power the speakers though you can probably hear something in a quiet room without an amp. I would suggest to get a cheap powered computer speakers and be done with it. A 3 pole stereo 3.5mm plug found on most speaker sets can be used in the 4 pole jack on the RPi without any problem. Another option is to get USB powered speakers which draw power for the amp from the USB, but audio is fed by a 3.5mm jack. (Not USB sound card).
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

gkaiseril
Posts: 627
Joined: Mon Aug 08, 2016 9:27 pm
Location: Chicago, IL

Re: rpi3 gpio speakers

Thu Jun 07, 2018 2:36 am

There are add on boards and software that use the GPIO pins to convert the digital signal to mono or stereo.
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.

User avatar
Imperf3kt
Posts: 2548
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: rpi3 gpio speakers

Thu Jun 07, 2018 3:17 am

gkaiseril wrote:
Thu Jun 07, 2018 2:36 am
There are add on boards and software that use the GPIO pins to convert the digital signal to mono or stereo.
For what possible purpose? There is already an audio out jack on a Pi3 of the same quality as those add on boards
55:55:44:44:4C
52:4C:52:42:41

User avatar
rpdom
Posts: 14744
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: rpi3 gpio speakers

Thu Jun 07, 2018 5:30 am

Imperf3kt wrote:
Thu Jun 07, 2018 3:17 am
gkaiseril wrote:
Thu Jun 07, 2018 2:36 am
There are add on boards and software that use the GPIO pins to convert the digital signal to mono or stereo.
For what possible purpose? There is already an audio out jack on a Pi3 of the same quality as those add on boards
I2S audio is much higher quality than that which is available on the jack socket.

LTolledo
Posts: 1649
Joined: Sat Mar 17, 2018 7:29 am

Re: rpi3 gpio speakers

Fri Jun 08, 2018 3:51 am

to be able to use your $9 speakers... first you need a good DIY encolsure...then...

1. get the Pimoroni pHAT Beat, insert to your RPi's GPIO, attach speakers to the pHat Beat, load drivers, done.
2. get USB sound card and insert to USB port, get DIY amp (PAM8403 or better) with enclosures and accessories, get connecting cables and connect, done.

if you're a DIY kind of guy you'll probably go for #2. May cost more ($$$ and time) but fun along the way, I know the feeling, I've been there.

Honestly, just ditch the speakers, and get a USB sound card ($7) and a USB powered speakers ($13) from Amazon and enjoy immediately.

The choice is still yours to make...
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
Imperf3kt
Posts: 2548
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: rpi3 gpio speakers

Fri Jun 08, 2018 5:30 am

rpdom wrote:
Thu Jun 07, 2018 5:30 am
Imperf3kt wrote:
Thu Jun 07, 2018 3:17 am
gkaiseril wrote:
Thu Jun 07, 2018 2:36 am
There are add on boards and software that use the GPIO pins to convert the digital signal to mono or stereo.
For what possible purpose? There is already an audio out jack on a Pi3 of the same quality as those add on boards
I2S audio is much higher quality than that which is available on the jack socket.
My mistake. I thought they were talking about pushing the analogue audio through PWM.
55:55:44:44:4C
52:4C:52:42:41

MarkDH102
Posts: 329
Joined: Fri Feb 13, 2015 3:18 pm

Re: rpi3 gpio speakers

Fri Jun 08, 2018 6:10 am

I use this :

https://shop.pimoroni.com/products/speaker-phat

Not brilliant sound quality, but fairly cheap and a reasonably good volume. Mono though if that's an issue. I use it for speech rather than music.

natetallent
Posts: 4
Joined: Wed Jun 06, 2018 8:44 pm

Re: rpi3 gpio speakers

Sat Jun 09, 2018 12:27 am

MarkDH102 wrote:
Fri Jun 08, 2018 6:10 am
I use this :

https://shop.pimoroni.com/products/speaker-phat

Not brilliant sound quality, but fairly cheap and a reasonably good volume. Mono though if that's an issue. I use it for speech rather than music.
this looks useful but the screen i have takes up two of the gpio pins for power

natetallent
Posts: 4
Joined: Wed Jun 06, 2018 8:44 pm

Re: rpi3 gpio speakers

Sat Jun 09, 2018 12:32 am

klricks wrote:
Thu Jun 07, 2018 12:30 am
natetallent wrote:
Wed Jun 06, 2018 9:15 pm
i want sound but every other post basically refers to a separate unit for a speaker or solutions for nothing but buzzers/beepers. i dont care about sound quality necessarily and i just want out of the way crappy speakers for gaming videos and stuff like that. i found this on amazon and i was wondering if there was a way to some how connect them to the gpio and
https://www.amazon.com/uxcell-Metal-Int ... 5T373W3X2
if these arent a good option can someone please give me a suggestion or two

i have a rpi3b in a smart pi touch case and the official rpi 7 inch touchscreen with a usb battery pack that supplies enough power (5v 3a)
The speakers cannot be connected directly to any GPIO. The RPi has audio output available in the 4 pole TRRS jack. You also need an audio amplifier to power the speakers though you can probably hear something in a quiet room without an amp. I would suggest to get a cheap powered computer speakers and be done with it. A 3 pole stereo 3.5mm plug found on most speaker sets can be used in the 4 pole jack on the RPi without any problem. Another option is to get USB powered speakers which draw power for the amp from the USB, but audio is fed by a 3.5mm jack. (Not USB sound card).
i am trying to make this as compact and portable as possible. could you tell me where that 4 pole thingy is? i would love to try that if it means it small(ish). im sort of a noob to rpi hardware related stuff.

klricks
Posts: 6501
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: rpi3 gpio speakers

Sat Jun 09, 2018 1:46 am

natetallent wrote:
Sat Jun 09, 2018 12:32 am
....

i am trying to make this as compact and portable as possible. could you tell me where that 4 pole thingy is? i would love to try that if it means it small(ish). im sort of a noob to rpi hardware related stuff.
It is near the HDMI port and looks like a 'headphone' jack.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

hippy
Posts: 5595
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: rpi3 gpio speakers

Sat Jun 09, 2018 10:57 am

It should be possible to connect a piezo or speaker with a simple single transistor driver direct to a digital GPIO line and generate sound, audio and speech through that. It is just a case of bashing the right pulse train through that.

That's how Windows allowed sound to be produced from a motherboard piezo way back to Windows 3.1 and many microcontroller projects have copied that. It's not going to be great sound but for all it requires it is pretty good and cheap too.

One can also improve on the 'just a piezo' scheme. Roman Black did a fair amount of work on bit-banged audio generation for the PICmicro -

https://www.romanblack.com/BTc_alg.htm

I also like the projects which just pump UART serial straight to a speaker.

It is easy enough to bit-bang tones and tunes out of a Raspberry Pi but I don't know if anyone has created a full bit-banged audio driver or application.

Having the Pi be able to generate audio via HDMI, analogue and digital GPIO lines would be useful to have. Windows 3.1 could do it so I am sure Linux could also.

fruitoftheloom
Posts: 20143
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: rpi3 gpio speakers

Sat Jun 09, 2018 11:03 am

natetallent wrote:
Wed Jun 06, 2018 9:15 pm
i want sound but every other post basically refers to a separate unit for a speaker or solutions for nothing but buzzers/beepers. i dont care about sound quality necessarily and i just want out of the way crappy speakers for gaming videos and stuff like that. i found this on amazon and i was wondering if there was a way to some how connect them to the gpio and
https://www.amazon.com/uxcell-Metal-Int ... 5T373W3X2
if these arent a good option can someone please give me a suggestion or two

i have a rpi3b in a smart pi touch case and the official rpi 7 inch touchscreen with a usb battery pack that supplies enough power (5v 3a)

The RPi Zero has no audio out, but as the GPIO is the same across RPis maybe:

https://learn.adafruit.com/introducing- ... io-outputs
adieu

Asus CS10 Chromebit / HP Envy 4500 Wireless Printer / Raspberry Pi Model 2B v1.1 / RealVNC Software...

pksato
Posts: 295
Joined: Fri Aug 03, 2012 5:25 pm
Location: Brazil

Re: rpi3 gpio speakers

Sat Jun 09, 2018 11:51 am

Hi,
In addition to the speaker you will need a power amplifier, like PAM8403 module (search on you favorite electronic gadget store).
It is a small class D audio amplifier.
And a TRRS plug (old/cheap smartphone earphone/mic cable). Or solder wires direct to pads of A/V jack.

LTolledo
Posts: 1649
Joined: Sat Mar 17, 2018 7:29 am

Re: rpi3 gpio speakers

Sat Jun 09, 2018 12:41 pm

natetallent wrote:
Sat Jun 09, 2018 12:27 am

this looks useful but the screen i have takes up two of the gpio pins for power
Add a GPIO expander shield

https://www.ebay.com/itm/GPIO-Expansion ... 2024221005

to the list....
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “Beginners”