Saturday, January 26, 2013

Metal detector part 2, the LM386

OK, I made some mistakes in the last post, so let's take a step back and revisit parts of it.
Last time I wrote that we wanted a low impedance in the connection between the two oscillators. I also calculated the impedance in that node at 20Hz, since that's the mixed frequency we will listen to when we look for treasure.
Wrong! The frequency we are mixing is around 400kHz, the lower frequency comes in the next node. So we need to make new impedance calculations to match the pull up/pull down network.
But there is more. I did try to connect the two oscillators with large capacitors, but suddenly the two oscillators where oscillating together. What's happened? I'm not completely sure about the mechanism, but having a small impedance at the emitter will load the emitter significantly, compared to the 22k$\Omega$ resistor.  Loading the emitter in the oscillator is bad, since it would remove the small charge injection into the oscillation tank. We need the opposite, just like the original EDN article, which uses 1.2pF capacitors. I found a couple of 2.2pF capacitors, which will do. This gives us
$|Z| = \frac{1}{2 \pi 400\text{kHz} 2.2\text{pF}} = 181\text{k}\Omega$. Pull up/pull down resistors with a parallel resistance of 1.8M$\Omega$ should suffice.
Now comes the next problem. The audio amplifier we are building needs to have a high impedance input, but BJT's are usually hard to design as high very high impedance emitter followers. I asked an experienced colleague about the problem and he suggested that I look in the data sheet of the audio amplifier that EDN use, to see if it shows how the transistors in the IC connected. Great idea!
Look at the data sheet page two. At the inputs (pin 2 and 3) you can see cascaded transistors. Connecting transistors this way is called a Darlington connection and it gives a very high input impedance, ($h_{fe1}\cdot h_{fe2}\cdot R_e$), and a very high gain. This is what we will try out as the first part of our audio amplifier. But now that we are at it, we might as well see if we can understand the rest of the LM386.
The Darlington inputs are connected to a differential amplifier, the two mirrored npn's below the input stage. It amplifies the difference between the two inputs. The diff amplifiers output goes to a push-pull amplifier. This one has a transistor connected to ground (straight below the two diodes), that compensates for temperature induce gain change in the the rest of the amplifier. The lower amplifier stage has a Sziklai connected stage instead of a single transistor. It basically has the same function as the Darlington connection, it gives a higher input impedance and higher gain. If you want to know more about these circuits, I highly recommend reading chapter two of Horowitz & Hill(1989).
By the way, does anyone know what the circle with the arrow, at the top of the diagram, means? My guess would be some kind of diode. In Horowitz & Hill(1989), page 93, there is a resistor in that position.
This is it for now. I'll report back when I have tried the described circuit change and the Darlington emitter follower.

References
Horowitz, P., & Hill, W. (1989). The art of electronics. Cambridge university press.