Intro: Using LM386 As an Oscillator.
Most people know the LM386 as a mono amplifier. What may surprise some people is that the LM386 can also be easily converted into an oscillator without any other specific IC's like the common 555 timer chip.
In this Instructable, I'm going to provide a straight-forward schematic and some brief explanations as to how this will work and also some ideas as to what kind of tinkering you can do with this device.
Step 1: Components List
LM386 Amplifying IC
*This resistor can vary between 10k Ohm and 100 k Ohm but other pots (200k or 1M) sound really nice.
470 microFarad Polarized (I prefer something lower than 100 microFarads and I strongly suggest using a 50 microFarad capacitor).
0.01 microFarad non-Polarized)*
*This capacitor can vary between 0.01 microFarads and 0.27 microFarads. I noticed that using a 0.1 microFarad capacitor gets extremely close to a square wave.
8 Ohm Speaker
9 volt Battery
9 volt Connector
Potentiometer (for volume adjustment)
Step 2: Schematic
This requires only a few components.
The LM386 has a built in feedback resistor (1350 K Ohms) to account for the likelihood that you will use a battery for your projects. By connecting Pin 1 and 8 together, you are bypassing this resistor.
Pin 7 doesn't connect anywhere.
Pin 6 connects to the 9 volt battery.
Pin 4 connects to the ground
As seen in the first picture, the Red X's indicate that there is no connection. So Pin 2 and 3 do not connect, and Pin 2 and 4 do not connect. The rest should be pretty straight forward.
The second picture is an earlier schematic. It is the same but has a few more notes. Rt and Ct indicate that these components can vary. By changing these components you can effect the Frequency being generated.
A simple equation (or so I heard) to determine the Frequency in Hertz is (2.5)/(Rt * Ct). Rt will be between 10,000 and 100,000 Ohms.
If R3 (100 Ohm) is left out or removed, you will get a loud squeal so try to avoid that.
Step 3: Things to Try
You can insert a volume knob by placing a Variable Resistor in series with the 8 Ohm Speaker. Keep it less than 500 Ohms. I tried this with a 1k Ohm variable resistor and it didn't really work well.
Replace Rt with a PhotoCell to create a Solar theramin type device.
Switch the 0.01 microFarad capacitor with anything between 0.27 microFarads.
I'm not sure about this but with a 470 microFarad capacitor, I get loud clicks/tapping sounds rather than a tone (maybe I just made a mistake). I fixed this by using much smaller capacitors. I noticed that anything bigger than 100 microFarads sounds like a purring cat but anything smaller sounds like a real tone.
Step 4: Conclusion
With the LM386, I was able to make a tiny solar theramin which I mounted on a 1 inch by 1.5 inch PCB board. I replaced the 8 Ohm speaker with a 1/8 inch headphone jack. I replaced Rt with a Photocell.
The great thing about this is that it doesn't drain the power of a 9 volt battery. With other projects, the 9 volt drained in a day.
Step 5: Square Wave
The previous schematic I posted wasn't exactly a square wave, so I made a few changes and experimented with the sound.
The schematic posted in the images should give you a square wave oscillation.