# Gas station without pumps

## 2013 February 22

### Nineteenth day of circuits class

Filed under: Circuits course — gasstationwithoutpumps @ 19:13
Tags: , , , , , ,

Today’s class started out well, but ended up with one of the worst lectures of the quarter.

I had three topics I wanted to cover today:

• proper use of electrolytic capacitors
• strain gauges
• instrumentation amplifiers

The electrolytic capacitor part went fairly well.  I managed to get the students to come up with the two sensible ways to hook up a polarized capacitor in a low-pass filter (either tying the negative end to low-voltage rail or the positive end to the high-voltage rail) and why it would be a problem to have one end connected to ground or virtual ground in the middle.  It took a little longer than I thought it would, but I’m getting used to that by now, and I believe that most of the class understood the reasoning.  (I’ll see in the next lab report whether they remember to use the polarized symbol for the electrolytic capacitor or not.)

The strain-gauge discussion brought out the Wheatstone bridge circuit again, and I think it went ok, as did the listing of the three types of pressure sensors (differential, absolute, and gauge).  For their next lab, they’ll be designing and soldering up an amplifier for an MPX2053DP pressure sensor, which is a differential sensor, though they’ll be using it as a gauge sensor, by leaving one port open.

The third topic, instrumentation amps, did not go well, even though I had prepped material yesterday and this morning.  I made the mistake of inserting a topic I had not originally planned to cover (the precursor design to the 3-op-amp instrumentation amp, which uses two unity-gain amplfiers followed by a simple one-op-amp differential amplifier).  Because I hadn’t prepped that design, I did it from memory and made two serious mistakes in drawing the circuit (a misconnection and swapping the values of two resistors).  After working through some tedious algebra, I saw my mistakes and fixed them, but by then it was too late—I had lost the class.

I then went through the algebra for the three-op-amp instrumentation amp:

This is the standard 3-op-amp circuit for an instrumentation amplifier, together with the algebra needed to compute the gain $V_{out}-V_{ref}=(1+2R_x/R_{gain}) (V_{in+}-V_{in-})$

I think it was a mistake to go through the algebra with the class—they zoned out. It was a bigger mistake to try to do the “simplified” 3-op-amp amplifier from memory, as I made mistakes and the presentation made the design more confusing, rather than less. I did derive and give them one simple shortcut for voltage dividers which have two non-zero voltages, Va connected to Ra and Vb connected to Rb: Vout= (Va*Rb+Vb*Ra)/(Ra+Rb). I suspect that they’ll remember the shortcut wrong though, and so I’m wondering whether they would be better off always going back to the voltage divider formula.

To make matters worse, the INA126P chip that they’ll be using uses a 2-op-amp design, rather than a 3-op-amp one:

The INA126P chip uses this design, rather than the “standard” 3-op-amp design. This design requires more precise matching of resistors, but with modern laser trimming in manufacturing, that is no longer much of a problem.

I don’t think that I’ll give them the algebra in class for the 2-op-amp design, as it is even more tedious than the 3-op-amp algebra, because we need to use Kirchhoff’s current law, and not just a voltage divider. For the circuit shown here, the two current sums on the nodes where three resistors meet are
$\frac{V_{in+}-V_{out}}{R_2} + \frac{V_{in+}-V_{oa2}}{R_1} + \frac{V_{in+}-V_{in-}}{R_{gain}} = 0$
$\frac{V_{oa2}-V_{in-}}{R_1} + \frac{V_{in+}-V_{in-}}{R_{gain}} + \frac{V_{ref}-V_{in-}}{R_2} = 0$

If we add the two equations, we get
$\frac{V_{in+}-V_{in-}}{R_1} + \frac{V_{in+}-V_{out}+V_{ref}-V_{in-}}{R_2} + 2\frac{V_{in+}-V_{in-}}{R_{gain}}=0$.

We can simplify this to get the gain equation
$V_{out}-V_{ref} = (V_{in+}-V_{in-}) \left(1+ \frac{R_2}{R_1} + \frac{2 R_2}{R_{gain}}\right)$

For the INA126P, R1=10kΩ and R2=40kΩ, so the gain equation further simplifies to $V_{out}-V_{ref} = (V_{in+}-V_{in-}) \left( 5 + \frac{80k\Omega}{R_{gain}}\right)$.

I told the students to form their lab partnerships today and work on the pre-lab for the pressure-sensor lab over the weekend, so that they can ask questions in class on Monday. I’ll bring in my board and pressure sensor on Monday also, so that they can see what sort of wiring I’m expecting.