# Thread: LM358 audio circuit on the Propeller BOE.

1. ## LM358 audio circuit on the Propeller BOE.

Was there ever any written discussion on the LM358 circuit on the Propeller BOE? Specifically U4 on sheet 4 of http://www.parallax.com/Portals/0/Do..._Schematic.pdf)

I've been trying to Google comparable circuits and can't quite find anything like it. It would seem that R9, R7 and C8 are forming the RC network for the Prop pin, but what I'm not clear about is what the purpose of C6 is and whether or not R5 has any effect on the signal.

I need schooling.

2. ## Re: LM358 audio circuit on the Propeller BOE.

That's a Sallen-Key low-pass filter: http://en.wikipedia.org/wiki/Sallen%...93Key_topology

-Phil

3. ## Re: LM358 audio circuit on the Propeller BOE.

Also here is a nice online tool:
http://sim.okawa-denshi.jp/en/OPseikiLowkeisan.htm
You can enter the part values from that diagram (18000, 1000p, 8200, 470p) and have it calculate and show you the frequency and transient response. You can experiment and see for yourself the effect of changing the values.

4. ## Re: LM358 audio circuit on the Propeller BOE.

Thank you, Phil and Tracy. It takes a magnitude of genius I will always envy (and never attain) to master the linear realm as you have. I will try to make a dent in this new info.

Speaking in general terms, is the Sallen-Key being used over the old RC circuit in order to provide some extra power to run a set of headphones? With the added bonus of a sharper drop-off above the cut-off frequency?

5. ## Re: LM358 audio circuit on the Propeller BOE.

The first Prop Demo board (rev A) used an LC filter for the audio output, a 2.2µH inductor and a 0.22µF capacitor. That simple circuit stood between the Prop pin and the headphone jack. No amplifier chip.

If you run those LC values through the web calculator, the -3dB cutoff frequency comes out at 228kHz. Much above that the response falls off at 40dB per decade and at 10MHz it is down about -70dB. That is a second order response.

If the 30Ω output resistance of the Prop chip is counted in series with the inductor, a series RLC, that lowers the Q factor and the R dominates at low frequencies, so the -3dB frequency is near 24kHz, but the L dominates at high frequencies so at 10MHz the output it is down about the same, -70 dB.

Take out the L, leaving only RC at 30Ω and 0.22µF. The -3dB point is still 24kHz, but at much higher frequencies the drop is only -20dB per decade, and at 10MHz it is down only -50dB. First order response.

The Sallen Key filter on the Prop BOE has (theoretically) a -3 dB frequency of 19kHz, and a second order response that brings it down -110 dB at 10MHz. Wow, but...

There is theoretical vs real. The LM358 has a gain-bandwidth product of 1MHz, and in a x1 gain circuit like that you could expect it to behave ideally in the filter circuit up to about 1MHz/100 = 10kHz. That is a rule of thumb for filter design, that the BWP of the op-amp should be about 100 times the desired cutoff frequency. The LM358 does an okay job, but it won't follow the calculated performance. Actually, the circuit will probably do better, as a low pass, in the sense of not letting through the high frequencies. It would be a different story if you were in need of a high pass filter.

Filters using either inductors or op-amps have issues. Inductors are hardly ideal and have winding capacitance that can feed signal thru, and worse, cause very counterproductive resonances. That is why it is better to choose a small inductor like 2.2µH instead of a larger one that on the surface might seem to give a better stop-band. (I bet Chip gave it the "ear" test!)

Other factors to consider. The output of the op-amp feeds thru a 22 µF blocking capacitor to the load, and that capacitor and the load impedance figure into the analysis. It is one thing to drive a high impedance amplifier input and another to drive a 30Ω (say) headphone. With the op-amp, that is not nearly as important as it is if you are trying to use only an RC or RLC between the Prop pin and the output.

The op-amp in the BOE does provide power to drive the headphone. However, the Prop itself could drive quite a bit of power into a headphone, through a blocking capacitor, as in that rev A demo board. Consider a 30Ω output driving a 30Ω matched load, with a 3.3V peak to peak sine wave. That would be about 50 mW of power right there.

6. ## Re: LM358 audio circuit on the Propeller BOE.

Thank you Tracy for your generous reply! I have a lot to digest.