40106 Oscillator Continued

40106 Oscillator Schematic

I left my last post (40106 Triangle Waves) on a bit of a cliff hanger. I had shown how to pull a triangle wave from the circuit and identified some issues with the oscillator as it stood. Today I’d like to go over those issues and how I corrected them to get this oscillator up and running.

I do want to mention the oscillator design above is still in a somewhat rudimentary form. I expect there will be quite a bit of optimization that can be done on it as time goes on.

Buffering

Since we are pulling our outputs directly from the loop which sets the frequency, any elements we add to the circuit which draw current will affect the frequency. This is not ideal. What we need to do is isolate the oscillator circuitry from any further additions to the circuit. For the square wave this is extremely straight forward. Since the signal is binary (digital) we can simply send the output through a second inverter on the 40106 chip. Take note: this will invert the signal (when the original oscillation was high the buffered oscillation will be low) however since this is a repeating signal it won’t cause any impact.

The triangle is slightly more difficult to buffer since we need to concern ourselves with a range of analog values. I accomplished this by feeding the signal through an LM324 op-amp set up as a voltage follower with an additional 10uF capacitor on the output.

Amplification

After the buffering stage I was still left with dramatically different amplitudes for the two wave forms. The square wave after the buffer sat at almost 9V while the triangle was only 1.4V (The output voltage of the LM324). There’s a number of ways you can approach this inconsistency however I found myself somewhat limited by the parts I had on hand and by my decision to run this oscillator on a single 9V battery supply.

How I ended up overcoming this was by using voltage dividers to lower both signals to about 1V peak to peak. From here the selected input is sent into a very basic LM386 power amplifier.

This solution does introduce a large amount of noise into the square wave signal so you may choose to bypass the amplifier with the square wave and only use it on the triangle.

Set up this way I got both signals to reliably output approximately 5Vpp.

Decoupling

One issue I ran into a lot with this circuit, especially building on breadboards was noise. The frequency would bounce around and the wave-forms would not be crisp. This can be largely overcome by adding decoupling capacitors between the negative and positive supply lines. An excellent overview of decoupling (and many other common capacitor uses) can be found over at SparkFun.