Annoying sine high pitched sound through speaker

Hi,

I combined my Arduino with a text to speech module and a simple 12W audio amplifier. However, now whenever I let the Arduino dim th ebacklight of the LCD I get this anoying continuesly high peeping noise through the speaker.

My grounds all come from a central point (my +5V do not) and I already tried shielding each and ever cable having to do with audio. No success here. I did figure out the potentiometer I have put in between the amplifier and the sound input does not affect the peeping volume.

I guess the noise is generated by the PWModulation of the back light of the LCD being dimmed?? Am I correct?

Anybody have any idea what I can do next to try to stop this beeping?

I can remove the beeping by always setting the backlight either completely on or off. But that's not what I want.

Unfortunately human hearing is extremely sensitive and will hear the smallest induced noises on audio signals, as you have discovered. I see two relatively simple options (the "harder" option is to solve this problem properly through a combination of proper routing and shielding).

1) Increase the PWM frequency of the LCD dimmer to some frequency that you can't hear (theoretically 20 kHz, but likely 16 kHz or is more realistic if you've old enough ;))

2) Change from PWM dimming to linear dimming using an adjustable voltage regulator like LM317 and its cousins.

Yes, I think you are correct that the problem is due to pwm spikes. Here are some fixes one or all of which should fix your problem:

--Run your audio through a low pass filter before amplifying it. Look at wikipedia's low-pass filter page, it explains it pretty well. Pick an RC frequency value that is somewhat below the top frequency you would like to output, such as 5KHz. You may have better luck running it through two low-pass filters in succession

--Change the frequency of the PWM, so that it will be easier to filter out. The default frequency for the analogWrite is 500Hz, which is right in the middle of the audio range. This will take some messing around with timer control registers

--Increase the amount of rectification smoothing on your power supply by putting a medium-to-large capacitor (300uF, e.g.) across your +5V and ground. But don't go too large on your capacitor, or you'll fry the rectifier diodes. I'm thinking that possibly the display current is more than the power supply can handle, so maybe when you turn it on it temporarily overwhelms your existing smoothing capacitors. Maybe.

HTH

hah, RuggedCircuits beat me to it. ;)

Increase the amount of supply decoupling you have between the audio and digital parts of the circuit. http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Thanks!

--Increase the amount of rectification smoothing on your power supply by putting a medium-to-large capacitor (300uF, e.g.) across your +5V and ground. But don't go too large on your capacitor, or you'll fry the rectifier diodes. I'm thinking that possibly the display current is more than the power supply can handle, so maybe when you turn it on it temporarily overwhelms your existing smoothing capacitors. Maybe.

I power my Arduino's and my LCD using a separate DC-DC converter. It has a 1000uF smoothing elco (I think). So I do not think that's the problem since when the display is at full brightness I do not hear anything.

This low pass filter thing is something I should try. So if I read correctly I could just add a capacitor of say 25F between input source and ground and a resistor of say 100Ohm between input destination and input source? (The resistor mounted before the capacitor). This should than cut off anything above 4kHz

Unfortunately I cannot influence the frequency of the PWM since I only communicate with the display over serial.

Gumpy_Mike: I've read that before, very well written, but I need to study that more closely though. I'm not quite getting it yet. (On the practical part)

OK, I fetched a scope meter and discovered the source!

It's not caused by radiation, but rather by the high current that's being drawn by the backlight LED. When this is done with pulses (when the backlight is dimmed). The power source cannot cope with the high current/voltage peeks and transfers the distortion to the 12V source.

The 12V source is also the power source of the audio ampliefier which thereby amplifies the power drops in the source.

It tried to solve it using some elco's (combination of keramic and elctrolytic condesnors) in combination with a coil / resistor, but nothing helped. The best thing I got was that some coil/ondensor combination created a nice sine-wave from the signal. Actually that made it worse for the hearing. >:(

Still looking for the right combination to releive the power supply from the backlight power drain.

It seems like that should be pretty easily solved by a big old capacitor (>1200uF) across ground and your 12V supply, which would give a ready supply of electrons when the screen switches on and temporarily overwhelms the power supply. But then from your post I gather you tried that?

Could you post up a schematic?

The power source cannot cope with the high current/voltage peeks and transfers the distortion to the 12V source.

Is the solution not to get a voltage source with a bigger current capacity? It still boils down to decoupling in the end anyway.