y needed to be put to good use. Building a sine wave oscillator is easy. Building a low distortion sine wave oscllator is less easy, and building one that can also be varied over a wide range is harder still. I could have used a ready made function generator IC like the ICL8038 or XR2206, but that seemed like cheating.
Plus those parts may be difficult to find in some parts of the world, and have a clouded future, and I wanted to create something using generic parts that anyone could build. The final circuit performs remarkably well, with less than 0. 1% THD+N in the upper ranges. The logical choice for a wide range sine wave oscillator is a Wein bridge, as shown in the image on the right.
This works by applying positive feedback around a gain block using a simple RC-CR band-pass filter. The circuit will oscillate at its centre frequency where the filter`s gain (and therefore the loop gain) is highest. If the two resistors and two capacitors are the same then this occurs at a frequency of: The centre frequency -and therefore the frequency of oscilation- can be varied by altering R and/or C, and this is usually accomplished by using a dual-gang pot for the resistors in the Wein network.
This allows smooth control over the frequency for about one decade. Other decades are accessed by switching in different pairs of capacitors, each ten times larger/smaller than the last. However, ordinary dual gang pots are rather bulky, fairly expensive, and poorly matched, so I wanted to avoid them.
Ideally the gain of the amplifier needs to be the exact inverse of the gain of the Wein bridge network at the centre frequency. If this condition is met, the loop gain will be exactly 1; just enough to maintain oscillation with no distortion.
Some simple algebra shows that the Wein network has a centre gain of 1/3, so the amplifier needs a gain of 1/(1/3)= 3. This can be set by a negative feedback network just like any non-inverting opamp circuit. However, in practice we need some kind of automatic adjustment of the negative feedback to maintain this condition under all circumstances.
In my circuit this is controlled by an LED and LDR combo. These components need to be mounted facing one another and sealed from exturnal light- heatshrink tube is an old favourite for this. Looking at the schematic, 9V is supplied either by a battery or a mains adapter. D3 provides polarity protection. R10+R11 form a potential divider that produces a voltage mid-way between the rails, and this is buffered by U2B, effectively creating a bipolar supply from unipolar one, just like in most effects pedals.
U1b does the interesting bit by overcoming the need for a dual-gang pot. Because only one resistance in the Wein network is varied, the smaller this resistance becomes the low the gain of the Wein network becomes. The main amplifier U2a therefore needs more gain (less negative feedback) to compensate and maintain oscillation.
U2a works as a current-to-voltage converter, taking the current flowing in the variable arm of the Wein network and converting it into a voltage that is applied to R2, which is part of the negative feedback network. This stage is therefore bootstrapping R2, effectiely creating a current controlled resistor. As the frequency pot is reduced in value, more current flows in it, which is converetd to a larger signal by U1b which in turn makes more current flow in R2, making R2 seem smaller in value.
This reduces the negative feedback, which is exactly what we needed. The gain of U2a is itself controlled optically by U1a (see below). All this does