Connect with us

Convert square wave to sine wave

Discussion in 'General Electronics Discussion' started by JamesBourne, Sep 27, 2010.

Scroll to continue with content
  1. JamesBourne

    JamesBourne

    6
    0
    Sep 26, 2010
    Hi everyone,

    I am building a circuit that will produce a sine wave as output.

    I am using a 555 timer (astable) to create a frequency of 140Hz. This produces a square wave with an amplitude of about +5V.
    Note that voltage is 0V and +5V (not -5V and +5V).

    My problem is that I do not know how to turn the square wave into a sine wave.
    I have read on various sites that you can use capacitors and inductors to filter
    the signal to produce a sine wave, but calculations and explanations are nowhere to be found.

    Please help.
     
  2. davenn

    davenn Moderator

    13,589
    1,872
    Sep 5, 2009
    About the best i could find was on this site....
    http://electronicdesign.com/article...-circuit-converts-square-waves-to-sine-w.aspx

    there's a reasonable explanation of the cct. for your purposes you dont need the left hand part of the cct the RDD104 chip and 1MHz xtal osc. just feed you 555 timer output into the 10nF capacitor and let U2 do its thing :)

    cheers
    Dave
     
  3. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,387
    2,773
    Jan 21, 2010
    Next question will be: "Where can I find a MSFS5".

    I looked and I couldn't find any from the usual suspects..:(

    Another option might be a very narrow band pass filter

    Here is a cunningly useful PDF
     
  4. davenn

    davenn Moderator

    13,589
    1,872
    Sep 5, 2009
    awww Steve... dont spoil a good plan ;)

    But agreed nor could I, I wonder where the cct originator got the IC from ?

    Dave
     
  5. JamesBourne

    JamesBourne

    6
    0
    Sep 26, 2010
    Would it be possible to convert the square wave using analog components (possibly an inductor)? If so, how would you calculate the component values?

    Note: I would have used an op-amp or something else instead of the 555IC if I could, but the circuit needs to run from batteries.
     
  6. davenn

    davenn Moderator

    13,589
    1,872
    Sep 5, 2009

    I guess its time to ask......

    why dont you just produce a 140Hz sine wave for a start ??

    Dave
     
  7. Militoy

    Militoy

    180
    0
    Aug 24, 2010
    That's a very good question. One good reason to start out with a sine oscillation, or to stick with an active filter instead of a passive one, is the size of the components to make up a bandpass filter way down at 140 Hz. I put together a quick, simple "meatball" solution - and ran it on LTSpice. It doesn't give a perfect sine - but pretty close. From the input side - I wound up with a 10 mH inductor in series with a 47 uF cap and a 20 ohm resistor. Then across the line after that, I have a 10 mH inductor in parallel with a 100 uF cap. In series with the cap, I added a 2 ohm resistor for de-queuing. Those numbers haven't been optimized - but you can see for just shaping a low-power signal - you're going to be using up significant real estate if you go with a passive solution.
     
  8. JamesBourne

    JamesBourne

    6
    0
    Sep 26, 2010
    After a bit of reading and experimentation I managed to get a good sine wave using a 3 pole RC filter. (See attached photo)
    In response to Dave's question, I'm using a 555 timer to get an accurate frequency of 140Hz and will rather filter the square wave than generate a sine wave from scratch.

    Thanks for your help.
     

    Attached Files:

  9. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,387
    2,773
    Jan 21, 2010
    Silly question, but why do you want a sine wave?

    Have you considered a simple oscillator made from a Schmitt trigger inverter, a resistor and a capacitor in place of the 555? It will operate from a lower power supply and use less power.
     
  10. JamesBourne

    JamesBourne

    6
    0
    Sep 26, 2010
    Why I want a sine wave:
    A square wave sounds bad when played through earphones. After I filtered it, it sounded much better.

    After searching the internet, I have found a 555 CMOS which requires a very low supply voltage (2V). The circuit will run from a rechargeable battery (one gotten from those shake torches) to make it portable. Unfortunately the maximum voltage is 3.6V and drops to 2V after some hours of usage, which makes standard digital IC's unsuitable.

    Luckily this chip draws extremely low current and voltage which is really good for the battery life (40mAh). All that's left to do now is to test and tweak it on the breadboard and to build the circuit.

    Thanks for your help.
     
  11. davenn

    davenn Moderator

    13,589
    1,872
    Sep 5, 2009
    yup of course it does :) a square wave is comprised of many harmonics. ;)


    D
     
  12. NickS

    NickS

    367
    0
    Apr 6, 2010
    I am late to this party but its interesting so I would like to throw some stuff at it anyway.

    1: I love filtering with op amps filters at low frequencies because
    a) The parts are much much smaller.
    b) You don't have to use a coil with bad Q(high loss),
    c) Just changing resistors can buy you have so many options(topology/gain).
    Look at TI they make a free active filter calc tool that rocks.

    2: If its for audio then I hope you didn't already ruin your headphones. Square wave signals have a bad habit of destroying cones.

    3: If you wanted a simple solution for multiple tones. You could build a clapp oscillator and pull the frequency around with a variable inductor. But it will drift slightly with temperature.
     
  13. foTONICS

    foTONICS

    332
    9
    Sep 30, 2011
    how about a tank circuit?
     
  14. Alec_t

    Alec_t

    2,824
    756
    Jul 7, 2015
    Do you realise you've just necroposted in a 5-year old thread?
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-