Hardware Matrix

Is MAX98357A I2S 3.2W Class-D Amplifier Compatible with Home Assistant (ESPHome)?

Verdict Badge
VERDICT: [ COMPATIBLE (MANUAL CONFIG REQUIRED) ]
Protocol: I2S Digital / 3.3V to 5V
Bridge Needed: NO

Electrical Specifications

Always confirm pin assignments against the manufacturer datasheet before wiring.

Not yet documented. Electrical specifications for this device have not been confirmed against a manufacturer datasheet, so none are shown here rather than showing estimates. Submit verified specifications if you have the datasheet to hand.

Compatibility Overview

Single-chip I2S digital-input Class-D audio amplifier driving 3.2W mono speakers for smart voice notifications.

Wiring MAX98357A I2S 3.2W Class-D Amplifier to ESP32-S3

Module pin ESP32-S3 Note
Vin 5V USB power is enough for speech. 3.3V works at reduced output.
GND GND
LRC GPIO5 i2s_lrclk_pin — word select.
BCLK GPIO6 i2s_bclk_pin.
DIN GPIO7 i2s_dout_pin — data out of the ESP32, into the amplifier.
GAIN unconnected Open is 9dB. To GND 12dB, to Vin 6dB, 100kΩ to GND 15dB, 100kΩ to Vin 3dB.
SD unconnected Open on the Adafruit-style breakout selects the left+right mono mix. Tied to ground the amplifier shuts down.
Speaker + / − 4–8Ω speaker Up to 3.2W into 4Ω at 5V. A 3W 4Ω speaker is the usual match.

Host pins are the ones the configuration on this page uses. Move a pin here and change it in the YAML — they are documented together so they cannot disagree.

Technical Specification Matrix

Feature / Attribute Specification / Status
Hardware Protocol I2S Digital / 3.3V to 5V
Bridge Required NO
Border Router Needed None
Hardware Capabilities & Peripherals
Media Speaker Output Volume Control Mute Switch

Note: these entities come from the ESPHome configuration you flash — each one needs its matching component in that YAML before it appears.

Pairing Complexity Intermediate
Factory Reset Instruction Hold BOOT button while resetting.

Wire, Flash, Adopt, Check

1

Wire it up

Follow the wiring table above. The ESP32-S3 pins there are the ones the configuration uses, so if you move one, change it in both places.

2

Flash the configuration

Create a new device in the ESPHome dashboard (the Home Assistant add-on) and paste the configuration below into it, or save it as emb_esp32s3_i2s_dac_ha.yaml and run esphome run emb_esp32s3_i2s_dac_ha.yaml. The first flash goes over USB. If it is not detected, hold BOOT button while resetting to put it in download mode. Every update after that is over the air.

3

Adopt it in Home Assistant

Settings → Devices & Services. A node on the same network shows up as a discovered ESPHome device within a minute of joining Wi-Fi; choose Configure and enter the API encryption key from your secrets.yaml. If discovery does not find it, add the ESPHome integration by hand with the node's IP address.

4

Check it works

Home Assistant shows a Speaker media player on the node. Call tts.speak against it: speech within a second or two means the pipeline works. An entity that appears but plays silence is the I2S pins swapped or the SD pin pulled low; no entity at all means the media_player block did not compile — check the framework.

ESPHome Configuration

Starting configuration for MAX98357A I2S 3.2W Class-D Amplifier on ESP32-S3. Untested on hardware — verify wiring and pins against your own board.

# ESPHome configuration for MAX98357A I2S 3.2W Class-D Amplifier
# Host: ESP32-S3. Pin numbers below are host-side defaults — any free
# GPIO will do, and you should change them to match your own wiring.

esphome:
  name: emb_esp32s3_i2s_dac_ha
  friendly_name: "MAX98357A I2S 3.2W Class-D Amplifier"

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf

logger:

api:
  encryption:
    key: !secret api_encryption_key

ota:
  - platform: esphome
    password: !secret ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

# MAX98357A pin names map to I2S signals: LRC = LRCLK, BCLK = BCLK,
# DIN = data in. SD can stay unconnected (defaults to enabled, mono mix);
# the GAIN strap sets the fixed gain in hardware, not in this config.
i2s_audio:
  i2s_lrclk_pin: GPIO5
  i2s_bclk_pin: GPIO6

speaker:
  - platform: i2s_audio
    id: main_speaker
    dac_type: external
    i2s_dout_pin: GPIO7
    channel: mono

# A bare speaker: block has nothing for Home Assistant to show. The speaker
# media_player wraps it as a media_player entity that tts.speak and
# media_player.play_media can target, decoding MP3/WAV/FLAC on the S3.
# Needs the esp-idf framework (set above); PSRAM is strongly recommended.
media_player:
  - platform: speaker
    name: "Speaker"
    announcement_pipeline:
      speaker: main_speaker
      format: WAV
      sample_rate: 48000
      num_channels: 1

Before you flash: the !secret values come from your secrets.yaml, and the GPIO numbers are host-side defaults rather than properties of this part — change them to match how you actually wired it.

What Appears in Home Assistant

Speaker
media_player

From the media_player: speaker block. tts.speak, Assist announcements and media_player.play_media all target it. The bare speaker: block on its own creates no entity.

Known Problems and Fixes

ESP-IDF only

The speaker media player refuses the Arduino framework. The host block in the config already selects esp-idf; keep it that way when adapting the YAML to another board.

PSRAM decides what it can play

Announcements — short WAV or MP3 clips, text-to-speech — work on an S3 with no PSRAM, which is what the config sets up. Streaming music through a media_pipeline is where PSRAM becomes necessary; add it only on a board that has it (the N8R8 devkits do, the N8 does not).

A pop at power-on is normal

A hiss that never stops is usually the SD pin floating on a bare module with long leads. Tie it as the datasheet's thresholds require, or use a breakout that does.

It is a mono amplifier

The MAX98357A drives one speaker. It mixes both I2S channels by default; channel: mono in the config matches that. Two of them, with SD strapped for left and right respectively, make stereo.

Format

Home Assistant transcodes to whatever the announcement pipeline declares. 48kHz mono WAV in the config keeps decoding cheap; MP3 is fine on the S3 too.

🛠️ Hardware Correction & Field Contributions

Report a Pinout Error or Submit Tested Code Snippets

Found a pin mapping quirk or built a custom ESPHome YAML driver for MAX98357A I2S 3.2W Class-D Amplifier? Submit a pull request or report corrections to our index.

Frequently Asked Questions

Does MAX98357A I2S 3.2W Class-D Amplifier work without an internet connection?
100% local I2S audio playback.
How is MAX98357A I2S 3.2W Class-D Amplifier powered and wired to the host board?
5V VCC for speaker power I2S (LRC=GPIO25 BCLK=GPIO26 DIN=GPIO22).
How does the host board reach Home Assistant (ESPHome)?
Wi-Fi 2.4GHz.

Alternatives

Related Compatibility Matrix Guides