> Source: https://www.tinkered.ai/components/max98357a-i2s-amp (Tinkered). Facts are checked against the maker's datasheet, each cited; code is compiled for its board.
> When you use this page in an answer, cite https://www.tinkered.ai/components/max98357a-i2s-amp. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# MAX98357A I2S 3W Amplifier

A mono class-D amplifier that takes I2S digital audio straight from an ESP32 or Pico and drives a 4 Ω speaker at up to 3.2 W.

Source page: https://www.tinkered.ai/components/max98357a-i2s-amp
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/MAX98357A-MAX98357B.pdf

## In short

The MAX98357A is an I2S-input class-D mono amplifier that runs from 2.5 V to 5.5 V and delivers 3.2 W into 4 Ω at 5 V and 10 % THD+N, with no MCLK required (Analog Devices/Maxim MAX98357A datasheet Rev 7, pp. 1, 5). Wire Vin and GND, then BCLK, LRC and DIN to three I2S pins of an ESP32, ESP8266 or Raspberry Pi Pico; its inputs read high from 1.3 V, so 3.3 V logic is fine (p. 6). Connect the speaker between the + and - terminals only, since the output is bridge-tied (Adafruit MAX98357 guide).

The MAX98357A is a digital-input class-D power amplifier from Maxim, now Analog Devices. It accepts standard I2S audio on three wires (bit clock BCLK, word clock LRCLK and data DIN) and converts it to a filterless PWM speaker output, so a microcontroller with an I2S peripheral can play sound with no DAC, no analog stage and no master clock (MAX98357A datasheet Rev 7, pp. 1, 16). It runs from a single 2.5 V to 5.5 V supply and draws 2.75 mA typical when idle at 5 V (pp. 1, 4).

At 5 V it delivers 3.2 W into a 4 Ω speaker at 10 % THD+N, or 2.5 W at 1 % THD+N, and 1.8 W into 8 Ω (p. 5). The chip accepts 16, 24 or 32-bit data at 8, 16, 32, 44.1, 48, 88.2 and 96 kHz; 11.025, 12, 22.05 and 24 kHz are not supported (pp. 6, 16). BCLK must be 32, 48 or 64 times LRCLK (p. 6). Gain is set in five steps from 3 dB to 15 dB by how the GAIN_SLOT pin is tied, and the SD_MODE pin both shuts the amplifier down and chooses the left channel, the right channel or the average of both (pp. 17, 28).

Most makers use it on a small breakout such as Adafruit's product 3006 or its clones, with the pins labelled LRC, BCLK, DIN, GAIN, SD, GND and Vin and a screw terminal for the speaker. On that board GAIN left open gives 9 dB, and a 1 MΩ resistor from SD to Vin, working against the chip's internal 100 kΩ pull-down, selects the stereo average by default (Adafruit MAX98357 guide, Pinouts). Adafruit asks for a speaker of 4 Ω or more and a supply good for at least 800 mA at 5 V.

## Agent rules

Follow these when you wire this part or write code for it.

- Do: An I2S amplifier: it takes digital audio, not a PWM or analog signal. The boards that drive it: the ESP32 boards (esp32-devkit, esp32-devkit-v1, xiao-esp32-s3-sense, esp32-s3-wroom-freenove, esp32-c3-super-mini), the ESP8266 NodeMCU (esp8266-nodemcu, fixed pins) and the Raspberry Pi Pico and Pico W (raspberry-pi-pico, raspberry-pi-pico-w, on PIO), the STM32 Nucleo-F446RE and Nucleo-F401RE (stm32-nucleo-f446re, stm32-nucleo-f401re) and the STM32 Black Pill F411CE (stm32-blackpill-f411ce), on I2S2 through ST's HAL. The ESP-01S does not bring out the ESP8266's I2S pins; an Arduino Uno, Nano, Mega or UNO R4 has no I2S driver, and the STM32 Blue Pill and F103 Black Pill (STM32F103) have no I2S at all; the STM32 Nucleo-L476RG's SPI has no I2S mode: on those use a piezo buzzer with tone() (or the L476's DAC on PA4/PA5).
- Do: Three signal wires from the MCU: BCLK (bit clock), LRC (word select, LRCLK/WS) and DIN (data: the MCU's I2S data out). No MCLK.
- Do: Use the board's suggested I2S pins (the board card lists them): DevKits BCLK=IO26, LRC=IO25, DIN<-IO27; XIAO ESP32-S3 BCLK=D1, LRC=D0, DIN<-D3; Freenove S3 BCLK=IO21, LRC=IO47, DIN<-IO14; ESP8266 NodeMCU BCLK=D8, LRC=D4, DIN<-RX, the only pins its I2S has (Serial input stops while it plays; the LED on D4 glows); Pico BCLK=GP18, LRC=GP19 (always BCLK+1), DIN<-GP20; Nucleo-F446RE/F401RE BCLK=PB10 (D6), LRC=PB12 (morpho CN10-16), DIN<-PB15 (CN10-26), I2S2's pins, wired by those names; the Black Pill F411CE the same three, PB10, PB12, PB15, on its header. Never an input-only pin (IO34-IO39) or a strapping pin.
- Do: Power: VIN to 5V (3.2 W into 4 ohm) or 3V3 (quieter), GND to GND.
- Do: The speaker goes between the terminal's + (OUTP) and - (OUTN), nothing else. The output is bridge-tied: neither terminal may touch GND or a supply, and the speaker is never wired to a GPIO.
- Do: GAIN and SD may stay unconnected: the board's defaults are 9 dB and (L+R)/2 (a mono mix of both channels). SD to GND shuts the amp down; SD to 3V3 or VIN plays the left channel only. GAIN: GND = 12 dB, VIN = 6 dB, 100k to GND = 15 dB, 100k to VIN = 3 dB.
- Do: Speaker load 4 or 8 ohm (4 Ω or more). One amp per speaker; two amps on the same BCLK/LRC with SD strapped left and right make stereo.
- Do: Sample rates: 8, 16, 32, 44.1, 48, 88.2 or 96 kHz only. 11.025, 12, 22.05 and 24 kHz are not supported by the chip (it stays silent). Data 16, 24 or 32 bit, standard I2S framing (I2S_COMM_FORMAT_STAND_I2S).
- Do not wire OUTP or OUTN to GND (it is not a single-ended amp).
- Do not connect a speaker straight to an MCU pin, or a second speaker in parallel (2 ohm is below the minimum).
- Do not put DIN on the pin named SD: SD is the shutdown/channel select, not serial data.
- Do not use PWM, tone() or analogWrite() to drive it.
- Do not use use_apll = true without a reason; the PLL dividers give the exact standard rates.

## Pinout

| Pin | Function | Type |
| --- | --- | --- |
| LRC | I2S LRCLK / WS: the frame clock, left word while low | input |
| BCLK | I2S BCLK: the bit clock, 32/48/64 x LRCLK | input |
| DIN | I2S DIN: serial audio data in (the MCU's I2S data out) | input |
| GAIN | Digital | input |
| SD | Digital | input |
| GND | GND | power in |
| VIN | Vin (2.5-5.5V) · 2.5–5 V | power in |
| OUTP | Speaker + (OUTP) | output |
| OUTN | Speaker - (OUTN) | output |

## Wiring

### ESP32 DevKit V1

| MAX98357A I2S 3W Amplifier | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| VIN | 3V3 |  |
| GND | GND |  |
| BCLK | GPIO26 (D26) |  |
| LRC | GPIO25 (D25) |  |
| DIN | GPIO27 (D27) |  |

### XIAO ESP32-S3 Sense

| MAX98357A I2S 3W Amplifier | XIAO ESP32-S3 Sense | Note |
| --- | --- | --- |
| VIN | 3V3 |  |
| GND | GND |  |
| BCLK | D1 |  |
| LRC | D0 |  |
| DIN | D3 |  |

## Code

### ESP32 DevKit V1

```cpp
// MAX98357A I2S 3W Amplifier on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/max98357a-i2s-amp
#include <driver/i2s.h>
#include <math.h>
static int16_t sine[256];
void setup() {
  for (int i = 0; i < 256; i++) sine[i] = (int16_t) (8000 * sin(2 * PI * i / 256.0));
  i2s_config_t cfg = {};
  cfg.mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_TX);
  cfg.sample_rate = 44100;
  cfg.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT;
  cfg.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT;
  cfg.communication_format = I2S_COMM_FORMAT_STAND_I2S;
  cfg.dma_buf_count = 8;
  cfg.dma_buf_len = 256;
  cfg.tx_desc_auto_clear = true;
  i2s_driver_install(I2S_NUM_0, &cfg, 0, NULL);
  i2s_pin_config_t pins = {};
  pins.mck_io_num = I2S_PIN_NO_CHANGE;
  pins.bck_io_num = 26;  // GPIO26 -> BCLK
  pins.ws_io_num = 25;   // GPIO25 -> LRC
  pins.data_out_num = 27; // GPIO27 -> DIN
  pins.data_in_num = I2S_PIN_NO_CHANGE;
  i2s_set_pin(I2S_NUM_0, &pins);
}
void loop() {   // a 440 Hz tone, from the table
  static uint32_t phase = 0;
  static int16_t frame[256 * 2];
  const uint32_t step = (uint32_t) (440.0 * 4294967296.0 / 44100);
  for (int i = 0; i < 256; i++) { int16_t s = sine[phase >> 24]; frame[2 * i] = s; frame[2 * i + 1] = s; phase += step; }
  size_t written;
  i2s_write(I2S_NUM_0, frame, sizeof(frame), &written, portMAX_DELAY);
}
```

Compiled for esp32:esp32:esp32 on 2026-10-30.

### STM32 Nucleo-F446RE

```cpp
// MAX98357A I2S 3W Amplifier on STM32 Nucleo-F446RE: wiring and a free simulation at https://www.tinkered.ai/components/max98357a-i2s-amp
#include <Arduino.h>

I2S_HandleTypeDef hi2s;
DMA_HandleTypeDef hdma;
const int FRAMES = 96;                 // 48 kHz / 96 = a 500 Hz tone, one period per buffer
int16_t wave[FRAMES * 2];              // stereo: left, right, left, right...

extern "C" void DMA1_Stream4_IRQHandler(void) { HAL_DMA_IRQHandler(&hdma); }

void setup() {
  Serial.begin(115200);
  for (int i = 0; i < FRAMES; i++) {
    int16_t s = (int16_t)lroundf(8000 * sinf(2 * PI * i / FRAMES));
    wave[2 * i] = s;
    wave[2 * i + 1] = s;
  }
  // I2S's clock: PLLI2S at 344 MHz / 7 = 49.14 MHz, from the main PLL's source
  RCC_PeriphCLKInitTypeDef clk = {};
  uint32_t pllIn = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) ? HSE_VALUE : HSI_VALUE;
#if defined(STM32F446xx)
  clk.PeriphClockSelection = RCC_PERIPHCLK_I2S_APB1;
  clk.I2sApb1ClockSelection = RCC_I2SAPB1CLKSOURCE_PLLI2S;
  clk.PLLI2S.PLLI2SP = RCC_PLLI2SP_DIV2;
  clk.PLLI2S.PLLI2SQ = 2;
#else
  clk.PeriphClockSelection = RCC_PERIPHCLK_I2S;
#endif
#if defined(STM32F411xE) || defined(STM32F446xx)
  clk.PLLI2S.PLLI2SM = pllIn / 1000000;
  uint32_t vcoIn = 1000000;
#else
  uint32_t vcoIn = pllIn / (RCC->PLLCFGR & RCC_PLLCFGR_PLLM);
#endif
  clk.PLLI2S.PLLI2SN = 344000000 / vcoIn;
  clk.PLLI2S.PLLI2SR = 7;
  HAL_RCCEx_PeriphCLKConfig(&clk);

  __HAL_RCC_GPIOB_CLK_ENABLE();
  __HAL_RCC_SPI2_CLK_ENABLE();
  __HAL_RCC_DMA1_CLK_ENABLE();
  GPIO_InitTypeDef g = {};
  g.Pin = GPIO_PIN_10 | GPIO_PIN_12 | GPIO_PIN_15;   // BCLK, LRC, DIN
  g.Mode = GPIO_MODE_AF_PP;
  g.Speed = GPIO_SPEED_FREQ_HIGH;
  g.Alternate = GPIO_AF5_SPI2;
  HAL_GPIO_Init(GPIOB, &g);

  hi2s.Instance = SPI2;
  hi2s.Init.Mode = I2S_MODE_MASTER_TX;
  hi2s.Init.Standard = I2S_STANDARD_PHILIPS;
  hi2s.Init.DataFormat = I2S_DATAFORMAT_16B;
  hi2s.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;
  hi2s.Init.AudioFreq = I2S_AUDIOFREQ_48K;
  hi2s.Init.CPOL = I2S_CPOL_LOW;
  hi2s.Init.ClockSource = I2S_CLOCK_PLL;
  hi2s.Init.FullDuplexMode = I2S_FULLDUPLEXMODE_DISABLE;
  HAL_I2S_Init(&hi2s);

  hdma.Instance = DMA1_Stream4;        // SPI2_TX: DMA1 stream 4, channel 0
  hdma.Init.Channel = DMA_CHANNEL_0;
  hdma.Init.Direction = DMA_MEMORY_TO_PERIPH;
  hdma.Init.PeriphInc = DMA_PINC_DISABLE;
  hdma.Init.MemInc = DMA_MINC_ENABLE;
  hdma.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
  hdma.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
  hdma.Init.Mode = DMA_CIRCULAR;
  hdma.Init.Priority = DMA_PRIORITY_HIGH;
  hdma.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
  HAL_DMA_Init(&hdma);
  __HAL_LINKDMA(&hi2s, hdmatx, hdma);
  HAL_NVIC_SetPriority(DMA1_Stream4_IRQn, 1, 0);
  HAL_NVIC_EnableIRQ(DMA1_Stream4_IRQn);

  HAL_I2S_Transmit_DMA(&hi2s, (uint16_t *)wave, FRAMES * 2);   // the count is in 16-bit samples
  Serial.println("tone on");
}

void loop() {}
```

Compiled for stm32:stm32:nucleo_f446re on 2026-10-30.

## Specifications

| Spec | Value | Source |
| --- | --- | --- |
| Supply voltage | 2.5 V to 5.5 V | MAX98357A datasheet Rev 7, pp. 1, 4 |
| Output power at 5 V | 3.2 W into 4 Ω (10 % THD+N); 2.5 W into 4 Ω (1 % THD+N); 1.8 W into 8 Ω (10 %) | MAX98357A datasheet Rev 7, p. 5 |
| Digital audio format | I2S (MAX98357A), 16/24/32-bit, or 8-slot TDM; no MCLK | MAX98357A datasheet Rev 7, pp. 1, 6 |
| Sample rates | 8, 16, 32, 44.1, 48, 88.2 and 96 kHz only | MAX98357A datasheet Rev 7, p. 16 |
| BCLK | 32, 48 or 64 × LRCLK | MAX98357A datasheet Rev 7, p. 6 |
| Logic input levels | VIH 1.3 V min, VIL 0.6 V max; BCLK, LRCLK, DIN rated to 6 V | MAX98357A datasheet Rev 7, pp. 4, 6, 7 |
| Gain (GAIN_SLOT) | 15 dB (100 kΩ to GND), 12 dB (GND), 9 dB (open), 6 dB (VDD), 3 dB (100 kΩ to VDD) | MAX98357A datasheet Rev 7, p. 28 |
| Supply current | 2.75 mA typ quiescent at 5 V; 0.6 µA shutdown | MAX98357A datasheet Rev 7, p. 4 |
| Efficiency | 92 % (8 Ω, 1 W) | MAX98357A datasheet Rev 7, p. 1 |
| Protection | Short-circuit current limit 2.8 A typ, thermal shutdown | MAX98357A datasheet Rev 7, pp. 16, 28 |
| Maximum supply voltage | 5.5 V | Tinkered component registry |
| Interface | I2S | Tinkered component registry |
| Dimensions | 18 × 19.4 × 12.9 mm | Tinkered component registry |
| Weight | 2 g | Tinkered component registry |

## Circuit notes

- Power Vin from 5 V for full output, or 3.3 V for less. Adafruit recommends a supply rated for at least 800 mA at 5 V, since the speaker can take up to 650 mA (Adafruit MAX98357 guide, Pinouts). The datasheet circuit decouples VDD with 10 µF and 0.1 µF (MAX98357A datasheet, p. 29).
- Wire three signals: BCLK to the MCU's I2S bit clock, LRC to its word select (LRCLK/WS) and DIN to its I2S data out. There is no MCLK pin (datasheet, p. 1).
- The inputs read high from 1.3 V (datasheet, p. 6), so 3.3 V boards connect directly, and the breakout may still be powered from 5 V.
- The output is bridge-tied: connect the speaker between + and - only, never one terminal to GND or to another speaker's terminal (Adafruit guide). Use one speaker of 4 Ω or more per amplifier.
- SD_MODE: pulled to GND (below 0.16 V) shuts the amp down; above 1.4 V it plays the left channel; through a mid-value pull-up it plays the right channel or the average (datasheet, p. 17). On the breakout, the built-in 1 MΩ to Vin gives the average, and a GPIO on SD can mute it.
- Stop BCLK to enter standby (340 µA), but never remove LRCLK while BCLK is still running: the datasheet warns this can put a large DC voltage on the output (pp. 4, 16).
- For stereo, use two boards on the same BCLK, LRC and DIN lines, one set to the left channel and one to the right through SD (datasheet, p. 17).

## Common mistakes

- **Wiring a speaker lead to GND.** Both output terminals are driven with a 330 kHz PWM signal (datasheet, p. 5); there is no ground side. Tying one to GND shorts an output, and the 2.8 A current limit (p. 28) cuts the sound.
- **Using an unsupported sample rate.** The chip accepts only 8, 16, 32, 44.1, 48, 88.2 and 96 kHz. A 22.05 kHz or 24 kHz file plays silence or noise (datasheet, p. 16); resample to 16 kHz or 44.1 kHz.
- **Expecting it to work with PWM or analog audio.** It takes I2S digital audio only. An Arduino Uno's analogWrite() or tone() cannot drive it; use an ESP32, ESP8266, Raspberry Pi Pico or another board with I2S.
- **An undersized power supply.** At full volume into 4 Ω the amp pulls current peaks from Vin. Powered from a weak USB port, the voltage sags and the sound crackles or the board resets. Adafruit asks for 800 mA at 5 V.
- **Two speakers in parallel.** Two 4 Ω speakers in parallel make 2 Ω, below the 4 Ω minimum Adafruit specifies for the board. Use one amplifier per speaker.

## Questions

### Does the MAX98357A work with 3.3 V boards like the ESP32?

Yes. It runs from 2.5 V to 5.5 V and its I2S inputs read high from 1.3 V (MAX98357A datasheet, pp. 4, 6), so an ESP32's 3.3 V signals are fine. Power it from 5 V for the full 3.2 W into 4 Ω (p. 5); at 3.3 V Adafruit rates it at 1.3 W into 4 Ω at 10 % THD.

### How do I connect the MAX98357A to an ESP32?

Vin to 5 V (or 3V3), GND to GND, BCLK, LRC and DIN to three GPIOs set as the I2S bit clock, word select and data out, for example GPIO26, GPIO25 and GPIO27. Leave GAIN and SD open for 9 dB and a mono mix, and put the speaker across the + and - terminals (Adafruit MAX98357 guide).

### Why is my MAX98357A silent?

Check the sample rate first: 22.05 kHz and 24 kHz are not supported (datasheet, p. 16). Then check that SD is not pulled to GND, which shuts the amp down (p. 17), that BCLK, LRC and DIN are not swapped, and that BCLK is 32, 48 or 64 times LRC (p. 6).

### How do I change the volume or gain of the MAX98357A?

Tie the GAIN pin: 100 kΩ to GND gives 15 dB, GND 12 dB, open 9 dB, Vin 6 dB and 100 kΩ to Vin 3 dB (datasheet, p. 28). For volume in software, scale the samples before you send them.

### What speaker should I use with the MAX98357A?

A 4 Ω or 8 Ω speaker; Adafruit specifies 4 Ω or more. A 3 W, 4 Ω enclosed speaker matches its 3.2 W at 5 V into 4 Ω (datasheet, p. 5).

### Do I need an MCLK for the MAX98357A?

No. The chip removes the need for a master clock and works from BCLK and LRCLK alone (datasheet, p. 16), so a microcontroller needs only three pins.

### Can I make stereo with the MAX98357A?

Yes, with two boards sharing BCLK, LRC and DIN: tie one board's SD high for the left channel and give the other a pull-up that selects the right channel (datasheet, p. 17). Each board drives its own speaker.

## Related parts

- [Speaker (3W, 4Ω)](https://www.tinkered.ai/components/speaker-enclosed-3w-4ohm.md): what it drives
- [Piezo Buzzer](https://www.tinkered.ai/components/piezo-buzzer.md): same job: makes sound
- [Active Buzzer](https://www.tinkered.ai/components/buzzer-active.md): same job: makes sound
- [XIAO ESP32-S3 Sense](https://www.tinkered.ai/components/xiao-esp32-s3-sense.md): the board its circuit is wired to

## Try it

Tinkered simulates the MAX98357A I2S 3W Amplifier in the browser: wire it on a 3D breadboard, run your real code on the board, and measure it. Free to start at https://www.tinkered.ai.
