0
\$\begingroup\$

How can I build a circuit to generate sine waves? What I am working on is building a 555-timer circuit that gives 50% duty cycle square wave, then using a low-pass or band-pass filter tuned to the frequency of the square wave to get a sine wave from the square wave (because square wave consists of infinite number of sine harmonics).

I haven't tested the circuit in the lab but I've used LTSpice to simulate it and the results was acceptable for low frequency (~72 Hz) but bad for high frequency (~72 kHz). I used this guide from Texas Instruments to build the narrow-band band-pass filter: link. Here is the simulated circuit:

and here is the result for frequency of 72 Hz:

and for 72 kHz:

The output of the 555-timer is a square wave with 50% duty cycle as wanted.

How can I improve this design to get better results?

Are there other ways to generate sine waves with controlled frequency? I don't want ready-made ICs that do this. I want to build a circuit.

\$\endgroup\$
9
  • 4
    \$\begingroup\$ Google 'wien bridge oscillator' \$\endgroup\$ Apr 6, 2016 at 19:06
  • 2
    \$\begingroup\$ The opamp you've chosen is old & slooooow. Its slew rate isn't fast enough to give you the result you're expecting at 72kHz. \$\endgroup\$
    – brhans
    Apr 6, 2016 at 19:17
  • \$\begingroup\$ In combination with which, you should be aware that "infinitely many" is only true in a very broad theoretical sense. It only contains harmonics of the base frequency (and noise + reflections/interference), and they extinguish in amplitude the higher they get. \$\endgroup\$
    – Asmyldof
    Apr 6, 2016 at 19:27
  • 3
    \$\begingroup\$ If you want a crappy sinewave: use a faster opamp, use steeper filtering. If you want a good sinewave: use a proper sinewave oscillator like Wouter suggested or a DDS like Sphero suggets. \$\endgroup\$ Apr 6, 2016 at 20:15
  • \$\begingroup\$ the amplitude is too high for starters. \$\endgroup\$
    – user16222
    Apr 6, 2016 at 21:59

3 Answers 3

2
\$\begingroup\$

DDS chip + filter is one way that's pretty common these days.

You can try to round off and then filter triangle waves with diode or active circuits.

At 72kHz, an LC oscillator would not be bad (wind your own high quality inductor or tapped inductor on a pot core if you like) and pair it with quality PPS or other film capacitors.

Or a Wien bridge oscillator.

If you want low distortion with an LC or Wien bridge you need to have a good AGC that controls the output level without adding too much distortion (so it will necessarily take many cycles to stabilize).

\$\endgroup\$
1
  • \$\begingroup\$ Thanks, but I can't understand all of your answer. \$\endgroup\$
    – ammar
    Apr 7, 2016 at 15:21
0
\$\begingroup\$

If you see what looks like a triangle wave from an op-amp circuit you are probablly slew-rate limited.

You need a better op-amp, the LM108 is an aincient part (it's original manufactuerer doesn't even sell it anymore) and the datasheet doesn't even bother to specify important parameters like bandwidth and slew rate.

If you want a decent sinewave by this method you probablly also need more than one stage of filtering.

\$\endgroup\$
0
\$\begingroup\$

V3 looks like it's the wrong way around.

I'd use a low pass filter. There are no harmonics below the fundamental frequency of the square wave! I built one of these once for 1kHz sine out. I used a 6 pole butterworth sallen-key low pass filter which ensured that there was very little 3rd harmonic passed.

Your op amp is saturating because when the fundamental is extracted from the square wave it has an amplitude of 4/pi times the amplitude of the square wave.

If you reduced the amplitude of the 555's output using a potential divider then the low slew rate of the op amp would cope. Once the low amplitude sine wave is created it could then be amplified up if required.

The output of the 555 output amplitude reducing potential divider will have a DC offset and you may need to bias it down to 0V via a capacitor/resistor combination. and then buffer with a unity gain buffer into the filter.

EDIT The vulnerability of a 555 when configured to produce a square wave in that way is that any loading on its output will alter the mark to space ratio away from 50%.

In my design I put a D-type flip flop in toggle mode (Qbar output connected back to D input) in between the 555's output and the amplitude reducing potential divider thereby ensuring an almost perfect 50% duty cycle. Note that this type of toggle configured D-type flip flop divides the 555's output frequency by 2.

Sine Wave Generator

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.