# Op Amp circuit for analog computing (addition) won't work

#### wouter368

Joined Sep 22, 2022
20
Hey,

With advise of an earlier thread I posted I tried making this circuit:

In this circuit, if you would measure the voltage after the output of the second Operational amplifier (unfortunately in this circuit the voltage meter is not drawn, but it should be connected to the ground on one end and to the output of U2 (the second op amp) on the other), you should get these results:

Vout = V1 + V2. I based this on this circuit I found in a paper about analog computing:

However, I'm not getting those values for Vout. Actually, I'm not getting any explainable values for Vout at all, no matter which voltages I apply to V1, V2, V3 and V4. I've been stuck on this for weeks so I really don't know what's causing the issue... since I checked my breadboard multiple times with the help of teachers as well and they couldn't figure out any mistakes I made while building the circuit in the first image. It would be awesome if someone is able to figure out what's wrong with this setup or circuit.

The op amp type is LM358 and the resistors are all 3k Ohm.

Here's some pictures of my breadboard (sorry if they're unclear, let me know if there's a better way to photograph it)

#### crutschow

Joined Mar 14, 2008
34,078
What values are your V3 and V4 supply voltages?

What is the yellow terminal on the supply and where is it connected?

#### Ian0

Joined Aug 7, 2020
9,535

#### bertus

Joined Apr 5, 2008
22,264

#### wouter368

Joined Sep 22, 2022
20
What values are your V3 and V4 supply voltages?

What is the yellow terminal on the supply and where is it connected?
The values of V3 and V4 I put both at 8V, so that a voltage of 16V is supplied to the Op amps.

The yellow terminal on the supply is the ground.

#### wouter368

Joined Sep 22, 2022
20
Because I am quite new to this, I found it to be visually more clear to use two operational amplifiers instead of using one dual operational amplifier.

#### Ramussons

Joined May 3, 2013
1,395
Because I am quite new to this, I found it to be visually more clear to use two operational amplifiers instead of using one dual operational amplifier.
Fine, 2 Dual OpAmp IC's bering used.
Please show us the schematic being used with Pin Numbers and mention IC1 or IC2

#### MrChips

Joined Oct 2, 2009
30,521
V3 and V4 are your supply voltages.
They need to be floating supplies.
One must be set up for positive supply, the other for negative supply.
Show us how you have wired the supplies.

#### ericgibbs

Joined Jan 29, 2010
18,673
hi 368,
Just to confirm that the circuit actually works, this is a LTspice simulation.
E

#### Attachments

• 59.1 KB Views: 6

#### WBahn

Joined Mar 31, 2012
29,888
Check your resistor values. Looks to me like you have three 4.3 kΩ resistors, a 470 Ω resistor, and I can't see the bands on the other one.

If the other one is also 470 Ω, then the output from the first amp would want to be less than -9 V, which would make it rail at -8.8 V (since the output can get close to the negative rail). When you then put that through your inverter, that would result in it's output wanting to be about +8.8 V, but the typical output range for the LM358 only goes to 1.35 V below the positive rail, which in your case would be 7.6 V less 1.35 V, or about 6.25 V. That sure looks to be right about what you are seeing.

In addition to verifying that your resistor values are what you think they are, I would recommend tying the inputs (NOT the outputs!) of the two unused opamps to the rails -- for each opamp, tie one input to the positive rail and the other to the negative rail. You might do this through a 10 kΩ resistor (value isn't too important). This will force the output to be railed instead of potentially flailing around due to floating inputs. I would also recommend putting a 0.1 µF cap, preferably ceramic, across from each of the opamp power pins to the ground node as close to the chip as possible.

Your supplies are not balanced. One is 7.6 V and the other is 8.8 V. Get these to match, at least so the displayed voltages differ by no more than 0.1 V.

Instead of just showing what the final output is, measure the voltages at each of the opamp inputs and outputs and post those measurements as well.

Finally, I'd recommend spending some time cleaning up your layout. Some suggestions:

1) Connect the yellow ground ports on all four supplies together using banana plug cables and connect this to the ground binding post on the breadboard.
2) Also use cables to connect the ground to the negative terminals of your two signal supplies and your positive supply, and to the positive terminal of your negative supply.
3) Bring the positive and negative rails to the red and black binding posts on your breadboard.
4) Connect the binding posts to appropriate vertical longlines on the breadboard.

Make yourself some labeled test points by taking solid wire (or component leads that have been trimmed) and write a label on a small piece of masking tape and put in on the wire far enough down to enable you to clip a grabber lead onto it (if you have those). Even if you don't, having those sticking up from the breadboard is very helpful to visually keep track of what signals are where.

Last edited:

#### MrChips

Joined Oct 2, 2009
30,521
Bench power supplies are often “floating”.
You need to know how to make a positive voltage supply and a negative voltage supply. If you don’t know don’t be afraid to ask.

The ground connection on your PSU is “earth” or “safety” ground.
This is not connected to the PSU output. You also need to know how to make this connection.

#### wouter368

Joined Sep 22, 2022
20
Fine, 2 Dual OpAmp IC's bering used.
Please show us the schematic being used with Pin Numbers and mention IC1 or IC2
The schematic should be
hi 368,
Just to confirm that the circuit actually works, this is a LTspice simulation.
E
View attachment 276892
Thanks, so I guess there must be something wrong with the way I built the circuit then. That's good to know.

#### wouter368

Joined Sep 22, 2022
20
Check your resistor values. Looks to me like you have three 4.3 kΩ resistors, a 470 Ω resistor, and I can't see the bands on the other one.

If the other one is also 470 Ω, then the output from the first amp would want to be less than -9 V, which would make it rail at -8.8 V (since the output can get close to the negative rail). When you then put that through your inverter, that would result in it's output wanting to be about +8.8 V, but the typical output range for the LM358 only goes to 1.35 V below the positive rail, which in your case would be 7.6 V less 1.35 V, or about 6.25 V. That sure looks to be right about what you are seeing.

In addition to verifying that your resistor values are what you think they are, I would recommend tying the inputs (NOT the outputs!) of the two unused opamps to the rails -- for each opamp, tie one input to the positive rail and the other to the negative rail. You might do this through a 10 kΩ resistor (value isn't too important). This will force the output to be railed instead of potentially flailing around due to floating inputs. I would also recommend putting a 0.1 µF cap, preferably ceramic, across from each of the opamp power pins to the ground node as close to the chip as possible.

Your supplies are not balanced. One is 7.6 V and the other is 8.8 V. Get these to match, at least so the displayed voltages differ by no more than 0.1 V.

Instead of just showing what the final output is, measure the voltages at each of the opamp inputs and outputs and post those measurements as well.

Finally, I'd recommend spending some time cleaning up your layout. Some suggestions:

1) Connect the yellow ground ports on all four supplies together using banana plug cables and connect this to the ground binding post on the breadboard.
2) Also use cables to connect the ground to the negative terminals of your two signal supplies and your positive supply, and to the positive terminal of your negative supply.
3) Bring the positive and negative rails to the red and black binding posts on your breadboard.
4) Connect the binding posts to appropriate vertical longlines on the breadboard.

Make yourself some labeled test points by taking solid wire (or component leads that have been trimmed) and write a label on a small piece of masking tape and put in on the wire far enough down to enable you to clip a grabber lead onto it (if you have those). Even if you don't, having those sticking up from the breadboard is very helpful to visually keep track of what signals are where.
Thanks, awesome advice. I'll try this monday and let you know if it worked.