Introduction: How to Design a Square or Triangle Wave Oscillator From a 555-Timer Integrated Circuit

Picture of How to Design a Square or Triangle Wave Oscillator From a 555-Timer Integrated Circuit

Target Audience
This is intended for anyone who wants to simply and cheaply make a generator for a square, triangle or blended waveform that can be frequency and amplitude adjustable. I expect that this audience is primarily constituted of audio enthusiast who want a base for a synth and beginner electronic hobbyist who want a clock pulse for a digital chip or clock.

Difficulty Level
If you have no experience with circuits, this will be challenging, and hopefully a learning experience. If the schematic below looks simple, this will be easy.

Things You Will Need
-One ‘555’ integrated circuit (I used a lm555, the ne555 is in the LTspice default library under misc and functions the exact same)
Datasheet
You can buy one from DigiKey for 45 cents

-One TLV272 or similar rail-to-rail
Datasheet
They cost 41 cents at DigiKey

-Either
1. Batteries with a combined voltage of 5-12 volts and a module to hold them.
OR 2. A DC voltage source between 5 and 12 volts, such as an old cell phone charger.

-Three potentiometers
(These are required if you want the frequency, amplitude, or triangle wave-shape to be adjustable. If you do not, they can be substituted by resistors).
The cheapest ones are 65 cents
These logarithmic versions are scaled better for audio applicationst

-Resistors (values to be decided below)
-Capacitors (values to be decided below)

-LTspice or similar spice program to simulate the circuit.
My schematic is in LTspice

-Either
1. A breadboard and wires to use it
OR 2. A perfboard, soldering iron, solder, 2 8-pin IC sockets, at least one foot of wire, and the basic tools to cut and strip it.
OR 3. A perfboard, a wire-wrapping tool, wire at the necessary gauge for the tool, and tools to cut and strip the wire.

Tips and Warnings
-Solder often contains lead. Wash your hands after handling it and try to not inhale the fumes while soldering.
-Soldering irons are very, very hot, some reach 900 degrees.
-Solder the sockets and then add the chips. The heat can damage the IC’s.
-Swapping the power and ground inputs can destroy the IC’s internal parts, so don’t do that.
-Start with the volume at a minimum and turn it up until it is at a good level. This oscillator uses voltages high enough to blow the drivers on any headphones.
-If you use this signal generator with a low-impedance load, make sure to run the outputs through a voltage follower that can handle the currents that your load will draw. The TLV272 has two OpAmps on the chip; the other one can be used as the voltage follower if one is needed. Meaning you just need to look up what a voltage follower is, and connect the other side of the chip accordingly.


Detailed explanation of the 555-timer integrated circuits used as an oscillator is here.

Step 1: Decide the Range of Frequencies and Output Voltages That You Want From the Signal Generator.

This design supports a maximum output voltage of 12 Volts peak-to-peak.
Use a DC power supply with a voltage greater than or equal to the maximum peak to peak output voltage that you want.
The power supply must be between 5 and 12 Volts for the chips to work.

The TLV272 used in this design has a maximum frequency response around 3MHz, if you just want a higher frequency oscillator consider using a ceramic resonator or crystal oscillator instead of this design.

Step 2: Determine What Component Values You Need for the Frequency/frequencies You Want.

To do this, select a capacitor value for C2 and use a potentiometer for R2 that you already have or can obtain, capacitors are only made at certain discrete values. Use this equations to solve for the resistance value of R1.
R1 = [1.44/(Frequency * C2)] – 2*R2
The potentiometer will be R2. Use the lowest frequency you want from this device and the maximum potentiometer resistance for R2. Turning down the resistance of R2 will produce higher frequencies, limited by the resistance of R1. R1 cannot be significantly larger than R2 or the duty cycle of the output square wave may be less than 50%, which will distort your wave’s frequency content. Compute the max frequency using R2 = R1 for your computed R1 value.
Frequency = 1.44/[(R1 + 2*R2) * C2]
If this frequency is not as high as you would like, then use a smaller capacitor for C2 and start over. Your numbers don’t need to be perfect as long as your range is large enough as the frequency can be adjusted to anywhere in the range via the potentiometer. If you are using a regular resistor for R2, then you shouldn’t demand perfection from this design as resistor values in the real world are rarely exactly what they say they are.
Help reading resistor values
Help reading capacitor values

Step 3: Choose the Resistor Values You Will Use for the Amplifier.

Picture of Choose the Resistor Values You Will Use for the Amplifier.

The output of the 555 chip is a square wave with a high output voltage at the chip's supply voltage and a low voltage at the chip's ground. It is ready to be used as a clock pulse for digital chips.

For other applications the output voltage is adjusted by an opamp.
The given equation works with Vout as the maximum output voltage, Vin as the power supply voltage, and R4 is the max resistance of a potentiometer or the resistance of a resistor if you only need one output voltage. Use it to determine the resistance of R3.

More info on this can be found on Wikipedia

Step 4: Select Values for R5, R6, C1, and C6.

Use equal value resistors for R5 and R6 so the voltage is halfway between power and ground. They inherently drain power whenever the generator is plugged, but the power lost can be reduced by using larger value resistors. Use as large resistance resistors as possible, 1 Mohm or higher is recommended. If you are Gangsta with circuits, you can use transistor to create a reference voltage instead.

The values of C6 and C1 do not matter as long as they are there. If you are using a shaky power supply, then C6 should be as large as possible to ensure stable operation.

Step 5: Design the Low-pass Filter If You Want a Triangle Wave Output.

Select R7 and C3 such that the frequency you will be using is significantly lower than 1/(2*pi*R7*C3). This equation is for the filter’s cutoff frequency.
If you are using a variable frequency then it is very highly recommended that you use a potentiometer for R7. Use the highest resistance of the potentiometer and the highest operating frequency.
If you are using a relatively high operating frequency relative to the cutoff frequency, then the wave will be a blended shape, similar to a shark fin. By adjusting the potentiometer, you should be able to get any wave shape between square and triangle with this output.

Step 6: Test the Generator in LTspice to Make Sure It Does What You Want.

Save the TLV 272 asy file to your LTspiceIV/lib/sym/Opamps folder.
Save the LM 555 asy file to your LTspiceIV/lib/sym/misc folder.

The NE555 is in the default library and functions the same as the LM555.

Step 7: Assemble It Out on Either a Perfboard or Breadboard.

Picture of Assemble It Out on Either a Perfboard or Breadboard.

If you are using a breadboard then you can test it after you lay it out.

If you are soldering, lay it out on a perfboard or however you are holding it together and solder the joints together.
Here are instructions on soldering.
Don’t burn your chips. Lay it out with just sockets and insert the chips after the circuit is soldered together.

Step 8: Make Your Outputs Whatever You Want.

Instructions on making an aux-cable output ( headphones take about 300mv peak-to-peak, start quiet).

Instructions on making an RCA cable.

Comments

-max- (author)2016-05-07

Or you could just use pin 2 as a unbuffered sawtooth wave output tbh..