# Triangle wave generator... help

Discussion in 'The Projects Forum' started by djex, Mar 7, 2011.

1. ### djex Thread Starter New Member

Feb 26, 2011
15
0
I'm working on a VCO (or would like to but I've pretty well pulled all my hair out and gotten know where so far)

First question before I get into what I'm trying to do. I've looked at many VCO schematics and some use a square wave generator and then wave shape the square into the other wave forms and some seem to have a separate generator for each wave form (triangle, square, sine, saw). Which would be the best way to go?

Any ways regardless I decided to start with wiring up a triangle waveform generator. I am new to this so forgive me if this is a trivial question.

I found a few triangle wave form circuits and they all were about the same so I decided to make this one http://falstad.com/circuit/e-triangle.html . Now the problem is I do not have a 1uF capacitor as this circuit has in it. The smallest I have is 10uF. But I do have a wide range of resistors so that's not a problem. So I substituted the 1uF for the 10uF cap in that circuit and adjusted the resistor values to produce a proper triangle wave again in the simulator on that site. Everything looked fine so I put it together on a breadboard and tested it. It didn't work.

I tried many times, rewiring and even swapping out op amps for different ones but still no luck. I now know I didn't calculate something right and or that simulator isn't accurate.

This is the circuit I built:

Voltage In DC: 6.2v
Capacitor: 10v 10uF
OP AMP: NTE859 (Quad op amp)

So I guess my question is where did I go wrong and is it even possible to change the capacitor value so drastically in this circuit?

2. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
There are two parts to this circuit, the Schmitt Trigger (who trigger values are set by the two resistors on the input of the circuit) and the integrator, which consists of the resistor/capacitor on that op amp. All affect frequency.

There are also variations. For example, a 555 makes a decent inverting Schmitt Trigger, and with one resistor and one capacitor you can create a decent sawtooth and square wave.

555 Hysteretic Oscillator

The integrator portion of your design provides inversion (which is absolutely necessary) and a linear movement instead of the classic RC curve.

It just occurred to me where your problem probably is. Are you using a ± power supply? It is more or less assumed when you are using op amps that you are, but the simplified schematic doesn't show it.

3. ### djex Thread Starter New Member

Feb 26, 2011
15
0
I took your question and did a little research. Turns out no, I was not using a ± power supply. So I did some further searching and found that I need a symmetrical power supply, right?

Problem is I do not have one but I should be able to make one it seems. The op amp I'm using is ±15v. Now do I need a center tapped transformer that is 15v or can I use a lower voltage?

I found this basic ± supply circuit online. To me it would seem it would work with the proper transformer and diodes.

http://freecircuitdiagram.com/2008/08/28/basic-symmetric-power-supply/

Will this work for what I need to do?

4. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
Yes, but there are simpler ways. A simple voltage divider with 2 resistors and a capacitor to create an intermediate voltage will work.

Something similar to figure 5 in this article will also work well, just use a quad op amp (and ground the inputs to the unused op amp).

Creating a Virtual Power Supply Ground

5. ### djex Thread Starter New Member

Feb 26, 2011
15
0
I read your full post you linked. So something like the circuit in the LM675 data sheet would work fine I'm assuming?

Also to clear something up for my self. The capacitor in the above circuit is a non polarized capacitor right?

6. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
60VDC? I'm not sure I'd like it, major overcomplicated for what you need, and incompatible with a large number of op amps. This circuit will work well, no gain resistors needed.

Yes, the capacitor is not an electrolytic.

7. ### djex Thread Starter New Member

Feb 26, 2011
15
0
Ok I just put this together using 6VDC with a quad op amp. It does work and I do get the same voltage on the + and the - but the voltage is really low and I'm thinking its because I'm not using the proper resistor size. I first tried with two 47k and got 0.17v at the + and -. I then tried 1k resistors and got a lower voltage of 0.11v. But it doesn't seem right that I need a larger resistor to get a higher voltage.

In that diagram above I assumed the + and - were the outputs for example +6 and -6. Am I right about this? If so then I should have everything wired properly.

8. ### Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
The op amp is necessary in circuits where the load on the virtual ground is significant or unbalanced. In this case, you can omit it if you want to. In either case, you can add a symmetry control which may be desirable if you are using op amps whose positive and negative saturation voltages are not equal (this is generally the case unless you are using rail-to-rail op amps).
You need to make the capacitor nonpolarized. This can be done by putting two polarized caps of the same value in series, back-to-back. This reduces the total value to half, so you can double the value of R5 to get back to the same frequency.

I simulated this with TL074 op amps, which I believe have similar specs to your NTE859.

File size:
38.7 KB
Views:
31
9. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
If you use a 6V power supply the pseudo ground will be ½ that, so it would appear to be ±3VDC.

10. ### Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
See the schematic below. Resistor values are not critical, but should be equal. I would use a value between 10k and 100k.

If you use a 6V supply, you will get ±3V.

File size:
7.4 KB
Views:
26
11. ### Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
Put your meter's black (negative) probe on the GND (op amp output). Now put the red lead first on the +V terminal, then on the -V terminal. With a 6V power supply, you should get +3V and -3V.

12. ### djex Thread Starter New Member

Feb 26, 2011
15
0
Yeah I figured it out as soon as I posted so I deleted my last post. Sorry about that.

Thanks. That diagram cleared it up 100% for me. I now understand how it works.

I'll take a look into that other circuit you posted above and give it a try. I'll post back if I have any problems.

One thing though. Now that I have these voltages split do I connect the +6 to the +Vcc on the op amp and the -6 to the -Vcc on the amp?

13. ### Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
Yep, that's how you do it.
Keep in mind that you need to make the nonpolarized cap (two in series, back-to-back) in the triangle wave section (the integrator) if you were planning to use a polarized one, no matter what kind of power supplies you use.

14. ### djex Thread Starter New Member

Feb 26, 2011
15
0
Worked perfectly with one exception. The triangle wave is perfect but when I try to get the square wave the wave form is strong for maybe a second then it dies out into a small buzz. I'm thinking its because its grounding through my audio jack bypassing the virtual ground we just made. So I tried connecting the audio jack ground to the virtual ground and that didn't work. It just distorted the whole thing. But other than that I'm quite pleased with the triangle wave this is producing. I learnt a lot from all this.

15. ### Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
Most op amps won't drive more than a few tens of milliamps. Where is your audio jack ground connected, and what kind of audio load are you trying to drive?
If your audio jack GND connects to -V, you should have a large-value cap in series between the op amp output and the load, +pin of the cap to the op amp output. This will remove the DC component from the waveforms.

16. ### djex Thread Starter New Member

Feb 26, 2011
15
0
Well since I do not have a proper oscilloscope I've been outputting through a 1/4" jack into my computer then using my studio software to display the wave form and also hear what it sounds like.

At the moment the audio jack ground is connected to the -V of the power supply (variable 12 volt wall adapter). For the audio load my sound card is acting as an amp so I don't see why there would be to much of a load on it.

I used a 16v 220uf cap but the square wave still died out and faster this time with the cap in between the output and the load.

17. ### Kerim Member

Mar 3, 2011
35
0
To isolate your oscillator, you can add a simple voltage follower (buffer) by using a 3rd opamp.
The output of this 3rd opamp will be connected to its minus input and its positive input to the output of the first opamp (that gives the squarewave). Obviously it needs to be powered by V+ and V- as the other opamps. Taking a current (for an external load, like the PC audio AUX input) from the added buffer output will not affect the running of the oscillator.

18. ### Kerim Member

Mar 3, 2011
35
0
If you have 100nF (usually it is not electrolytic hence bipolar), you can get about 50Hz if the resistor is made 100K instead of 1K. I also suggest the resistors 4.7K and 10K be replaced with 47K and 100K (or 22K and 47K if you like). Good luck.

19. ### djex Thread Starter New Member

Feb 26, 2011
15
0
Thanks for the tips. I'll give them a try. Have you built a VCO before?

20. ### Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
Your sound card is AC coupled on the input, so you don't need another cap.

Regarding Kerim's comment, I didn't mention using a 100nF cap because you said 10uF was the smallest value you had. I agree that R5 needs to be larger, and the cap smaller.