Make It Better Sine Wave Generator - Page 1
Forum section: electronics / projects

author: Majorassburn
author_rank: Regular Contributor
timestamp: March 15, 2024, 08:54:06 pm
content: Attached is a schematic of a 100Hz sine wave generator. Can you suggest ways to make it better?Must Haves:1) 0-6VACrms out into 1Meg resistive load.2) +/- 12VDC Regulated Power Supply input.3) Minimum component count with low-cost off-the-shelf components.No need for temperature compensation or amplitude stabilization, AGC, etc.Simply a hobby-grade sine wave generator.The obsolete but still available 4047 chip is preferred because of its precise square wave generation which will also feed another device, not part of this schematic.All resistors are 1% metal film, values are hypothetical and up for grabs/suggestions.Thanks for looking!

author: soldar
author_rank: Super Contributor
timestamp: March 15, 2024, 09:18:54 pm
content: I would not call that a "phase shift oscillator". It is a 4047 astable generating a square wave and then a filter to remove the higher frequencies. There is no phase shift feedback.

author: Gyro
author_rank: Super Contributor
timestamp: March 15, 2024, 09:26:38 pm
content: I don't know how much distortion will make it through your filter network, but using an LM358 isn't going to do you any favors.

author: fourfathom
author_rank: Super Contributor
timestamp: March 15, 2024, 10:25:44 pm
content: There are much better low-pass filter designs, but even using that string of RC sections you aren't getting much filtering. This is because each 10K resistor loads the previous stage and causes the ultimate rolloff to be much less steep than you probably are assuming.One simple change is to have the first series resistor be 100 Ohm, followed by a 1K, 10K, 100K resistor, with the capacitor values adjusted appropriately. You don't need that resistor currently connected to the opamp input.You can do still better with an active-filter design, using (more or less) the same number of Rs and Cs,As mentioned, the LM358 has significant crossover distortion, but this can be eliminated or at least reduced by putting a load resistor from output to the negative power pin. This turns it into a class-A amp.

author: Ground_Loop
author_rank: Frequent Contributor
timestamp: March 15, 2024, 10:31:13 pm
content: This would probably work better and be MUCH simpler.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 15, 2024, 10:33:14 pm
content: Quote from: Majorassburn on March 15, 2024, 08:54:06 pmThese are a phase shift oscillatorshttps://resources.system-analysis.cadence.com/blog/msa2020-rc-phase-shift-oscillator-design-for-sine-wave-generationYou have drawn a low pass filter.Addit: The Wein bridge oscillator is also a phase shift oscillator, it uses lead/lag cancellation and can use a lower gain than the 3 stage ones above.Quote from: Majorassburn on March 15, 2024, 08:54:06 pmAll Analog Oscillators need some form of amplitude control, but there are trade off solutions simpler than full analog AGC.Diodes or LEDs to change the slope gain give 'soft clipping' and easier filtering.If you want precise 100Hz, and available, you could look at HC4060 / 74AHC1G42xx parts, with a crystal or ceramic resonator.Do you want to vary the frequency ?This paper gives a low cost counter and resistor DAC for sine generation The Davies Sinusoidal Generatorhttps://www.ti.com/lit/pdf/sboa550frequency is CLK/16 and harmonics below the clock can be quite low.Or, you can go to DDS chips, if you want very wide dynamic range, tho those need more Sw support.Quote from: Majorassburn on March 15, 2024, 08:54:06 pmIf you want just 100Hz, you can make the first opamp an integrator, and tune it for symmetric slight clipping, to give a flat tops triangle wave.That is much closer to a sine that a raw square wave, so the following filter has a lot less work to do, and a better sine results.

author: Majorassburn
author_rank: Regular Contributor
timestamp: March 16, 2024, 12:24:00 am
content: What a GREAT forum. The suggestions here are priceless. THANK YOU.Here's a revision to the original....Fixed 100Hz is fine. Cap at 4047 output is needed for level shift.I just realized that I can delete filters and create a second integrator to shape the triangle into a sine wave. What do you think about that vs. the filters?If anyone can simulate circuits and insert RC values, much appreciated.Comments & suggestions? Thanks in advance.

author: themadhippy
author_rank: Super Contributor
timestamp: March 16, 2024, 01:32:15 am
content: Quotewot something like thishttps://tinyurl.com/2ddf3sfh

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 16, 2024, 05:36:14 am
content: Quote from: Majorassburn on March 16, 2024, 12:24:00 amThe first integrator from square to clamped triangle, buys you a lot as it acts as both a LPFand a shaper,which makes the filters job easier.Another integrator is a bit wasted as you are better to use that opamp as a peaked filter (as below)Some spice runs found ( as expected) thatthere is an ideal clamping width for the triangleto then give best sine from a filter. About 16.29% each flat / period.330k, 4n7 => -69.555dB355k.4n7 => -79.074dB (flat = 1.655ms)357.5k,4n7 => -79.233dB (flat = 1.629ms)360k, 4n7 => -77.045dB365k,4n7 => -74.616dB (flat = 1.566ms)390K,4n7 => -66.557dB (flat = 1.325ms)410k,4.7n => -63.445dB (flat = 1.145ms)Because you want a single frequency, you can also make the LPF a little bit peaky, the circuit below has a gain of 22x peaked at 100HzSee circuit and clipped triangle and the sine resulting. -79dB is close to 0.01%Caps are all chosen to be the same value, and should be low loss, precision, high stability. 1%, NPO, 30ppm for example.A crusty LM324 will not clip symmetrically, so you may need a better rail-rail output opamp.The clipping rails should be clean, as they become part of the signal.

author: NiHaoMike
author_rank: Super Contributor
timestamp: March 16, 2024, 02:39:46 pm
content: Microcontroller programmed to operate as a DDS with output using PWM or internal DAC, filter that and amplify with an opamp.

author: Terry Bites
author_rank: Super Contributor
timestamp: March 16, 2024, 03:23:54 pm
content: I smell ancient fusty elektor.There are far better ways of generating a sine wave but you could improve your circuit.A single supply version can be made. That's often convenient.The same number of opamps can be turned into a very effective filter with gain.Tryhttps://tools.analog.com/en/filterwizard/

author: dobsonr741
author_rank: Frequent Contributor
timestamp: March 16, 2024, 04:44:59 pm
content: This is possibly the simplest wien bridge oscillator, with at least a little bit of amplitude control. Without the diodes the startup will be spotty, or goes into distorted sine. Raise your rails from +/- 2.5V to +/- 12V.