Low Cost, 16Hz - 100kHz Sine-wave Generator circuit

9,439

Circuit Image

Building a signal generator is an essential project for any analog DIY enthusiast. While already possessing a bench signal generator, the intention was to create a compact, battery-powered device for quickly testing new effect designs. An enclosure from a previous project was also available for this purpose. Constructing a sine wave oscillator is straightforward; however, creating a low distortion sine wave oscillator that can operate over a wide frequency range is more complex. Although ready-made function generator ICs like the ICL8038 or XR2206 could be utilized, the preference was to design a circuit using generic components that are widely accessible. The resulting circuit demonstrates exceptional performance, achieving less than 0.1% total harmonic distortion plus noise (THD+N) in higher frequency ranges. A Wein bridge oscillator serves as the logical choice for generating a wide range of sine waves. The oscillator operates by applying positive feedback around a gain block using a simple RC-CR band-pass filter, oscillating at its center frequency where the filter's gain is maximized. The center frequency, and thus the oscillation frequency, can be adjusted by varying the resistors and/or capacitors, typically achieved with a dual-gang potentiometer for the resistors in the Wein network, allowing smooth frequency control across one decade. Accessing other decades involves switching in different capacitor pairs, each scaled by an order of ten. However, standard dual-gang pots are often bulky, costly, and poorly matched, prompting the search for alternatives. The amplifier's gain must precisely counterbalance the Wein bridge network's gain at the center frequency to maintain an oscillation loop gain of exactly one, ensuring no distortion. The Wein network has a center gain of 1/3, necessitating an amplifier gain of 3, achievable through a negative feedback network akin to any non-inverting operational amplifier circuit. Automatic adjustment of the negative feedback is critical for maintaining this condition under varying circumstances, implemented in the circuit using a combination of an LED and a light-dependent resistor (LDR) sealed from external light. The schematic indicates that a 9V power supply is provided by either a battery or a mains adapter, with D3 offering polarity protection. A potential divider formed by R10 and R11 generates a mid-rail voltage, buffered by U2B, effectively creating a bipolar supply from a unipolar source, similar to most effects pedals. U1b plays a crucial role by eliminating the necessity for a dual-gang potentiometer. As only one resistance in the Wein network is adjusted, reducing this resistance decreases the gain of the network. Consequently, the primary amplifier U2a must increase its gain (reduce negative feedback) to sustain oscillation. U2a functions as a current-to-voltage converter, transforming the current flowing through the variable arm of the Wein network into a voltage applied to R2, part of the negative feedback network. This configuration effectively creates a current-controlled resistor. As the frequency potentiometer is decreased, increased current flows through it, which is converted into a larger signal by U1b, resulting in more current flowing through R2, effectively reducing its value. This action diminishes negative feedback, which is essential for maintaining oscillation. The gain of U2a is optically controlled by U1a.

The circuit design emphasizes the importance of using readily available components, ensuring accessibility for enthusiasts in various regions. The choice of a Wein bridge oscillator is particularly beneficial due to its inherent stability and low distortion characteristics, making it suitable for audio applications. The integration of feedback mechanisms using optical components enhances the circuit's adaptability and performance, allowing for precise frequency control without the drawbacks associated with traditional dual-gang potentiometers. The thoughtful arrangement of components and the innovative use of feedback ensure that the circuit not only meets the desired specifications but also remains user-friendly for those engaged in DIY electronics projects. Overall, this signal generator design exemplifies the principles of analog electronics while providing a practical solution for testing and developing audio effects.Building your own signal generator is a rite of passage for any analog DIYer, but it`s one I took a long time to get around to. I already have a bench signal generator, but I decided it would be useful to have a small battery powered device that I could quickly test new effects designs with.

Plus I had an enclosure from a failed project that reall

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

🔗 External reference