2
\$\begingroup\$

I am generating a square wave with a 555 timer chip and I am trying to obtain a triangle wave from the 555's output by using an op-amp (LM324N) as an integrator. The op-amp is in single power supply mode with pin 4 (V+) connected to Vcc (+5V) and pin 11 (GND) connected to GND. At first I thought it might be because I am saturating the op-amp's inputs, but then I measured the 555 output with a digital multimeter and it indicates that when the 555 OUTPUT goes HIGH it puts out about 3.5 V. In the initial configuration (blue in the drawing) the LED1 pulses as it should along with the 555 OUTPUT but the LED2 (op-amp output) is constantly off.

enter image description here

enter image description here

Then I inversed the polarity of the LED and wired it to Vcc instead of GND (as seen in red) and it stays always on, regardless of 555 output.

The Op amp inverting input is connected via a 220ohm resistor to 555 OUTPUT and via a 10 nanoFarad capacitor to op-amp's output (pin 1), the non-inverting input (pin 3) is connected to ground.

What am I doing wrong here? And how can I get a triangle wave with an op amp from the square wave output?

\$\endgroup\$
7
  • \$\begingroup\$ Any chance you can convert that to a schematic diagram rather than a wiring diagram? The schematic gives the purpose of the pins. Your pin numbers don't. There's an schematic tool built into the editor. Your diagram is also rotated. \$\endgroup\$
    – Transistor
    Commented Jun 18, 2017 at 13:00
  • \$\begingroup\$ I don't know why the schematic is rotated, it was fine on my computer. I will convert it to a proper schematic and upload it as soon as I can :) \$\endgroup\$ Commented Jun 18, 2017 at 13:02
  • \$\begingroup\$ Have you checked RC of the integration part? What's Vcc? What's the type of LED2? \$\endgroup\$
    – dirac16
    Commented Jun 18, 2017 at 13:26
  • \$\begingroup\$ Vcc is the supply voltage going to the 555 and the LM324 which is 5V, the 2 LEDs are identical. I don't know what you mean about checking the RC \$\endgroup\$ Commented Jun 18, 2017 at 13:27
  • 1
    \$\begingroup\$ For the integrator to work the input voltage must be 'positive' and 'negative' with respect to the non-inverting input. Try adding a simple voltage divider (2 x 4k7) between the supply and 0V, with the mid point connected to the non inverting input. \$\endgroup\$ Commented Jun 18, 2017 at 13:29

3 Answers 3

4
\$\begingroup\$

Now that you've drawn a schematic rather than wiring diagram the problem becomes clear.

Your integrator is an inverting type and when the input goes positive the output should go negative which it can't as there is no negative supply. Some other problems have been addressed in the other answers.

A simpler way to do this is with a pair of op-amps.

enter image description here

Figure 1. This pair of op-amps will generate a square and triangle waveform. For single supply operation the grounded op-amp pins would be connected to half positive supply. Source: DIY Stompboxes.

A nice feature of this arrangement is that the integrator output will never saturate (if components are right, obviously) and frequency can be adjusted by changing R3 only.

A web search for "integrator oscillator" should get you all the info you need.


Update

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 2. An oscillator for you to play with in the simulator.

enter image description here

Figure 3. Simulator settings.

enter image description here

Figure 4. Simulator result.

\$\endgroup\$
8
  • \$\begingroup\$ I wired the circuit as in the diagram above with the positive op amp of the supply to +5v and GND to ground. I used R1 = 1kohms and R2= R3 = 220 ohms. The circuit does not oscillate and instead has the square out always on with about 3.53 V on it and Triangle out always off with about 0.06 V on it. What am I doing wrong here? Also, could (after fixing) use these outputs to drive a loudspeaker or would I need extra steps? \$\endgroup\$ Commented Jun 18, 2017 at 17:04
  • \$\begingroup\$ See the update. You should have wired it as shown. Watch your output load. It's only an op-amp and minimum load would be 1k up unless you know what you're doing. It might light an LED. It won't power a speaker. \$\endgroup\$
    – Transistor
    Commented Jun 18, 2017 at 18:37
  • \$\begingroup\$ What do I need to do with the op-amp output to be able to drive higher loads? \$\endgroup\$ Commented Jun 18, 2017 at 18:49
  • \$\begingroup\$ Some sort of power amplifier. You are being rather vague about your application. I can't guess. Use a set of computer speakers with built-in amplifier to listen to it. Add a capacitor in series with the output because there is a 2.5 V DC bias on it. Start with volume down! \$\endgroup\$
    – Transistor
    Commented Jun 18, 2017 at 18:51
  • \$\begingroup\$ The 10F value for C2 does sound a bit impractical though, doesn't it? \$\endgroup\$ Commented Jun 21, 2017 at 12:50
2
\$\begingroup\$

It seems you want a triangle wave from a square wave. If so, there are a number of things wrong with this circuit:

  1. There is no DC feedback path at all. That means that even the tiniest offset into the integrator will eventually cause it to hit one rail or the other. If you only care about the AC component of the output, this might be OK.
  2. The input is always zero or positive. Since the integrator is inverting, the output will always be low after a short time.
  3. The LM324 is not a good choice for this. In particular, it requires some headroom at the high end, and it has relatively high input bias current.
  4. It is not clear what the purpose of the LED is. Driving it from a triangle wave makes little sense.
  5. Driving the LED directly from the opamp output requires it to source significant current. Perhaps this amp can handle that, but this is something you should carefully check. A more appropriate amp is less likely to be able to source the current.
\$\endgroup\$
3
  • \$\begingroup\$ 3. What would be a better op-amp for this application? I am only now trying to wrap my head around how op-amps work and have no experience with them. 4. The LED is there so "I can see the waveform". I originally wanted to drive a speaker using the output so I could hear the square and triangle wave outputs but I'm not quite certain how to go about doing that. \$\endgroup\$ Commented Jun 18, 2017 at 14:22
  • \$\begingroup\$ @andr: a CMOS rail-to-rail opamp would be a better choice. However, you still have to fix #2. The positive input should be at about 1/2 the supply voltage, or use +- supplies. \$\endgroup\$ Commented Jun 18, 2017 at 14:25
  • \$\begingroup\$ I did put the inverting input at about 1/2 the supply using a voltage divider made up of 2 2,2k resistors and now they oscillate out of phase. When the 555 output goes LOW the opamp output goes HIGH and reverse (with LED2 wired to ground). Shouldn't I see the LED2 light intensity changing throughout the cycle though (if it's a triangle wave) ? \$\endgroup\$ Commented Jun 18, 2017 at 14:35
1
\$\begingroup\$

Depending on how straight you want the straight bits of the triangle to be, the simplest way to approximate that will be to use the 324 to buffer the voltage on the timing capacitor. During oscillation, it ramps between 1/3rd and 2/3rds Vcc (assuming the 555 control voltage pin is open, which yours is).

Although the straight bits are not too straight, the pointy bits are very pointy ;-)

\$\endgroup\$
2
  • \$\begingroup\$ How can I go about doing that? could I use the opamp as a voltage follower and use pin 2 of the 555 as the inverting input? \$\endgroup\$ Commented Jun 18, 2017 at 14:17
  • \$\begingroup\$ @andreas.vitikan 555 pin 2 is the 'triangle wave' output. Buffer this by taking it to a non-inverting input of the 324, for instance pin 1, and make that amp a buffer by connecting pins 2 (inv input) and 3 (output) together, taking output from pin 3. Take 4 and 11 to their normal power and ground respectively. \$\endgroup\$
    – Neil_UK
    Commented Jun 18, 2017 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.