Maker Pro
Maker Pro

Arduino + Audio Amplifier Board Help

Hey, it's me again, struggling with electronics as usual. In my project, I am trying to get Arduino Text to Speech working, but I have run into a large issue. I am using this audio amplifier board wired as so:

The output right + and - are wired to my speaker
The 5v and Ground are wired to the input 5v and ground of the Arduino
The R input is wired to digital pin 3
The ground input is wired to the ground on the Arduino's digital pin side

Right now, when powered on, the speaker makes barely audible groans. Then, my speaker begins to heat up and I can smell ozone. I'm confused where my wiring went wrong.
 
What is the output from the Arduino? It cannot produce audio directly. If it is PWM, you need a resistor from the pin and capacitor to ground to make a low pass filter. It should have a cutoff of about 4000 Hz for voice.

Also use a coupling capacitor between the output of the RC filter and the input of the audio amp.

Bob
 
What is the output from the Arduino? It cannot produce audio directly. If it is PWM, you need a resistor from the pin and capacitor to ground to make a low pass filter. It should have a cutoff of about 4000 Hz for voice.

Also use a coupling capacitor between the output of the RC filter and the input of the audio amp.

Bob
Alright thanks! It is a PWM output. So should the wiring be
pin --> resistor --> audio signal input & resistor --> capacitor --> ground
or
pin --> resistor --> capacitor --> ground & capacitor --> audio signal input

Also, what resistance and capacitance should I use?
 
Like this:

upload_2018-5-20_11-12-3.png

And this will just get you some kind of sound, not good sound. It depends a lot on the PWM frequency. If it is 100 KHz it might work well, if 8 KHz it will be awful. You may need a much sharper filter (a couple of Sallen Key stages) after the RC filter if the PWM frequency is anywhere in the audio range.

Bob
 
Last edited:
The class-D oscillator in the PAM8403 is at 260kHz so it might beat with your PWM oscillator.
Maybe the ebay amplifier uses a Chinese version of the PAM8403 that has a defect in it. Maybe the amplifier has a solder short on it.
 
Sending in raw PWM will certainly cause a problem with a class D amplifier. It absolutely needs to be smoothed with at least the simple filter I proposed, and probably much more to sound good.

Do you happen to know the PWM frequency?

Bob
 
Sending in raw PWM will certainly cause a problem with a class D amplifier. It absolutely needs to be smoothed with at least the simple filter I proposed, and probably much more to sound good.

Do you happen to know the PWM frequency?

Bob
I do not. I only know that I am using the "TTS-master"/jscrane TTS text to speech library that generates the sound. The code does not mention the frequency,
 
Sending in raw PWM will certainly cause a problem with a class D amplifier. It absolutely needs to be smoothed with at least the simple filter I proposed, and probably much more to sound good.

Do you happen to know the PWM frequency?

Bob
Can you also clarify the capacitance and resistance values in your diagram? Is this 390ohms, 1 micro farad, and 100 nano farads?
 
Yes, but the output from the Arduino will not be able to drive it. I might go as low as 100Ω. That would raise it to 1200Hz. You can certainly try this, it will sound like you have no highs, but it should get you sound out. You can also put caps in series to lower the capacitance. Do you have any junked electronics sitting around? 100nF is a very common capacitor value. A ceramic disc would be marked 104.

Bob
 
Yes, but the output from the Arduino will not be able to drive it. I might go as low as 100Ω. That would raise it to 1200Hz. You can certainly try this, it will sound like you have no highs, but it should get you sound out. You can also put caps in series to lower the capacitance. Do you have any junked electronics sitting around? 100nF is a very common capacitor value. A ceramic disc would be marked 104.

Bob
Am I going for a high Hz cutoff or a mid-range cutoff?
 
Vowels in speech are grunts and groans and reach about 3kHz. Consonants in speech are important for understanding and reach about 14kHz. Tea or fee? Sim or him? The words Failing and Sailing sound the same without hearing the high frequency consonants.
 
Vowels in speech are grunts and groans and reach about 3kHz. Consonants in speech are important for understanding and reach about 14kHz. Tea or fee? Sim or him? The words Failing and Sailing sound the same without hearing the high frequency consonants.
So am I better off with a 482hz cutoff than a 1200hz cutoff?
 
With a cutoff at 482Hz I doubt you will understand anything in speech. With a 1200Hz cutoff it is only slightly better but is still extremely muffled.
Old fashioned telephones had a cutoff of about 2700Hz and the most common phrase was "What did you say?". AM radio has a cutoff of about 3500Hz but they use pre-emphasis (treble frequencies boost) to make it sound better.
FM radios and TVs have a cutoff of 15kHz and CD has 20kHz.
 
With a cutoff at 482Hz I doubt you will understand anything in speech. With a 1200Hz cutoff it is only slightly better but is still extremely muffled.
Old fashioned telephones had a cutoff of about 2700Hz and the most common phrase was "What did you say?". AM radio has a cutoff of about 3500Hz but they use pre-emphasis (treble frequencies boost) to make it sound better.
FM radios and TVs have a cutoff of 15kHz and CD has 20kHz.
So higher is indeed better? So what combination of resistors and capacitors can get me a high enough cutoff that speech will be understandable?
 
Top