Hello friends, I hope you all are doing great. Today, I am going to share the new MAX98357A I2S Amplifier Library for Proteus Simulation. The MAX98357A is a tiny class-D amplifier with a digital input: it takes audio as an I2S stream of numbers and drives a 4 or 8 ohm speaker directly, up to 3.2 W from 5 V. There is no analog audio anywhere between your board and the speaker, so no hum, no DAC and no volume knob - just three digital wires. With this library you can run a full Proteus simulation of a MAX98357A breakout: the I2S receiver, the channel selection with SD, the gain set by the GAIN pin, the bridge-tied output and the sound itself.

Figure: The MAX98357A simulation running: an I2S stream from the Arduino played as notes.
Updates

MAX98357A I2S Amplifier Library for Proteus

Latest version: V1.0 (November 2026, this tutorial)

Other audio parts: INMP441 I2S Microphone · Mini Speaker

Helping Tools

The demo goes one step further: an Arduino UNO, which has no I2S port at all, builds the I2S stream in software and plays a short arpeggio through the amplifier.

NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the sound board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the MAX98357A I2S Amplifier Library for Proteus Simulation:

Figure: The MAX98357A I2S Amplifier Library for Proteus Simulation.

What Is the MAX98357A I2S Amplifier?

The MAX98357A combines a digital audio interface, a digital-to-analog stage and a class-D power amplifier in a 3 x 3 mm package. The common breakout puts it on a small board with a few capacitors, a screw terminal for the speaker and a 7-pin header: LRC, BCLK and DIN for the I2S stream, GAIN and SD for the settings, and GND and VIN for power. Because the output is class D, the amplifier is efficient - around 90 % - and stays cool even at full power, and because it is filterless the speaker connects straight to the board.

The MAX98357A at a glance
MAX98357A I2S amplifier
InputI2S: LRC, BCLK, DIN; 8 - 96 kHz; 16 / 24 / 32 bits
Outputbridge-tied class D, 3.2 W into 4 ohm at 5 V
Gain3, 6, 9, 12 or 15 dB by the GAIN pin
Channelleft, right or (L + R) / 2 by the SD pin
Supply2.5 - 5.5 V on VIN
UsesESP32 speakers, voice prompts, music players, alarms

I2S in a Nutshell

I2S carries stereo audio on three wires. BCLK is the bit clock: one pulse per bit. LRC (also called WS, word select) tells which channel the bits belong to - low for the left word, high for the right one - and it changes once per sample, so its frequency is the sample rate. DIN carries the bits themselves, the most significant bit first. In the standard I2S format the MSB of each word comes one BCLK after LRC changes, and the receiver reads DIN on the rising edge of BCLK. With 16-bit words a frame is 32 BCLKs; at 16 kHz that is a 512 kHz bit clock.

SD: the Channel Pin

A stereo stream carries two channels, but one MAX98357A drives one speaker, so the SD pin decides what it plays. The datasheet reads it as a voltage: above 1.4 V the left channel, between 0.77 and 1.4 V the right one, between 0.16 and 0.77 V the average of both, and below 0.16 V the amplifier shuts down. Inside the chip a 100 kohm resistor pulls SD down; the breakout adds 1 Mohm to VIN, so an open SD sits at about 0.45 V on 5 V - the (L + R) / 2 mode. Two boards with SD pulled to different levels make a stereo pair from one stream.

GAIN: Five Settings From One Pin

The gain is set by how the GAIN pin is connected when the amplifier powers up: open gives 9 dB, GND 12 dB, VIN 6 dB, GND through 100 kohm 15 dB, and VIN through 100 kohm 3 dB. The setting is read once; change the wiring and the new gain applies at the next power-up. In this library a full-scale sample, 0 dBFS, gives the gain in dBV RMS at the speaker - 2.8 V RMS at 9 dB - limited by the supply.

Class D, Bridge-Tied

A class-D amplifier switches its outputs between the supply and ground hundreds of thousands of times a second; the share of time each output spends high follows the audio. The MAX98357A drives both ends of the speaker in opposite directions - a bridge-tied load - so the speaker sees up to twice the swing of a single output. The two speaker wires both carry a switching voltage around VIN / 2: neither of them is ground, and neither may be connected to ground. The library models the bridge by its average: each output at its duty cycle times VIN, behind a fraction of an ohm, so the speaker gets the audio and VIN supplies the current.

The Amplifier in the Simulation

The model listens to every edge on LRC, BCLK and DIN. On each rising BCLK it reads DIN; when it sees LRC change, the bit just read is the last bit of the previous word, so it closes that word, whatever its length, and starts the next. From the time between LRC's falling edges it measures the sample rate; from the BCLKs between them the frame length. It mixes the channels as SD asks, scales the sample by the gain, clips it at the supply and puts it on the bridge. It also finds the tone - from the upward zero crossings of the samples - and the level in dBFS, and plays the tone on the PC's speaker at the loudness of the power going into the load. When the clock stops for a millisecond, the output switches off.

Features of the MAX98357A I2S Amplifier Library for Proteus Simulation

  • A real-looking module: the 18 x 20 mm breakout at its real size, the MAX98357A, its parts, the speaker terminal and the 7-pin header.
  • A real I2S receiver: the standard format, any word length up to 32 bits, the rate and the frame length measured from the stream.
  • SD and GAIN as on the chip: the channel modes and shutdown by SD's voltage, the five gains by GAIN's connection.
  • A bridge-tied output: averaged class D, clipping at the supply, the current from VIN.
  • Sound: the tone and its note, the level in dBFS, the power - and the tone on your PC's speaker.
  • A pop-up: the speaker voltage on a scope, the stream and the settings, eight tiles - graphs, an event log and a check page.
  • A complete package: about 1.6 MB with the library, our power resistor, our Arduino UNO V4.0 and the demo, without the source code of the model.

The MAX98357A in Proteus

The device is MAX98357AMPTEP in TEPMAX98357A.LIB, under Modules > Audio, with the prefix U and the model TEPMAX98357A.DLL. Search MAX98357A or I2S in Pick Devices. The speaker pins OUT+ and OUT- are at the top; the header at the bottom has LRC, BCLK, DIN, GAIN, SD, GND and VIN. There are no properties: the gain and the channel come from the pins, exactly as on the real board.

Figure: The MAX98357A I2S amplifier.

Download MAX98357A I2S Amplifier Library for Proteus Simulation

Click the button below to download MAX98357A-I2S-Amplifier-Library-for-Proteus-v1.0.zip (about 1.6 MB, without the source code of the models):

MAX98357A I2S Amplifier Library for Proteus V1.0
  • README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
  • Proteus Library Files: TEPMAX98357A.LIB, TEPPOWERRES.LIB and ArduinoV4TEP.LIB.
  • Proteus Model Files: TEPMAX98357A.DLL, TEPPOWERRES.DLL and TEPARDUINO.DLL.
  • Arduino Code: the demo sketch (I2S in software, no library).
  • Proteus Simulation: the demo project, its HEX file and copies of the DLLs.

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install MAX98357A I2S Amplifier Library for Proteus Simulation

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
  3. Copy the files from Proteus Model Files into the MODELS folder.
  4. Delete TEPMAX98357A.IDX from the LIBRARY folder if it is there.
  5. Start Proteus, press P and search for MAX98357A.

Proteus Simulation of an I2S Stream From an Arduino

The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0, the amplifier U1 and an 8 ohm, 5 W power resistor R1 as the speaker's load. DIN goes to D2, BCLK to D3 and LRC to D4 - all three on the UNO's port D, so one write sets them together. GAIN and SD are left open. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open MAX98357A-I2S-Notes-ArduinoUnoV4.pdsprj. On the sound side, our INMP441 Microphone Library for Proteus covers the other half of I2S audio - a digital microphone - and the same UNO technique clocks it.

Figure: The whole simulation on an A4 sheet.

The Sketch: I2S in Software

An UNO has no I2S hardware, so the sketch writes the port directly. Timer1 runs in CTC mode without a prescaler and overflows every 1000 clocks - 16 000 times a second:

  TCCR1A = 0; TCCR1B = _BV(WGM12) | _BV(CS10); OCR1A = 999; // Timer1 CTC, no prescaler: 16 kHz

Each frame waits for that flag, so the sample rate is steady even though the interrupts are off:

    while (!(TIFR1 & _BV(OCF1A))) {}                        // Timer1: one frame every 1000 clocks = 16 kHz

A frame is 32 BCLKs. The first one carries the previous right word's last bit with LRC low; LRC rises at BCLK 16, one bit before the right word's MSB, as the I2S standard wants:

    if (p >= 16) v |= _BV(4);                               // LRC high from BCLK 16: the right word's MSB comes at BCLK 17

DIN is set while BCLK is low and BCLK then rises - the moment the amplifier reads the bit:

    PORTD = v; PORTD = v | _BV(3);

The samples come from a 64-step sine table at -6 dBFS and a 16-bit phase accumulator; the phase step sets the note:

  const uint16_t step = (uint32_t)hz * 65536UL / FS;        // the phase step: 16 bits = one cycle
    frame(hz ? (int16_t)pgm_read_word(&SINE[phase >> 10]) : 0);

MAX98357A Simulation Results

Open the project and press Run. The demo runs 2.9 simulated seconds and took about two minutes on our PC with the pop-up open and the pictures being taken. Click the amplifier for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.

The Start

At power-up the amplifier reads its GAIN pin: open, at half of VIN through the model's internal divider, so 9 dB. SD, open on the breakout, sits at 0.45 V - the (L + R) / 2 mode. The Arduino prints its title and starts the stream: the amplifier finds LRC at 16.0 kHz with 32 BCLKs a frame, so 16-bit words, and reports the I2S stream in its event log.

The First Note

The first note is C5. The amplifier decodes every frame, mixes the left and right words, and finds a 525 Hz tone at -6.0 dBFS. With 9 dB of gain, -6 dBFS becomes 1.34 V RMS across the speaker, and the 8 ohm load takes 0.224 W. The PC plays the tone at that loudness. The scope shows the speaker voltage as a sine built of small steps - one step per sample, 16 000 a second.

Figure: C5 from the stream.

The Arpeggio

The notes follow each other: E5 at 660 Hz, G5 at 785 Hz and C6 at 1049 Hz, all at -6.0 dBFS and the same 1.32 - 1.34 V RMS, between 0.219 and 0.224 W. The small offsets from the exact notes come from the sketch's 16-bit phase steps and the measured rate of 16.0 kHz. By the time C6 plays, 22 090 frames have passed through the amplifier.

Figure: C6 on the scope.
Figure: The amplifier and its load.
Figure: The simulation in the workspace.

Silence

During the silence the stream keeps running at 16.0 kHz - the clock is there, but every sample is zero. The amplifier shows SILENCE rather than NO CLOCK: the output stays on at zero volts, ready for the next note. If the Arduino stopped clocking altogether, the model would switch the output off after a millisecond, as the chip's clock detection does.

Figure: Silence: the stream runs.

The Graphs, the Event Log and the Check Page

The Graphs page plots the speaker voltage, the tone, the level in dBFS and the power: the notes appear as steps in the tone and gaps at the silence. The Event log keeps the power-up gain, SD's mode and the moment the stream was found. The Check page sums up the run: VIN at 5.00 V, the I2S stream at 16.0 kHz with 16-bit words and 32 BCLKs a frame, SD at 0.45 V for (L + R) / 2, GAIN at 9 dB, the output without a clipped sample, and an 8 ohm speaker.

Figure: The Graphs page.
Figure: The Event log.
Figure: The Check page.

The Arduino's monitor names each note before it plays.

Figure: The Arduino's monitor.

Try It Yourself

  • Connect GAIN to GND (12 dB) and watch the voltage rise; at 15 dB with louder samples, look for clipping.
  • Pull SD to VIN through a 1 kohm resistor: the left channel only - then send different notes on the left and right words.
  • Ground SD and the amplifier shuts down while the stream keeps running.
  • Change FS to 8 kHz and OCR1A to 1999: the notes stay in tune, the steps on the scope get bigger.
  • Stop the clock in the sketch and watch the output switch off after a millisecond.

Ideas to Extend the Demo

  • A doorbell that plays a short melody when a button is pressed.
  • Voice-style beeps: different tones for "OK", "error" and "done".
  • An ESP32 with its hardware I2S playing the same notes without blocking the processor.

Your Own Sketches

The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.

Things to Know Before Using a Real MAX98357A

  • Supply: 2.5 - 5.5 V; a 4 ohm speaker at 5 V draws peaks over 1 A.
  • Speaker wires: never ground OUT- - the output is bridge-tied.
  • I2S source: an ESP32, a Raspberry Pi or another board with I2S hardware is the normal partner; an UNO can only do short bursts.
  • Level: 0 dBFS at 15 dB gain clips on 5 V; keep some headroom.
  • Wiring: keep BCLK and DIN short and away from the speaker wires.

Troubleshooting

  • NO CLOCK: BCLK or LRC are not connected or not toggling.
  • Silence with a stream: the samples are zero, or SD is under 0.16 V.
  • The wrong channel: SD's voltage picks left, right or the average.
  • Distortion: clipping - lower the gain or the sample level.
  • The part is not simulated: TEPMAX98357A.DLL is missing from MODELS and from the project folder.

Limitations of the Simulation

  • The I2S receiver, the clock detection, SD's modes, GAIN's settings, the bridge-tied output and clipping follow the MAX98357A datasheet; the board is our own drawing.
  • Our own choices: 0 dBFS = the gain in dBV RMS, 0.2 ohm a side, a 1 ms clock timeout, the output averaged without the switching ripple.
  • Not modelled: left-justified and TDM formats, the click-and-pop suppression, the thermal and over-current protection.
  • Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the chip's maker.
  • Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.

So, that was all about the MAX98357A I2S Amplifier Library for Proteus Simulation. I hope it helps you understand digital audio from the bit clock up - and hear your first notes before the speaker arrives. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!