# Variable Frequency Op-Amp Astable

#### Xavier Pacheco

Feb 12, 2017
11
I am trying to design an oscillator which ranges from a very low value (near 0) to 2kHz. I found an useful lead which I attach below. However, I am not familiar enough with this circuit so I am not sure about how to calculate and modify the range of this circuit. I would appreciate any leads.

#### duke37

Jan 9, 2011
5,364
It all depends on what you mean by close to zero. Any variable oscillator can not get down to zero.
The way round this is to have two oscillators, running at slightly different frequencies and then mixing the two and running through a low pass filter to select the difference frequency. This is the principle of the Theremin.
If you use 10kHz or 100kHz then the filtering will be easy to pass 2kHz.

#### AnalogKid

Jun 10, 2015
2,842
Note - for this analysis we assume that the LM324 output voltage range is 0 V to 9 V. It makes the arithmetic much less cluttered.

This is a Schmitt Trigger astable. R1 and R2 set the basic trip point at 4.5 V (Vcc/2). Hysteresis added by R3. This creates two distinct trip points, one with R3 in parallel with R1 (Vhigh) and one with R3 in parallel with R2 (Vlow).

One cycle goes like this: Assume the output has just snapped up high. VR1 charges up C1 from tVlow to Vhigh. When Vout exceeds Vhigh, the output snaps low and VR1 discharges C1 from Vhigh to Vlow. The sum of those two times is the output period, and the inverse of that is the frequency. If you know Ohm's Las and the RC time constant equation, you can calculate everything.

Note - 1 Hz to 2 kHz is a 2000:1 frequency range. With a single-turn pot for VR1, the adjustability (ability to select a specific frequency) will be very low.

ak

#### OBW0549

Jul 5, 2016
157
...I am not familiar enough with this circuit so I am not sure about how to calculate and modify the range of this circuit. I would appreciate any leads.

Your reference gives the formula for calculating frequency as a function of the timing resistor/capacitor combination, with resistance in ohms and capacitance in farads. Scroll down to the formulas shown alongside Fig. 4.2.4.

As @AnalogKid noted, you're going to have a hard time getting a large frequency adjustment range using a variable resistor; the resolution and repeatability at high frequency will be very poor.

#### Xavier Pacheco

Feb 12, 2017
11
Note - for this analysis we assume that the LM324 output voltage range is 0 V to 9 V. It makes the arithmetic much less cluttered.

This is a Schmitt Trigger astable. R1 and R2 set the basic trip point at 4.5 V (Vcc/2). Hysteresis added by R3. This creates two distinct trip points, one with R3 in parallel with R1 (Vhigh) and one with R3 in parallel with R2 (Vlow).

One cycle goes like this: Assume the output has just snapped up high. VR1 charges up C1 from tVlow to Vhigh. When Vout exceeds Vhigh, the output snaps low and VR1 discharges C1 from Vhigh to Vlow. The sum of those two times is the output period, and the inverse of that is the frequency. If you know Ohm's Las and the RC time constant equation, you can calculate everything.

Note - 1 Hz to 2 kHz is a 2000:1 frequency range. With a single-turn pot for VR1, the adjustability (ability to select a specific frequency) will be very low.

ak

So if assemble the exact circuit as shown and I use a trimmer instead of common potentiometer, would I have a reasonable range of frequency?

#### Arouse1973

Dec 18, 2013
5,178
The use of a multi turn POT for VR1 will help with the selection of a specific frequency, how well? You will have to try it.
Thanks

#### OBW0549

Jul 5, 2016
157
So if assemble the exact circuit as shown and I use a trimmer instead of common potentiometer, would I have a reasonable range of frequency?
This is something you can easily predict. You don't even need a calculator, or a pencil and paper; you can do it in your head.

Imagine you have a 100 kΩ, 10-turn trimmer for VR1, connected so that at full counterclockwise rotation you have maximum resistance and therefore minimum frequency. Call that frequency Fmin. At full clockwise rotation you have maximum frequency (whatever that turns out to be; for this circuit, it's undefined).

Starting at full counterclockwise, and Fmin, you have to rotate the trimmer 9 full turns clockwise to get it down to 1/10th its full resistance, and therefore obtain a frequency of 10 * Fmin. The next 0.9 turn clockwise gets you to 100 * Fmin, and the next 0.09 turn after that gets you to 1000 * Fmin, and so forth.

As you can see, as you go higher and higher in frequency it becomes more and more difficult to set a precise frequency, to a point where moving the trimmer just the tiniest amount results in a drastic, uncontrollable frequency change.

So the practicality of this scheme is going to depend partly on what you consider a "reasonable" frequency range, and partly on how much annoyance you're willing to endure when working with high frequencies and attempting to set them precisely.

#### TCSC47

Mar 7, 2016
125
XP, you have chosen an excellent circuit to produce a square wave out. The next step is to knock it up on a prototype board and experiment with it and see that the equations given in the article you reference, actually work. (They will by the way.) You will need access to an oscilloscope to view the waveforms and measure the frequency you produce. Good luck.

#### CDRIVE

##### Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Rotary switches aren't as common as they once were but you can still get them. That said I used a SPDTCO switch to provide a method of dividing your frequency range into 3 switch positions. When the switch is Off (center position) only C1 is in the circuit. This will be your highest freq range. In the other two (ON) positions either C2 or C3 is placed in parallel with C1. Parallel capacitors are additive. Since with 3 ranges you don't have to rely on VR1 to handle your entire freq range I added a padding resistor too. This resistor will aid in making VR1 adjustments far less touchy.

Chris

#### CDRIVE

##### Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
After further thought this would be a preferable design. VR1's value is ~ 10 times > than VR1 but it could be a much higher resistance ratio if you like. Even a 100:1. You'll can play with these values to find what you like.

Chris

#### CDRIVE

##### Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Better yet add a fixed resistor so Rx is never zero when either Pot is at minimum.

Chris

.

Replies
1
Views
899
Replies
2
Views
2K
Replies
77
Views
11K
Replies
4
Views
929
Replies
0
Views
962