Adafruit MAX98357 I2S Class-D Mono Amp
Created by lady ada
Last updated on 2018-08-22 03:54:10 PM UTC
Guide Contents
Guide Contents
Overview
Pinouts
Speaker Output
Power Pins
I2S Pins
Other Pins
Gain
2
4
7
7
8
9
10
11
SD / MODE
Assembly
Prepare the header strip:
Add the breakout board:
And Solder!
11
13
13
14
15
Raspberry Pi Wiring
Raspberry Pi Setup
Fast Install
Detailed Install
Update /etc/modprobe.d (if it exists)
Disable headphone audio (if it's set)
Create asound.conf file
Add Device Tree Overlay
18
19
19
20
20
22
23
25
Raspberry Pi Test
Speaker Tests!
Simple white noise speaker test
Simple WAV speaker test
Simple MP3 speaker test
27
27
27
27
27
Volume adjustment
Pi I2S Tweaks
Reducing popping
Step 1
27
29
29
29
Add software volume control
Play Audio with PyGame
Install PyGame
Run Demo
CircuitPython Wiring & Test
Wiring
Code Examples
Tone Generation
Wave File
Where's my I2S?
31
34
34
34
37
37
39
39
40
41
I2S Audio FAQ
Hey in Raspbian Pixel desktop, the speaker icon is X'd out!
Even with dmixer enabled, I get a staticy-pop when the Pi first boots or when it first starts playing audio
44
44
44
© Adafruit Industries
https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp
Page 2 of 46
Does this work with my favorite software?
44
Downloads
Schematic
Fabrication Print
45
45
45
© Adafruit Industries
https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp
Page 3 of 46
Overview
If your microcontroller or microcomputer has digital audio capability, this amp is for you! It takes standard I2S digital
audio input and, not only decodes it into analog, but also amplifies it directly into a speaker. Perfect for adding compact
amplified sound, it takes 2 breakouts (I2S DAC + Amp) and combines them into one.
I2S (not to be confused with I2C) in a digital sound protocol that is used on circuit boards to pass audio data around.
Many high end chips and processors manage all of the audio in digital I2S format. Then, to input or output data, three
or four pins are used (data in, data out, bit clock and left-right channel select). Usually, for audio devices, there's a DAC
chip that will take I2S in and convert it to analog that can drive a headphone.
This small mono amplifier is surprisingly powerful - able to deliver 3.2 Watts of power into a 4 ohm impedance speaker
(5V power @ 10% THD). Inside the miniature chip is a class D controller, able to run from 2.7V-5.5VDC. Since the amp is
a class D, it's incredibly efficient - making it perfect for portable and battery-powered projects. It has built in thermal
and over-current protection but we could barely tell it got hot.
The audio input is I2S standard, you can use 3.3V or 5V logic data. The outputs are "Bridge Tied" - that means they
connect directly to the outputs, no connection to ground. The output is a ~300KHz square wave PWM that is then
'averaged out' by the speaker coil - the high frequencies are not heard. All the above means that you can't connect the
output into another amplifier, it should drive the speakers directly.
© Adafruit Industries
https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp
Page 4 of 46
There's a Gain pin that can be manipulated to change the gain. By default, the amp will give you 9dB of gain. By
connecting a pullup or pull down resistor, or wiring directly, the Gain pin can be set up to give 3dB, 6dB, 9dB, 12dB or
15dB.
the ShutDown/Mode pin can be used to put the chip in shutdown or set up which I2S audio channel is piped to the
speaker. By default, the amp will output (L+R)/2 stereo mix into mono out. By adding a resistor, you can change it to be
just left or just right output
Works great with Raspberry Pi, Arduino Zero, and any other microcontroller or microcomputer with I2S audio outputs
Specs:
Output Power: 3.2W at 4Ω, 10% THD, 1.8W at 8Ω, 10% THD, with 5V supply
PSRR: 77 dB typ @ 1KHz
I2S sample rates from 8kHz to 96kHz
No MCLK required
Click + Pop reduction
Five pin-selectable gains: 3dB, 6dB, 9dB, 12dB, 15dB
Excellent click-and-pop suppression
Thermal shutdown protection
© Adafruit Industries
https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp
Page 5 of 46