How to analyze this op amp circuit? - Page 1
Forum section: electronics / beginners

author: mtwombley
author_rank: Newbie
timestamp: December 31, 2022, 04:49:28 pm
content: I want to create thishttps://www.digikey.ca/en/maker/projects/interfacing-pressure-sensor-spd005g-to-arduino/dee9672d8a8f4c4bb20ac87b10074150circuit and was trying to analyze the op amp. But it is much more complicated than I've learned so far.When I look at IC1A I believe that R1 == RF but does that mean that RI is just Rg because of the virtual ground effect or is RI == Rg+R1+R2+R3?

author: TimFox
author_rank: Super Contributor
timestamp: December 31, 2022, 05:02:23 pm
content: The three op-amps form a conventional differential amplifier.To analyze it, start with "V1" and "V2" where they are drawn, then solve for all the other node voltages, assuming that the voltage difference between the + and - inputs of each op amp is zero.You will find that the voltage at "A0" is proportional to the differenceV1-V2.

author: free_electron
author_rank: Super Contributor
timestamp: December 31, 2022, 05:38:52 pm
content: to understand this : split RG into two identical resistors. Now you have two traditional opamp circuits where the midpoint of the split resistor is the "virtual ground". in other words : the opamps will adjust their outputs symmetrically around this centerpoint.The third opamp simply takes the difference between the outputs of the first two opamps and gives you the result.

author: basinstreetdesign
author_rank: Frequent Contributor
timestamp: January 02, 2023, 05:33:40 am
content: If you keep in mind just two of the op-amp cardinal rules then it becomes easy. That (#1) the voltage between any op-amps inputs is zero and that (#2) no current flows into/out of its inputs.Obviously we must insist that these are ideal op-amps to uphold the above two rules and that no weird non-linear stuff is happening (like the output running into the rails, etc).So starting with the input voltage, V1 - V2, we can immediately see that that is the same voltage across Rg. That tells us the current through Rg as (V1-V2)/Rg. Given that and rule #2 above then the current through each R1 is the same again. Thus the voltage gain of the first stage is (Vpin1 - Vpin7)/(V1 - V2) = 2 * R1 / Rg.The 2nd stage is a conventional differential amp which has gain of R3 / R2.So the whole circuit has gain of 2 * R1 * R3 / (R2 * Rg).The circuit has infinite input impedance since the input signals are connected to nothing else than the op-amp inputs.If any voltage is common to both inputs (such as a dc offset) then the (V1 - V2) part of the 1st stage gain subtracts it out.

author: Terry Bites
author_rank: Super Contributor
timestamp: January 02, 2023, 09:13:51 am
content: Here's good explanation.Note that the current flowing in both R1s and Rg is the same. No current flows into the inverting inputs of IC1a or IC1b.R2 R3 R2' R3' (so unhelpfully numbered) with IC1c form a differential amplifier.The Input stage and the differential stage are analysed separately.Note that this configuration requires good resistor matching and quality opamps to work properly. You are not going to get a reliable 10bit measurement with 324s and 5% resistors.Non inverting opamps stages do not have a virtual ground. They have a "common mode voltage". The opamp inputs are at the same potential. The currents flowing into the inverting terminal node and out of this node sum to zero.Its woth noting that you can dispense with the differential stage and therfore reduce the error in your system if you have a spare ADC input. You can do the subtraction of the voltages (pin 1, Pin7) in software.

author: David Hess
author_rank: Super Contributor
timestamp: January 02, 2023, 02:48:39 pm
content: Quote from: free_electron on December 31, 2022, 05:38:52 pmThat is how I do it; pretend the middle of RG is grounded for analysis purposes.

author: mtwombley
author_rank: Newbie
timestamp: January 02, 2023, 03:33:20 pm
content: Quote from: Terry Bites on January 02, 2023, 09:13:51 amThank you for the video, that really helped explain what it was doing. This is just a hobby for me, so learning is an everyday event.

author: MrAl
author_rank: Super Contributor
timestamp: January 02, 2023, 11:17:01 pm
content: Quote from: mtwombley on December 31, 2022, 04:49:28 pmHello there,The best way is to do a full analysis with a method like Nodal Analysis.This was done on the circuit shown in the attachment which is the same with different part numbers but you can correlate them to the original drawing.There may be a problem though because it looks like the output is inverted. So for example instead of putting out +2v it might be putting out -2v instead, and that is no good for the Arduino. If there is no negative supply voltage then it just wouldn'twork. This is assuming that the schematic for the pressure sensor and data sheet are both correct where they label the polarity of the output pins. If the polarity is reversed, then it will put out +2v as in the example above.If you look at the analysis output for Vo1, you can see that if E1 is say 4v and E2 is say 3v, the output will be negative. That makes sense if you follow the rule of dividing the circuit into two parts. In your schematic V1 gets amplified and goes to the inverting terminal of the last op amp, so it makes sense it is subtracted from V2, not the other way around (V1-V2).The best bet then it to MEASURE the output of the sensor and the output of the last op amp before connecting to an Arduino. Make sure it is a positive signal for increasing pressure (unless it is being used for a vacuum or something, if it even works in that mode). If you get the wrong polarity on the output just flip the two output leads of the sensor.Notes:R5+R55 make up that one resistor in the original drawing.Ignore R56, that was for testing another circuit with it that connected there.View all the dashed lines as straight non dashed lines.There are no lines that 'jump' over any other lines. If lines meet they form a connection.About Nodal Analysis:Nodal Analysis is a general circuit analysis technique that allows you to calculate the voltages at each point in the circuit. It's especially simple for static circuits like this one. You learn a rule and apply the same rule to each node.For a resistor, you have two terminals, so if you call the voltage on one terminal v1 and the other terminal v2, you can calculate the current as:i=(v1-v2)/Rwhere R is the resistor value.You do this for all the components (some other rules kick in but are not hard to learn) and you end up with a set of simultaneous equations which you then use computer software to solve. The solution is the voltage at every node in the circuit. You can discard the ones you are not interested in. For this circuit we really only wanted the output voltage, but if you wanted to study the voltage at the other nodes you just look at those too. That can help you to really really understand circuits like these.

author: Infraviolet
author_rank: Super Contributor
timestamp: January 03, 2023, 07:46:59 pm
content: If you build it I'd definitely look in to using rail to rail op-amps with 5V and Gnd as their supply, rather than a 9V positive rail, the latter could do pretty nasty things depending on the size of the sensor's signal and the amplification factor, if it ended up with >5.6V entering the arduino. Either that or use some zener diodes and series resistors to ensure the voltage on that input line is clamped to not get above 5.5V or so.

author: EPAIII
author_rank: Super Contributor
timestamp: January 04, 2023, 08:00:27 am
content: Good discussion! I have used a number of op amp designs but stayed away from this kind of circuit. Now that these posts and the video have given me a better understanding of it, I will probably use it in the future.Thanks!

author: MrAl
author_rank: Super Contributor
timestamp: January 04, 2023, 11:25:19 am
content: Just a quick note...In my previous reply i had to modify the part where the output of the last op amp might go negative. Of course if there is no negative supply voltage then the output will just get clamped to ground, so the circuit just would not work but would not blow out the Arduino.That's if the data sheet for the sensor is correct. If the leads are actually flipped, then it should work.