Audio AC Coupling Help !

Hi, I have an Arduino Audio project that has a 2.5V DC component that I want to dump before my amp - the audio signal from the Arduino is +5v to 0v centered on 2.5v.

If i run the circuit into an commercial audio amp it works nicely, if however I run it into my goto LM386 project amp, there is too large a DC Component which the amp does not like.

The best result I have had are with a 10 Ohm resistor and two 0.1uf caps in parallel to ground - I assume that this is will allow too much current to flow from the Arduino to ground so what are my other options for getting rid of the DC Component ?



Have you tried putting a higher value resistor between the RC filter circuit and ground to limit the current?

Use a series capacitor leading up to the amp. 100uF to 220uF.

And since it will be electrolytic make sure the polarity is correct. It is universal in audio circuit to AC couple like this. When you need a DC offset (such as for feeding to ADC) then a single series capacitor is all that’s needed to separate the parts of the circuit.

You need to work out the right value of capacitor - this means you have to know the input-impedance of the circuit it is driving. For full audio bandwidth the RC-product of the input impedance and series capacitor should be >= 0.015 or so (so for a 10k input impedance 1.5uF is enough, for 100 ohm input 150uF would be needed… This is for a -3dB point at 10Hz)

Hi, I am using an LM386 - into which I am sending 8bit audio PWM.

When I use tone of something similar to output a square wave I get a nice crisp tone with lots of volume.

I need a break from this, going to get some fish and chips and then have another go at it.

If any of you happen to know of a good template design I can use as a basis for output DDS through an LM386, I would love to know about it.

Speak in a while, thanks

Duane B

Ok, been for fish and chips and now realise what my problem really is -

I have four voices of a synth being generated by Arduino - in order to pack all of the four channels into one PWM output, they get summed together and divided - in other words they get averaged.

Now the problem is that if you average together a bunch of waveforms you will end up with something that is pretty close to the average of each of the individual wave forms which is zero (zero being 50% duty cycle on the PWM output).

One option is to split the output across two PWM channels, an other is to add a heuristic of some sort the makes a reasonable guess at when a signal should be loud and when it should not.

What I am struggling with is what cant I just fix it with higher gain ?


Maybe check with WilliamK, ruggedcircuits, see how they did sound output on their beat707 thingee.

If you get the national data sheet for the LM386… there might be several choices as many people second source that ic. The National Semi one has all the reference designs you will ever need… 3 of them as I… included the correct data sheet I looked at it first and it is the one you want. BTW a 22uF coupling cap should work just fine… Always has for me.


LM386N.pdf (257 KB)

Hi, Its for this incredible little Arduino based synth - all of the sound is coming from a single 8 bit PWM Channel -

It works will through an audio amp, but is very quiet through the LM386 - unless I just output one or two channels.

I assume its down to two things -

1) The LM386 is seeing the underling 5V square wave and adjusting its gain accordingly 2) The code outputs the four audio channels through on PWM channel by averaging them and modulating the duty cycle, this has the effect of bringing all four closer to the longer average which is 0 (50% duty cycle).

Commercial audio amps seem to be able to work with this, I assume that they are more effective at filtering out the underlying square waves, but the LM386 is very effective with one voice - pretty good with two voices - hopeless with four.

If your interested I plan to launch the code in the next few days, its based on a synth which has been around for a while but which was not documented so not widely known or used. I have refactored it into two classes, optimized it and documented it with a plan of launching it with a couple of example projects to demonstrate its incredible power - its entire sound comes from varying the duty cycle of one 8 bit pwm output.

Duane B