Maker Pro
Maker Pro

Convert square wave to sine wave

JamesBourne

Sep 26, 2010
6
Joined
Sep 26, 2010
Messages
6
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.
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
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.

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
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
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
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
Next question will be: "Where can I find a MSFS5".
I looked and I couldn't find any from the usual suspects..:(

awww Steve... dont spoil a good plan ;)

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

Dave
 

JamesBourne

Sep 26, 2010
6
Joined
Sep 26, 2010
Messages
6
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.
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
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.


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

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

Dave
 

Militoy

Aug 24, 2010
180
Joined
Aug 24, 2010
Messages
180
I guess its time to ask......

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

Dave

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.
 

JamesBourne

Sep 26, 2010
6
Joined
Sep 26, 2010
Messages
6
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.
 

Attachments

  • sine wave output.JPG
    sine wave output.JPG
    61.8 KB · Views: 13,649

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
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.
 

JamesBourne

Sep 26, 2010
6
Joined
Sep 26, 2010
Messages
6
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.
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
Why I want a sine wave:
A square wave sounds bad when played through earphones. After I filtered it, it sounded much better..

yup of course it does :) a square wave is comprised of many harmonics. ;)


D
 

NickS

Apr 6, 2010
367
Joined
Apr 6, 2010
Messages
367
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.
 

foTONICS

Sep 30, 2011
332
Joined
Sep 30, 2011
Messages
332
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.
how about a tank circuit?
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
Do you realise you've just necroposted in a 5-year old thread?
 
Top