Close

Revisiting MAX98357A DAC

A project log for Loud ESP

I'm looking for perfect audio DAC for ESP8266/ESP32

andriymalyshenkoandriy.malyshenko 02/18/2022 at 14:136 Comments

When I've tested MAX98357A module before in this project, I came to conclusion that it is only capable to produce moderate quality audio for non-demading projects. Funny enough I couldn't be more wrong about it.

While performing audio tests with the development board shared in the previous post I got the same scores, quite disappointing audio quality with hearable distortions. Datashees was much more optimistic on the chip's performance, so I sit to play around with some components to see if I can make it play better. Since there are not so many components to play around with, I started poking around output filters.


Originally I put output LC-filters similar to Adafruit's module as on the picture above. Not very happy with the result I revisited MAX98357 datasheet and found that it does not require any output filters apart from the speaker itself service as LR filter

So out of curiosity I've removed the filters altogether and funny enough DAC started to produce clear audio! Below is waveform with no filters (taken from toy-oscilloscope, sorry again)

1KHz 

2KHz
10 KHz

20 Khz

It doesn't look very promising just yet, but at least it works up to 20KHz with no issues. Much better than before.

Next I've connected simple RC filter with 2Ohm (1Ohm per output) and 4.7uF cap in parallel to setup first order Low-pass filter set to filter out frequencies above 16KHz, which is reasonable margin for relatively cheap speakers I have. Here is the waveform behind filter

1KHz

2KHz
10 KHz

20 KHz
Now it looks much better and I claim this result as acceptable.

The only issue I have now is that having 2Ohms in parallel with 6 Ohms speaker push down efficiency quite a lot (although it is not dramatic when you hear the difference) and resistors warming up quite badly. If I decrease resistor value to 1 Ohm (.5 Ohm each output) output stage is losing stability.

So in the end I'm going for no filter at all, just as datasheet says. I can't hear the difference really, and efficiency means more to me in the context of battery life.

Discussions

h4rdc0der wrote 01/23/2024 at 15:39 point

I'm working on my own Zigbee Gateway which uses MAX98357. It appears that these little guys (L1, L2 and C8, C9) are there ONLY for EMC reasons. They will filter out unwanted frequencies before radiating (far above 20KHz) them outside via speaker cables.

"In applications where speaker leads/wires are long (exceeding approximately 12 inches), additional EMI suppression can be achieved by using a filter constructed from a ferrite bead (FB1, FB2) and a capacitor to ground (C8,C9) (Figure 2)."

https://www.analog.com/media/en/technical-documentation/data-sheets/MAX98357DEVTQFN-MAX98357EVSYSTQFN.pdf

  Are you sure? yes | no

svofski wrote 01/11/2024 at 13:50 point

Hi! I have this amp on one of my ESP32 boards. I'm trying to fit it with a line out jack, but I can't find a decent way of making proper line out from the dual H-bridge output stage. Normally one would say that this is impossible, but this is hackaday. Have you got any idea how to add a line out to this chip?

  Are you sure? yes | no

andriy.malyshenko wrote 01/11/2024 at 16:56 point

Hey. Pls look at this schematics, it is a spekaer + headphones driver, only mono tho

https://github.com/olup/grigri/blob/main/hardware/outputs/Untitled.pdf

I'm not sure if stereo is possible without opamps, can you explain your use case little more?

  Are you sure? yes | no

svofski wrote 01/11/2024 at 18:50 point

Thank you!

I have a board from aliexpress, it has a max98357a that drives a little speaker. I need to add a 3.5mm jack to be able to plug it into an external amp. The schematic in your link will work with headphones, but I'm not sure it will work with a powered amp because there is no common ground.

  Are you sure? yes | no

andriy.malyshenko wrote 01/11/2024 at 19:21 point

Just buy a PCM5100 DAC instead if you're using external amp. Similar cost, hell of a difference

  Are you sure? yes | no

svofski wrote 01/11/2024 at 19:46 point

It's not exactly a high-end application so I'm trying to make do with what I already have. I guess I'll just use pwm_audio if tapping to max98357 doesn't work. Anyway thanks for your help!

  Are you sure? yes | no