# How to Build a Square-to-Sine Wave Converter Circuit

In this project, we will show how to build a square wave to sine wave converter.

To do so, we simply need resistors and capacitors- nothing else. Using RC networks, we can reshape a square wave into a sine wave.

A circuit is like this can be very important because sine waves are used often in many different areas of electronics such as acoustics, mathematical operations, and many times even as a source of power. So sine waves are used often. Even though they are less used than square waves especially in digital electronics, many times they are still needed. Therefore, it's good to know how to convert a square wave to a sine wave. And this can be accomplished rather easily with just resistors and capacitors.

In fact, to build this circuit, we need 3 RC networks. Each RC network is comprised of 1 resistor and 1 capacitor. So a total of 3 resistors and 3 capacitors are needed for this circuit.

Even though this circuit is very basic in that it only requires 4 resistors and 4 capacitors, it does contain some complexity in regard to the values of the resistors and more importantly the capacitors in regard to the frequency of the input signal.

The capacitor values that we choose for the circuit is based off the frequency of the input square wave signal. If the capacitor value isn't appropriate for the frequency of the square wave signal, the circuit will not work. So capacitor values must be chosen. If not, the same square wave signal that we feed into the circuit will be output, meaning the capacitors had no effect on the signal because the value of them are out of the frequency range. We will go over the frequency of the signal and the capacitor values needed in more detail below.

For this circuit, we will input a 10KHz signal. So this circuit, with the given value capacitors given below,
will work square wave signals at or near 10KHz.

Components Needed

- 3 1.5KΩ resistors
- 3 10nF ceramic capacitors

All we need to build this circuit is a square waveform and a few resistors and capacitors.

The square waveform can be generated from a number of sources, including a function generator or a circuit that can produce square waves such as
this 555 timer clock circuit.

### Square-to-Sine Wave Converter Circuit

The square-to-sine wave generator circuit that we will build with only resistors and capacitors is shown below.

The breadboard circuit of the circuit above is shown below.

So our input signal to the circuit is a square wave.

We then have our first RC network, composed of a resistor and capacitor. The first resistor and capacitor creates the classic capacitor charging and discharging waveform.
Being that the voltage across the capacitor, VC= VIN(1 - e^{-t/RC}), the voltage across
the capacitor charges up exponentially and discharges exponentially. Therefore, the waveform, upon charging is a parabolic-shaped
exponential waveform upside down. The same way the capacitor charges up exponentially, it discharges exponentially. Therefore,
when the capacitor is discharging, you see a parabolic-shaped exponential waveform right side up. So this is the waveform that you will see after the first RC network.

After the first RC network, we then have our second RC network. This RC network takes the exponential waveform and converts it into a triangle waveform. It straightens out the parabolic exponential waveforms so that they appear as a straight ascending slope on the charging side and straight descending slope on the discharging side. The result is a triangle.

Just like with the first capacitor, the second capacitor charges and discharges, charges and discharges, over and over again. The result is continous never-ending oscillations of triangle waveforms.

The third RC network then shapes the triangle waves, smoothing out the straightness of them and making them more curved. So instead of just the straight upward and straight downward slopes, the slopes are more curved as a sine wave would be. This shapes the wave into a more sine-wave-like waveform. wave. So after the 3rd RC network, the output waveform pretty much identifies as a sine wave.

And this is all that is needed to convert square waves into sine waves.

Using RC network, resistors and capacitors, is enough to shape square waveforms into several different shapes, including triangle waves and sine waves.

Now regarding adjustments or modifications that can be made into the circuit; this includes changing the frequency of the waveform and/or the amplitude.

So, as stated above, changing the frequency of the input waveform, which in turn, changes the frequency of the output sine waveform can be a sticky thing. Different-value capacitors respond to different frequencies, so what capacitors may work for one frequency may not work for another frequency. If you do not choose the right value capacitor for the frequency used, the circuit will not work. It flat out will not work. Depending on what frequency you use, the values of the capacitors needed to be carefully chosen.

For this circuit, the 10KHz frequency and frequency values close to this work very well with the values given above, which are 1.5KΩ resistors and 10nF capacitors.

However, if you vary greatly from this frequency, like by a few KHz and especially as you vary farther than this, the capacitor values will most likely need to be changed in order to produce sine waveforms as output.

If the correct values are not chosen and are way out of the frequency range, the output waveform will be the same exact square wave, as is input into the circuit, except attenuated a bit due to the resistors. The waveform will be unchanged because the capacitors have no reactance to the voltage due to the frequency level. If the capacitor still has some reactance due to the signal but is still out of the frequency range, you may get a very poorly formed sine waveform. Therefore, it's very important to choose correct levels.

If you're willing to play around with values, you will know that the capacitors work for the given frequency if you see a sine waveform from the fourth capacitor. If you do not, then you can be sure that the capacitor values need to be changed. If the output waveform is a perfect square wave, then you can be sure that the capacitor values are completely out of range for the frequency of the signal. If you see a poorly formed sine wave, the capacitor value is slightly out of range. Either adjust its value or adjust the frequency.

When swapping out the capacitor values, change all 4 capacitors values at once. You want to use the same value capacitors for all the capacitors. This is because if one capacitor works at that frequency, the other will also work at that frequency. If you choose different value capacitors, then one capacitor may work with that frequency, while the other may not. So, in the end, you may get mixed-reactive capacitors and a poorly defined waveform. To fix this problem, use the same value for both capacitors.

The rule of thumb for choosing capacitors is that for low frequencies, higher value capacitors are needed. For high frequencies, lower value capacitors are needed. So for really high frequencies, you may use capacitors in the order of picofarads. For really low frequencies, you may use hundreds of nanofarads, or even units of microfarads. This may require some trial and error and testing with building the circuit and checking the waveform on an oscilloscope.

As far as adjusting the amplitude, this just requires feeding a larger square wave into the circuit to increase the amplitude. Or feeding a smaller square wave into the circuit to decrease the amplitude.

And this is about all that can be done for building and adjusting this square-to-sine wave converter circuit.

And this is how a sine wave generator circuit can be built with a few simple components if we already have a square wave.

To see how this circuit works in real life, please see the video below.

Related Resources

How to Build a Square-to-Triangle Wave Converter Circuit

How to Build a Triangle to Sine Wave Converter Circuit

How to Build an Adjustable Square Wave Generator Circuit with a
555 Timer

How to Build a Sine Wave Generator Ciruit with a Single Transistor

How to Build a Sine Wave Generator Circuit with a 555 Timer

How to Build a Triangle Wave Generator Circuit with a 555 Timer

How to Build a Clock Circuit with a 555 timer

How to Build an Astable Multivibrator Circuit with Transistors

How to Build a Multivibrator Circuit with a 4047 chip (for astable mode operation)

How to Build a Voltage-Controlled Oscillator Circuit with a 4046 Chip

How to Build an Oscillator Circuit with a 7414 Schmitt Trigger Inverter Chip

How to Build a Ramp Generator with Transistors

How to Build a Voltage-controlled Oscillator with a 555 Timer Chip