Audio Amplifier

I'm working on something using the WT588D-16p voice chip seen here.

The chip info states the PWM output can directly drive 0.5W/8Ω speakers, push-pull current abundant.

I have uploaded 2 audio 22000Hz mono wav files into the chip, and connected it a .5W/8Ω speaker and hooked it all up on a breadboard with a button to play the audio. Everything works fine and the audio plays, but I need it to be louder. Here's what I don't understand, I have two LM386 Modules laying around like this:

I connected the two PWN pins from the sound chip to the LM386 and 9Volts for power. When the volume knob on the LM386 is at it's lowest the audio plays, but is very quiet. If I turn the knob a bit higher the audio gets distorted/noisy/inaudible.

Any idea why that is happening? I tried different speakers and voltages for the LM386 and it doesn't make any difference. Is there something I'm missing here?

Any idea why that is happening?

I would suggest that it is clipping.
Paying attention to the speaker and it's mounting will probably be the best way to get more volume. Otherwise use another amplifier.

Thanks, I just bought a few different amplifiers and will test them when they arrive.

The chip has class-D output and cannot therefore be amplified by an analog amplifier. The
datasheet doesn't say what the PWM frequency is, but that it can handle +/- 200mA.

Does that mean I need a class-D amplifier? Will that work on the PWM pins or will I need to use the DAC pin?

Will that work on the PWM pins or will I need to use the DAC pin?

Their is no DAC pin on anything but the Due or Zero.

Does that mean I need a class-D amplifier?

Only if you do not have a restoration filter between the PWM and the audio input.

Nooffswitch:
Does that mean I need a class-D amplifier? Will that work on the PWM pins or will I need to use the DAC pin?

I suspect you don't understand what class D is. Standard class D amplifers are analog in, class D out. You
have class D already, so you merely need to boost the voltage and current of the signal which is purely
digital/binary which a switching device or devices. This might be done with a fast H-bridge for instance.

At high power the output should really be low-pass filtered with LC filter to reduce the EMI from the speaker
leads...

Yeah I know next to nothing about audio so I'm trying to figure it out. When I asked about connecting the PWM or DAC, I meant from the audio chip to the amplifier not from the arduino based on a schematic I found where someone connected the WT588D to a LM386 circuit using the DAC pin from the WT588D.

Would it make more sense to go from digital to analog like this or use an h-bridge as mentioned by MarkT? As long as the sound isn't garbled I'm not worried about it being perfect quality.

Is there a recommended circuit board I can buy that does what I need like the L298N or something?

Would it make more sense to go from digital to analog like this or use an h-bridge as mentioned by MarkT?

No MarkT was, along with me, under the impression you had a digital output.

The simplest system is to have a "computer" speaker that is available everywhere.

So any computer speaker with an adapter would work if I just connect the audio GND to the PWM- and the audio signal to the PWM+? Since my audio file is mono I only need one speaker. If that's all I need that's good news. Thanks guys.

So any computer speaker with an adapter would work if I just connect the audio GND to the PWM- and the audio signal to the PWM+?

No connect the amplifier to the DAC pin, through a 4u7F capacitor, like in the diagram. Also keep C6 and R6.

You caused confusion with not being clear about what sort of output you had, the diagram in #7 should have been in the original post. We all found the photograph in that post less than helpful.

Ok, I tried that and it's not working, still get garbled audio when turning up the volume pot on the LM386. Here's some pics of my setup, maybe someone can see what's wrong. I added a 0.1uF ceramic capacitor, 510 resistor, and 4.7uF capacitor before connecting to the DIN on the LM386.

Edit: Oh and the battery pack connections came out while I was taking the photos so ignore that...

I thought we said use a computer speaker, not the LM386?

Ohhh... I'll see if I can find some old computer speakers when I get home tonight.

I hooked up the speakers (usb powered) and it's working. If I crank up the sound all the way it's a good volume, but there's still some static while the audio file is playing, and a pop at the end from the speaker.

It doesn't seem to make any difference if I connect the mono cable into the DAC/GND directly on the WT588D or use the resistor/capacitors mentioned earlier in the circuit, since both sound exactly the same. I should mention the static is there regardless how low/high the volume knob gets turned.

Any suggestions for cleaning up the static?

and a pop at the end from the speaker.

It will do that if the sample stops not at the zero voltage level. Try the fade out function on Audacity to edit your files.
Alternately it could be produced by the player's amplifier turning off after playing.

I should mention the static is there regardless how low/high the volume knob gets turned.

I have herd people describe audio artifacts as static but I don't think that is right. Static is basically white noise. More than likely you here clicks and distortions in the file. If you can look at the output signal with an oscilloscope and that would tell you, but I don't suppose you have one.

Often sounds are distorted by clipping, that is the signal flat lines at the top and bottom. To stop this from happening you need to reduce the peak amplitude of the audio file. Again using Audacity you can "normalise" the waveform, a good value to normalise to is about 13dBs down.

Well I'm not exactly sure why, but I was trying different sampling rates/normalizing/sampling formats (16vs24bit) and still got the static, but the second time I popped the chip into the breadboard after flashing it and tried it, all the "static" and pop at the end went away. I tried again with even the original wav files I was using and they sounded great. Weird, I'll chalk it up to a loose breadboard connection.

Thanks a lot for the help Mike.