Page 1

Adafruit STEMMA Speaker
Created by Kattni Rembor
https://learn.adafruit.com/adafruit-stemma-speaker
Last updated on 2021-11-15 07:50:29 PM EST
©Adafruit Industries Page 1 of 11
Page 2

Table of Contents
Overview
Pinouts
• Speaker and Connector
• JST Connector
• Alligator Clips
• Volume
• Amplifier
Usage
• Circuit Playground Express Wiring
• Circuit Playground Express Example Code
• Further Information
Downloads
• Files
• Fab Print
• Schematic
3
5
6
6
7
7
7
8
8
8
9
10
10
10
11
©Adafruit Industries Page 2 of 11
Page 3

Overview
Hey, have you heard the good news? With Adafruit STEMMA boards, you can easily
and safely plug sensors and devices together, like this Adafruit STEMMA Speaker -
Plug and Play Audio Amplifier. Like the name implies, it's got a class D audio amplifier
on board, and our favorite little 1 Watt 8 ohm speaker.
Connecting it up is easy - you only need ground, 3 to 5V power, and audio signal. The
audio signal does not need to be AC coupled, we do that for you, and can range up to
the power pin voltage (3 or 5V peak-to-peak). You can use either the 3-pin JST socket
©Adafruit Industries Page 3 of 11
Page 4

or the alligator/sew-pads for this slim and portable package. The sound quality is
good enough for music, tones, speech, whatever you like and volume can be adjusted
with a small screwdriver.
For use with a CircuitPlayground or micro:bit, this JST to alligator-clip cable(https://
adafru.it/FY7) works best. Red is power, ground is black and signal is white.
For use with a breadboard, try one of the following cables:
©Adafruit Industries Page 4 of 11
Page 5

JST PH 3-Pin to Male Header Cable
1.
- 200mm
JST PH 3-Pin to Female Socket
2.
Cable - 200mm
Pinouts
Let's take a look at what comes on the Adafruit STEMMA Speaker plug and play audio
amplifier!
©Adafruit Industries Page 5 of 11
Page 6

Speaker and Connector
JST Connector
Located in the center of the board is the 1
watt 8 ohm speaker connected to the
board via a Molex PicoBlade connector.
The easiest way to connect the STEMMA
speaker to your project is the 3-pin JST
connector at the base of the board.
There are 3-pin JST to various
connectors available, including to
alligator clip(https://adafru.it/FY7) and
breadboard pin(https://adafru.it/CVg)
options, to make it super easy to connect
it to any kind of project.
White Signal (SIG) This is 0-3V
•
signal input, we decouple this
signal so it can be AC or DC
coupled.
Red Power (+) This is 3-5V DC
•
power
Black Ground (-) Signal/power
•
ground
©Adafruit Industries Page 6 of 11
Page 7

Alligator Clips
Volume
The STEMMA speaker comes with three
alligator clips pads to use with alligator
clips. In the image to the left, they are top
to bottom:
Signal (SIG) This is 0-3V signal
•
input, we decouple this signal so it
can be AC or DC coupled.
Power (+) This is 3-5V DC power
•
Ground (-) Signal/power ground
•
You can change the volume using a small
screwdriver to rotate the volume trim pot.
Amplifier
The board includes a class D amplifier
located above the JST connector.
©Adafruit Industries Page 7 of 11
Page 8

Usage
Using the Adafruit STEMMA speaker is as simple as connecting it to your project.
Existing audio code works the same way but will use the STEMMA speaker instead.
Let's take a look at an example using Circuit Playground Express.
You can use any device that outputs analog 'line level' audio signal, we're testing
with a Circuit Playground but you can use for any general purpose audio output
amplification!
Circuit Playground Express Wiring
First, wire up the STEMMA speaker to a Circuit Playground Express as shown. We
suggest using a 3-pin JST to alligator clip cable(https://adafru.it/FY7) with the 3-pin
JST connector on the STEMMA Speaker.
Plug the 3-pin JST to alligator clip
•
cable into the 3-pin JST connector
on the STEMMA Speaker
Connect the black alligator clip to a
•
GND pad on the CPX
Connect the white alligator clip to
•
the A0 pad
Connect the red alligator clip to the
•
VOUT pad
Circuit Playground Express Example Code
This example uses CircuitPython. If you're not already using CircuitPython, check out t
his quick-start(https://adafru.it/AFI) to get it going.
The first example plays a different tone for each button on the Circuit Playground
Express.
Copy the following code to a code.py file on your CIRCUITPY drive:
from adafruit_circuitplayground.express import cpx
while True:
©Adafruit Industries Page 8 of 11
Page 9

if cpx.button_a:
cpx.play_tone(260, 1)
if cpx.button_b:
cpx.play_tone(292, 1)
Press each button to play a different tone through your STEMMA speaker.
The second example plays a different wav file for each button on the Circuit
Playground Express.
Click the buttons below to download the two wav files and copy them to your CIRCUI
TPY drive.
Download dip.wav
https://adafru.it/FYJ
Download rise.wav
https://adafru.it/FYK
Then, copy the following code to a code.py file on your CIRCUITPY drive:
from adafruit_circuitplayground.express import cpx
while True:
if cpx.button_a:
cpx.play_file("rise.wav")
if cpx.button_b:
cpx.play_file("dip.wav")
Press each button on the Circuit Playground Express to play each file through your
STEMMA Speaker.
That's all there is to using your STEMMA Speaker with Circuit Playground Express and
CircuitPython!
Further Information
For more information on using the STEMMA Speaker with MakeCode, check out the M
usic and Sound in MakeCode page of the Make It Sound guide(https://adafru.it/FYL).
For more information on using the STEMMA Speaker with CircuitPython, check out
the Music and Sound in CircuitPython page of the Make It Sound guide(https://
adafru.it/EKK).
©Adafruit Industries Page 9 of 11
Page 10

Downloads
Files
PAM8302A class D amplifier datasheet(https://adafru.it/FYC)
•
EagleCAD files on GitHub(https://adafru.it/FYD)
•
Fritzing object in the Adafruit Fritzing Library(https://adafru.it/FYB)
•
Fab Print
©Adafruit Industries Page 10 of 11
Page 11

Schematic
©Adafruit Industries Page 11 of 11