MoloWorks account

Welcome back.

Sign in to continue where you left off.

Forgot password?

New to MoloWorks?

EQ-23 · I²S amplifier · Full kit

Play a short, quiet tone over I²S

An I²S digital audio amplifier with a two-pin socket for the kit’s matching speaker plug.

MAX98357A digital amplifier board, component side

How to use it

You’ll need: ESP32-S3 with a MicroPython build that provides machine.I2S, MAX98357A, the matching speaker, jumper wires, and a regulated 5 V supply.

Connections

This example uses one part at a time on the MoloWorks ESP32-S3. If a course uses different GPIO pins, follow that course’s wiring and code together. Disconnect USB and any external power before changing wires.

On the partConnect to
Amplifier VIN / VCCRegulated 5 V supply +
Amplifier GND5 V supply − and ESP32 GND
Amplifier BCLKESP32 GPIO5 (bit clock out)
Amplifier LRCESP32 GPIO6 (word select out)
Amplifier DINESP32 GPIO4 (audio data out)
Two-pin outputMatching speaker plug; neither terminal goes to ground
  1. With power off, insert the speaker plug in the matching socket and wire the three I²S signals. This amplifier does not need a master clock. Check your breakout’s SD (enable and channel select) and GAIN defaults; leave them at their factory settings if the board is already configured to play.
  2. Place the speaker away from your ears. Run the short low-amplitude example. MicroPython sends 16-bit audio to both channels in mono mode.
  3. If it stays silent, turn the supply off and check the speaker plug, VIN, shared ground, and whether SD enables the board. Confirm the MicroPython firmware provides I²S before changing pins or increasing volume.

MicroPython example

Run this on the board with your MicroPython editor. Set up the ESP32-S3 first if you don’t have a working connection.

from machine import Pin, I2S
from math import sin, pi
from struct import pack_into

tone = bytearray(4000 * 2)
for i in range(4000):
    value = int(600 * sin(2 * pi * 440 * i / 16000))
    pack_into("<h", tone, i * 2, value)

audio = I2S(0, sck=Pin(5), ws=Pin(6), sd=Pin(4),
            mode=I2S.TX, bits=16, format=I2S.MONO,
            rate=16000, ibuf=4000)
try:
    audio.write(tone)
    audio.write(bytearray(4000 * 2))
finally:
    audio.deinit()

What to look for: The speaker plays a brief quiet tone and stops. The amp output is for the speaker pair only, never for the ESP32 or ground.

AI prompt

Copy the prompt and replace any brackets with details from your kit. Check the suggested wiring against the labels on your parts before applying power.

Play a short, quiet tone over I²S

I have the MoloWorks MAX98357A and 8-ohm speaker on a MicroPython ESP32-S3. The amp uses regulated 5 V, common ground, BCLK GPIO5, LRC GPIO6 and DIN GPIO4. Show how to verify the breakout’s SD and GAIN settings and play one short, quiet I²S tone. Explain why the two speaker terminals both go to the amp. If silent, help me check enable, wiring and I²S support before raising volume.

MicroPython I²S reference

Contact QR code

Open contact