Component guide · Intermediate · 3 min read
MAX98357 I2S Amplifier

Pinout, Wiring and ESP32 Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The MAX98357 is a mono class D amplifier with an I2S digital input. It takes audio straight from an ESP32's I2S pins and drives a 4 to 8 ohm speaker at up to about 3 W from 5 V, with no DAC or analog stage needed. The GAIN pin sets 3 to 15 dB and the SD pin selects left, right or mixed channels, or shuts it down.
Key specs at a glance
- Type
- Mono class D amplifier with I2S input
- Output power
- About 3.2 W into 4 ohm at 5 V (1.8 W into 8 ohm)
- Supply
- 2.5 to 5.5 V
- Sample rate
- 8 to 96 kHz, 16 or 32-bit
- Gain
- 3, 6, 9, 12 or 15 dB (default 9 dB)
- Speaker
- 4 to 8 ohm
What the MAX98357 amplifier is
Because the input is digital, the sound stays clean: there is no hiss from a noisy analog wire. Feed it from an ESP32 to play tones, WAV and MP3 files from an SD card, internet radio, or text-to-speech.
The output is a bridge-tied load: both speaker wires are driven, so neither speaker terminal is ground. Connect the speaker only between the + and - terminals.
MAX98357 amplifier pinout
The pins on the MAX98357 amplifier and what each one does.
| Pin | Function |
|---|---|
| VIN | Supply, 2.5 to 5.5 V (5 V for full power) |
| GND | Ground |
| BCLK | I2S bit clock |
| LRC | I2S word select (left/right clock) |
| DIN | I2S data in |
| GAIN | Gain select: open = 9 dB, GND = 12 dB, VIN = 6 dB, via 100k = 3 or 15 dB |
| SD | Shutdown and channel: GND = off, open = (L+R)/2 on most boards |
| + / - | Speaker output (do not ground either) |
- VIN
- Supply, 2.5 to 5.5 V (5 V for full power)
- GND
- Ground
- BCLK
- I2S bit clock
- LRC
- I2S word select (left/right clock)
- DIN
- I2S data in
- GAIN
- Gain select: open = 9 dB, GND = 12 dB, VIN = 6 dB, via 100k = 3 or 15 dB
- SD
- Shutdown and channel: GND = off, open = (L+R)/2 on most boards
- + / -
- Speaker output (do not ground either)
Wiring the MAX98357 amplifier
Power it from 5 V for full volume; the logic pins still accept 3.3 V signals. Add a 100 µF capacitor across VIN and GND if the ESP32 resets on loud sounds.
| MAX98357 amplifier pin | Arduino Uno | ESP32 |
|---|---|---|
| VIN | Not supported (no I2S on the Uno) | 5V (VIN) |
| GND | - | GND |
| BCLK | - | GPIO 26 |
| LRC | - | GPIO 25 |
| DIN | - | GPIO 22 |
| + / - | - | Speaker 4-8 ohm |
- VIN
- Arduino Uno:
- Not supported (no I2S on the Uno)
- ESP32:
- 5V (VIN)
- GND
- Arduino Uno:
- -
- ESP32:
- GND
- BCLK
- Arduino Uno:
- -
- ESP32:
- GPIO 26
- LRC
- Arduino Uno:
- -
- ESP32:
- GPIO 25
- DIN
- Arduino Uno:
- -
- ESP32:
- GPIO 22
- + / -
- Arduino Uno:
- -
- ESP32:
- Speaker 4-8 ohm
Example code
For MP3, WAV and web radio use the ESP32-audioI2S library with the same three pins. On core 2.x use the driver/i2s.h API instead.
#include <ESP_I2S.h>
I2SClass i2s;
const int RATE = 16000;
void setup() {
i2s.setPins(26, 25, 22); // BCLK, LRC (WS), DIN
i2s.begin(I2S_MODE_STD, RATE, I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_MONO);
}
void loop() {
static float phase = 0;
int16_t buf[256];
for (int i = 0; i < 256; i++) {
buf[i] = 6000 * sin(phase); // keep the volume moderate
phase += 2 * PI * 440 / RATE;
if (phase > 2 * PI) phase -= 2 * PI;
}
i2s.write((uint8_t*)buf, sizeof(buf));
}Setup and tuning
speaker + to the + terminal and - to -, never to GND.
5 V from a supply that can give at least 1 A for full volume.
start at the default 9 dB; lower it if the sound distorts.
keep I2S wires short and add a capacitor across the supply.
What you need
Shop this list7 of 7 found in our store · ₹809
MAX98357 I2S 3W Class D Amplifier Module: the part this guide coversMAX98357 I2S 3W Class D Amplifier Module₹129
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
Mini speaker 8 ohm: to hear the soundMini Speaker 8Ω₹42
INMP441 I2S microphone: to record and play backINMP441 MEMS High Precision Omnidirectional Microphone Module I2S₹139Closest match, check the specs
MicroSD card module (SPI): to save recordings or logsMicroSD Card Module (SPI)₹45
Electrolytic capacitor: 100 µF across VIN and GNDElectrolytic Capacitor₹16
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- PAM8403 amplifier: analog stereo input, for boards without I2S.
- DFPlayer Mini: plays MP3 files from its own SD card with simple serial commands.
- Audio amplifiers: how class D and other amplifier types compare.
Common mistakes to avoid
- Connecting one speaker wire to GND, which can damage the amplifier.
- Expecting it to work with an Arduino Uno, which has no I2S.
- Powering it from the ESP32's 3.3 V pin and getting low volume or resets.
- Pin numbers in code not matching the wiring.
Frequently asked questions
Does the MAX98357 work with Arduino Uno?
No, it needs an I2S output such as on an ESP32, ESP32-S3 or Raspberry Pi Pico.
How loud is it?
About 3 W into a 4 ohm speaker at 5 V, enough for a small room.
Can I make stereo?
Use two boards: set one SD pin for left and the other for right.
Why is there a hiss or pop?
Usually power noise or long I2S wires. Shorten wires and add a capacitor.
What speaker should I use?
A 4 or 8 ohm speaker rated at least 3 W.
Parts for this guide
Projects that use it
Put this into practice: 56 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- MAX98357A/B PCM input class D amplifier datasheet (Maxim Integrated)
- Adafruit MAX98357 I2S class-D mono amp guide
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.
