The MAX98357A is a tiny mono Class-D amplifier that takes digital I2S audio straight from a microcontroller and drives a speaker directly. You don't need a DAC, an analog input, or even an MCLK pin. It just needs three wires of I2S, power, ground, and a speaker. These are my notes on it, written so you can wire one up without looking at it, because I can't.

I'm using the Adafruit board (product 3006), but most clones use the same 7-pin layout.

Buying one⌗

Most MAX98357A boards ship with the header pins loose in the bag, which means soldering before it'll go anywhere near a breadboard. Amazon listings that say "comes with headers" usually mean exactly that: they come with them, not attached to anything. On some boards the speaker screw terminal is loose too. Look for "pre-soldered" or "soldered" in the listing.

If you'd rather skip the soldering iron, there are boards with the headers already on, like this MAX98357A breakout with pre-soldered headers. The Adafruit version ($5.95) only half counts: the speaker terminal block comes soldered on, but the header is loose.

Pin order⌗

Hold the board chips up (pins down, if the headers were soldered the usual way), with the header pins closest to you and the speaker screw terminal away from you. Reading left to right:

#PinWhat it doesTypical connection
1LRCI2S left/right (word select) clockMCU I2S WS/LRCLK pin
2BCLKI2S bit clockMCU I2S BCLK pin
3DINI2S audio data inMCU I2S data-out pin
4GAINGain select; floating = 9 dBLeave unconnected, or see Gain below
5SDShutdown and channel selectLeave unconnected for stereo-average at 5 V
6GNDGroundCommon ground with MCU and power
7VinPower, 2.5–5.5 V5 V rail preferred

How I remember it: the three I2S signals are on the left, power is on the far right, and ground is right next to it. The speaker goes to the screw terminal on the far edge, + and −.

Power⌗

Vin takes 2.5–5.5 V. Run it from 5 V even if your logic is 3.3 V, since the I2S pins are happy with 3.3–5 V logic. At 5 V, budget about 650 mA; Adafruit recommends a supply rated for 800 mA or more.

Speaker⌗

Use a moving-coil speaker of 4 Ω or more. Max output at 10% THD:

SpeakerAt 5 VAt 3.3 V
4 Ω3 W1.3 W
8 Ω1.8 W0.8 W

Gain⌗

Set by what you hook the GAIN pin to. It may need a power cycle to take effect.

GAIN connectionGain
100 kΩ to GND15 dB
Direct to GND12 dB
Unconnected (default)9 dB
Direct to Vin6 dB
100 kΩ to Vin3 dB

Shutdown and channel select⌗

The voltage on SD picks the mode:

SD voltageResult
Under 0.16 VShutdown (mute)
0.16–0.77 V(Left + Right) / 2
0.77–1.4 VRight channel
Over 1.4 VLeft channel

The board has a 1 MΩ pull-up from SD to Vin fighting an internal 100 kΩ pull-down, which lands you in stereo-average at 5 V. Pulling SD to GND from a GPIO is an easy software mute.

Gotchas⌗

  • The speaker outputs are bridge-tied. Never connect either speaker terminal to ground, and don't feed this into another amp. It drives a speaker directly.
  • It's I2S, not I2C. Different protocol, one letter apart, and search engines will cheerfully hand you the wrong one.
  • Clone boards usually match this pin order, but check the silkscreen or a meter before you power up.

Sources⌗