# Help with a triangle waveform generator

#### Kim Sleep

Joined Nov 6, 2014
38

Take a look at the schematic that I have provided.

If I need only a triangle waveform generator (VIA J3), can I get rid of r2 r8 c4 c5 r6 r11 c2 t1.

Can I also change r4 and r5 to a single 20k resistor, and change R7 to a 100k potentiometer?

I like this circuit as it has (via T2) adjustable output.

Kim

#### k1ng 1337

Joined Sep 11, 2020
915
Most of the components you mentioned have their values chosen specifically because they affect the signal in a precise way relative to the desired frequency. You won't get a clean output if you remove or significantly change the values of those components because each has a passive effect on the circuit.

To understand why, take a look at this simplified version of the circuit. At the output of pin 3 before the capacitors, the signal is a square wave.

Each resistor and capacitor pair after the pin 3 node form a low pass filter. There are three low pass filters in this circuit. As the square wave passes through the first filter stage, the capacitor charges according to the RC constant determined by the component values of the first resistor / cap pair.

You probably know charging a capacitor is an exponential response because voltage lags current in capacitors. This is important because the square wave starts to become curved but at this point the shape of the wave doesn't really have a name. Doing math on the result shows integration (a concept from calculus) has occurred.

The curved signal is then passed through the next low pass filter which integrates it again because voltage lags current in a capacitor. The result is a triangle wave which may seem counterintuitive at first.

Finally, the triangle wave is passed through the last low pass filter which integrates it yet again. The output is a distorted sine wave. More filters can be used to clean up the signal further but there are much better circuits for generating sine waves. The point is to show how an RC network affects a signal. All RC networks are passive but voltage will always lag current through a capacitor. This means the capacitor will be charged exponentially regardless of the input waveform. Therefore, the signal is altered in this progression: Square -> Curved -> Triangle -> Sine.

If you only need the triangle wave from my circuit, you can get rid of the last resistor / cap pair but still need the first two because it is a sequential process. It is also important to note incorrect RC values will likely do nothing to the signal or will attenuate it completely. I recommend starting with the values shown and slowly tweaking them to see what happens on the scope.

Make sense?

Question: Why are the three resistors the same value and the three capacitors the same value? Hint: There are 3 low pass filters in the circuit.

Last edited:

#### Kim Sleep

Joined Nov 6, 2014
38
Thanks K1ng, that is very inciteful. I was wondering why I was not getting a nice clean output

#### crutschow

Joined Mar 14, 2008
34,068
If I need only a triangle waveform generator
That circuit will give a triangle with sides that have an exponential curve.
Is that satisfactory for your purposes?
To get a straight-side triangle, you could use an op amp integrator at the 555 square-wave output.

#### Kim Sleep

Joined Nov 6, 2014
38
A less than perfect waveform is perfectly acceptable

#### k1ng 1337

Joined Sep 11, 2020
915
Here in an LTspice simulation of the circuit I posted. I added the missing connection from pin 4 otherwise it doesn't work.

Notice how the frequency remains the same but each filter stage reduces the peak to peak amplitude of the signal. This is because each RC filter is passive with no amplification factor. If we force the signal through more passive filters, there will eventually be little to no signal left to detect at the output.

#### Kim Sleep

Joined Nov 6, 2014
38
VERY cool, thank you so much. the transistor (Q1 and associated components)can still be used to set the amplitude of the output??

#### k1ng 1337

Joined Sep 11, 2020
915
VERY cool, thank you so much. the transistor (Q1 and associated components)can still be used to set the amplitude of the output??
Q1? I think you are referring to T2. If so, then yes but there will be significant distortion. How much distortion is tolerable is up to you. A better option is to use an opamp with feedback to set your desired gain. A BJT generally has low impedance inputs and outputs meaning it will potentially have a dramatic effect on the rest of the circuit (large currents flow). An opamp on the other hand has high impedance inputs with a low impedance output so your input signal is unaffected by downstream circuitry which becomes a very important consideration for more complex circuits.

I highly recommend learning LTspice as it will save you a lot of headache down the road. It then becomes easy to rule out what definitely does not work if you don't want to do the calculations.