Using a 555 timer to generate a triangle wave

Status
Not open for further replies.

Thread Starter

GatorCpE

Joined Jul 14, 2010
29
Hi,

I'm new to the forum here, and I apologize in advance if this is in the wrong place. I am working on a simple guitar phaser for a project and I need a LFO that outputs a triangle wave. I put together a LFO using a 555 timer, but I'm pretty sure that the output is a square wave. Is there anyway to make the circuit output a triangle wave? I'd like to use the 555 timer if possible because I already have the chip.

Heres a link to the LFO circuit I built: http://www.mikmo.dk/cblfo.html

Thanks for the help
 

Wendy

Joined Mar 24, 2008
23,429
A 555 will make a good sawtooth, but I'll draw something better later. Basically this is what you 're looking at...



 

Markd77

Joined Sep 7, 2009
2,806
Use the voltage at pin 2 instead - it needs buffering with an op amp.
It has the waveform shown on the left side of Bill's diagram.
 
Last edited:

Thread Starter

GatorCpE

Joined Jul 14, 2010
29
Use the voltage at pin 2 instead - it needs buffering with an op amp.
It has the waveform shown on the left side of Bill's diagram.
Could I also use the 555 timer to produce a square wave at the output and then feed this into an integrating amplifer to generate the triangle wave?
 

tom66

Joined May 9, 2009
2,595
That would work much better, the integration idea.

You will experience a slight drop in output voltage over a large span of frequency, but since you are dealing with audio level signals the drop will be minimal if at all noticeable.

However, you might as well go all the way with opamps. Use a relaxation oscillator and an integrator. Or, you could use a triangle wave oscillator. Here is a circuit in a Java Circuit Simulator that would work well.

http://falstad.com/circuit/e-triangle.html
 

Wendy

Joined Mar 24, 2008
23,429
Or you could use an extra transistor or two on the 555 circuits to make the triangle waves perfect, similar to the experiment here. It was what I'm thinking about drawing in a better format.

I'll be back.
 

Thread Starter

GatorCpE

Joined Jul 14, 2010
29
Hey thanks for the replies. Sorry it has taken me so long to get back here. I've been trying to get my LFO working for several days and I'm about to pull my hair out. I'm not sure why it is not working but it is driving me insane. I have attached a hand drawn schematic of my circuit.

The output (square wave) of the 555 timer looks to be working perfectly. I get perfect on/off pulses and the frequency of the pulses is controlled nicely by the pot. I run into trouble with the integrator. I am almost certain that something is wrong and that I am not getting a triangle wave like I want. I've tried endless resistor and cap combinations, and some have greater effects than others. I would expect the output of the integrator to fade in and out but it does not as I have verified this with an led. The output from the integrator lights the led dimly. There was one combination, I can't remember the values, that made the led fade, but never turn off completely.

Do you guys have any idea what I'm doing wrong. Also keep in mind that I'm trying to make this into a LFO for a simple guitar phaser project so I need to be able to control the frequency of the waves, just like with a commercial phaser.

Any ideas?
 

Attachments

tom66

Joined May 9, 2009
2,595
The resistor on the integrator opamp's (-) input needs to be in the kilohm range, not in the megohm range. Also, the megohm resistor will introduce noise (compared to the kilohm resistor), which is not great, if you plan to amplify the signal.

Also the resistor should be 330 ohms for 9V, 1k will work it will just be dimmer. This will draw about 15mA - 20mA, which is near the limit of the op amp.
 

Thread Starter

GatorCpE

Joined Jul 14, 2010
29
The resistor on the integrator opamp's (-) input needs to be in the kilohm range, not in the megohm range. Also, the megohm resistor will introduce noise (compared to the kilohm resistor), which is not great, if you plan to amplify the signal.

Also the resistor should be 330 ohms for 9V, 1k will work it will just be dimmer. This will draw about 15mA - 20mA, which is near the limit of the op amp.
So the integrator resistor needs to be in the kilo ohm range? What about the integrator capacitor? How do I know what value I need to select?

You mentioned a resistor should be 330 ohms. Which one were you referring to?

Thanks
 

Thread Starter

GatorCpE

Joined Jul 14, 2010
29
Well, I may have scrapped the integrator idea. I was reading the earlier posts and started messing around with pin 2 of the 555. I put a buffer on it, and with the right cap, and the 100k pot turned right, i am getting a decent fade/pulse. My question is, how can i get my led to fade all the way out then fade back in? Right now, it fades and gets dim but never goes completely out.

Since this is a LFO for a guitar phaser, the frequency of the fade needs to be adjustable. Is the 100k pot too much for this?

Thanks for all the help.
 

Wendy

Joined Mar 24, 2008
23,429


I have built this, U1B could be used as an inverter for the transistor section (which is a rail-rail inverting section).



I haven't built this one, but I'm pretty sure it will work.

The triangle in both cases will be from 1/3 to 2/3 voltage, the 555 sets this limit.

Hope it helps.
 
Last edited:

Audioguru

Joined Dec 20, 2007
11,248
Your integrator did not work because the (+) input of the opamp was connected to ground, causing the (+) input to have a voltage that is too low to work. If the input did work, then the output of the opamp would always be low. With the (+) input grounded then the opamp needs an additional negative supply.

Instead, bias the (+) input of the opamp at half the supply voltage with two resistors in series.

EDIT:
The output of most opamps does not go to a low enough voltage to turn off a red LED. Try using one opamp of an LM358 dual opamp that has an output that goes to ground in your circuit.
 
Last edited:

Thread Starter

GatorCpE

Joined Jul 14, 2010
29
Your integrator did not work because the (+) input of the opamp was connected to ground, causing the (+) input to have a voltage that is too low to work. If the input did work, then the output of the opamp would always be low. With the (+) input grounded then the opamp needs an additional negative supply.

Instead, bias the (+) input of the opamp at half the supply voltage with two resistors in series.

EDIT:
The output of most opamps does not go to a low enough voltage to turn off a red LED. Try using one opamp of an LM358 dual opamp that has an output that goes to ground in your circuit.
Is there any way to merge two posts? There is alot of good information in both my posts, I just made the mistake of making two.

Anyhow, I don't have access to an LM358. I have a ton of 741's and a couple quad op amps. So there's no way to get the output to go zero with these huh? Well I'm not sure how important it is for the output to go completely to zero. The led is just giving me visual feedback of what is going on. I'm trying to use this circuit as an LFO in a guitar phaser circuit to modulate the part of the signal that goes through the phasing network of all pass filters. With this information, is it important for the output to go completely to zero?

Thanks
 

Wendy

Joined Mar 24, 2008
23,429
There are considerably more dual op amps than any other. I don't totally agree with AudioGuru on how useless a 741 is, but it does have some rather dramatic problems. The power supply is a big one, the output drive is another. It doesn't get very close to the rail to rail.

You could try the first schematic I posted, it only used one op amp (the second is tied off). This is more important than it appears, spare gates or op amps need tied off to make them inactive, otherwise they can oscillate and cause all sorts of problems. You can also tied both inputs of an op amp to ground to do this. If you use a quad information this still applies.

Just ignore the second thread, it will wither away. That or post a link to this one, then ignore it.
 

Audioguru

Joined Dec 20, 2007
11,248
Since you have a ton of old 741 opamps that are designed for a plus and minus 15V dual-polarity supply, then use them with a dual-polarity supply.
One 741 can produce the square-wave and another can be the integrator.

The output will be a triangle waveform that will swing equally positive and negative. A resistors level-shifter can offset a transistor that drives the dimming and brightening LED.
 

Thread Starter

GatorCpE

Joined Jul 14, 2010
29
I just thought of something. Does the square wave output from the 555 oscillate between +v and -v or +v and 0? If it only oscillates between +v and 0, then I will only get a positive ramp with no negative slope correct? In other words, i'll only have half a triangle.

Also, why is the transistor needed to brighten and dim the led? The voltage sweep from positive to negative at the output couldn't accomplish this?


Edit: Well I'm stumped again. I made a dual polarity power supply by hooking two 9 volt batteries together. I fed the integrator + and - 9 volts and left the non inverting input connected to ground. I get pulse on my output led and it fades to a certain degree. The problem is, it still doesn't completely extinguish. I'm really at a loss here. I'm starting to think the problem may be with the 555 square wave. I'm not sure its taking negative value. I think it oscillates between +v and 0. I'd like to get my personal schematic working rather than start over with a new schematic. I know it would probably be easier in the long run to start over, but I've spent so much time on this, I'd like to see it working.
 
Last edited:

Audioguru

Joined Dec 20, 2007
11,248
I just thought of something. Does the square wave output from the 555 oscillate between +v and -v or +v and 0?
If you use your single polarity supply then its output goes from about 0.2V to 1.4V less than the positive supply voltage.

If it only oscillates between +v and 0, then I will only get a positive ramp with no negative slope correct?
It depends on the bias voltage given to the non-inverting input of the opamp. If the non-inverting input is at 0V then the opamp output will always be as low as it can go.

why is the transistor needed to brighten and dim the led? The voltage sweep from positive to negative at the output couldn't accomplish this?
It is very confusing for you to use a lousy old 741 opamp that needs a lot of changes to a simple circuit to make it work. The output of the 741 opamp does not go to a low enough voltage to turn off a red LED.
If you use an inexpensive and readily available LM358 or MC33172 dual opamp then they make an oscillator and an integrator that need only a single supply voltage. A transistor will not be needed.
 
Last edited:

Wendy

Joined Mar 24, 2008
23,429
A 555 does not go to Vcc, it gets within 1.3V volts of Vcc. It gets very close to ground, it is designed for a single power supply, 4.5V to 15V.
 
Status
Not open for further replies.
Top