Electronic – arduino – use a slightly bigger or smaller output capacitor in an audio amplifier

amplifierarduinocapacitor

I am currently working on building a basic audio amplifier with the Arduino Uno and am following a tutorial on how to do so.

This is the schematic:

Schematic

(Source: arduino.cc)

The project calls for a 250 microfarad capacitor, but I only have either 220 or 330 microfarad capacitors. Will choosing either of those affect the circuit much? And in what way? Mind you, I'm also trying to learn about the functionality of a capacitor.

Best Answer

The capacitor in question acts as a DC blocker and will make an RC filter with the speaker impedance.

As for the effect of making it smaller or larger, there are two filters on your output to analyze here:

  • Filter 1: RC with a 10 ohm resistor and 0.05 µF capacitor. This one forms a low-pass filter on the output with a corner frequency of 318 kHz (1/(2*pi*RC)).
  • Filter 2: RC with your speaker (8 ohm or 4 ohm) and the 250 µF capacitor. Since the speaker is inline with this one, it is a high-pass filter with a corner frequency of 79 Hz (8 ohm speaker) or 159 Hz (4 ohm speaker).

From this we see that this capacitor will affect the lowest frequency that will be sent to your speaker. As you increase the capacitance (C gets larger), the corner frequency of your filter will decrease. Choosing 330 µF will give you a corner frequency of 60 Hz (8 ohm speaker) and choosing 220 µF will give you a corner frequency of 90 Hz (8 ohm speaker). It is not a huge difference either way, but I'd choose the larger value just because it's a greater frequency range.

On another note, if you start to hear things like the AC line hum on your speaker (due to a badly filtered power supply or something), you can decrease that capacitor so that it filters out the 50 Hz or 60 Hz hum better. So maybe the smaller capacitor would be better for that route.

As for the function of a capacitor, to intuitively see what they do in a circuit, I think of it as a resistor whose resistance decreases as the signal frequency increases. This is an oversimplification, but it makes it easy to figure out if a filter is high pass or low pass just by looking. If your capacitor is in series with the signal, only high-frequency signals can get through it. If the capacitor is in parallel with your signal to ground, only low frequencies make it through because the capacitor shorts out the high frequency parts to ground. Remember, this a gross oversimplification and only helps to figure out what the circuit is doing. To actually figure out what the filter's parameters are you need to account for the resistances as seen by the capacitor (in your case, the speaker, the resistor in series with the other capacitor, and the output resistance of the LM386 (which I assumed to be close to zero)).