Gas station without pumps

2014 April 18

Voltage dividers, parallel impedance, scope probes

Filed under: Circuits course — gasstationwithoutpumps @ 20:26
Tags: , ,

I started today’s class by having the students present what they had done on the homework I assigned at the end of class Wednesday.  The first part was a voltage divider with one resistor above the output and two in series below the output. Everyone got this, either by direct reasoning about the currents matching or by using the two-resistor voltage divider formula and that two resistors in series add.  The next problem was a little harder:

You have sensor whose resistance varies from 1kΩ to 4kΩ with the property it measures and a 5v power supply.  Design a circuit whose output voltage varies from 1v (at 1kΩ) to 2v (at 4kΩ).

For this one we first had two non-solutions presented. One student tried using a simple voltage divider, and found the resistance for which some power supply would produce the desired outputs, but (unfortunately) the necessary power supply was not 5v. one student showed a use for the 3-resistor voltage divider, but got the values of the resistors wrong, so that a simple sanity check showed that the answer didn’t work. Another student came up with a circuit that “cheated” by assuming 2 more power supplies (at 1v and 2v). If he had known how to create such virtual power supplies, I would have given him credit, but he had no idea how to create them from the 5v supply. While that was being presented the student with the 3-resistor voltage divider, redid his arithmetic and got results that were almost ok (a percent or two off), so I had him present his method. The method set up the right equations, but his method for solving them was a bit messier and more complex than needed, so I showed the students how to set up the voltage divider equation as the inverse of current (R/V) being identical, and then solving the simple linear equations that resulted.

We next derived the formula for parallel resistances R= \frac{1}{\frac{1}{R_{1}}+\frac{1}{R_{2}}+\;\cdots\;+\frac{1}{R_{n}}}, using just Ohm’s Law and Kirchhoff’s  current law. I explained the concept of conductance, and gave them the rule of thumb: resistances add in series, conductances add in parallel.

I then talked a bit about scope probes and worked up to the following circuit:

Approximate circuit for my cheap 60MHz scope probes.

Approximate circuit for my cheap 60MHz scope probes.

Monday I’ll have to talk a little about electrodes and electrochemistry, but I also want students to do another voltage divider exercise in class—perhaps an RC one. Wednesday will be analysis of the data from the stainless-steel electrodes, and Friday will be a simple voltage divider and complex impedance quiz.

2014 April 17

Hysteresis lab ended well

Today’s lab went well, with very little intervention on my part. Students finished up their RC calculations, picked their resistors and capacitors, and got their relaxation oscillators working.  They then adjusted their R or C values to bring the oscillator into spec, if needed. Most of the help I gave during all this was getting the students comfortable with using the Tektronix digital scopes, which have an extremely complicated and confusing menu system. The “autoset” feature on the scopes is almost essential, since they can have been left in any sort of weird state by the previous user, and finding and clearing all the weirdness takes a while.

Students then made their touch sensors (aluminum foil folded up to be sturdy, then wrapped with a layer of packing tape), and connected them to the oscillators. Most students got a substantial change in frequency, as expected, but one group had chosen a large C and small R, and so got almost no change. With only minimal prompting, they figured out why the frequency wasn’t changing, fixed their values and got it working.

The students did observe a change in frequency if they connected a scope probe to the input of the Schmitt trigger, and most eventually figured out that this meant that the scope probe was acting like a capacitor.  When I did it with my scope probe at home, I got a change from 60kHz to 35.22kHz, about a 70% increase in the RC time constant.  Since the capacitor I was using was 30pF, this looks like it implies a 21pF capacitance.   It doesn’t make much difference whether I connect the scope ground to the ground or the 3.3v lead—the change in frequency is the same either way, so we’re seeing an effect due to capacitance, not due to current through the oscilloscope input resistance. I looked up the specs for the input capacitance of my probes, and it is supposed to be 20pF in 10× mode and 130pF in 1× mode.  From that I worked out an approximate circuit for the probe:

Approximate circuit for my cheap 60MHz scope probes.

Approximate circuit for my cheap 60MHz scope probes.

With the 1× probe setting, the 1MΩ input resistance of the oscilloscope matters—connecting up the scope drops the oscillation frequency to 5kHz if the ground of the scope is grounded, and stops oscillation completely if the ground of the scope is connected to 3.3v.

The Bitscope DP01 differential probe, with no jumper plugs in place (so 2:1 setting on the Bitscope screen) reduces the frequency from 59.7kHz to 38.6kHz, implying about a 16.5pF input capacitance, while the spec claims only 2.5pF differential and 5pF common-mode. I don’t seem to be able to get a signal on the BitScope screen with the differential probe in high-gain mode, and I’m not sure why (the voltages shouldn’t be exceeding the voltage limits).  There may be some problem with powering both the BitScope and the device being tested from the same underlying USB power source, though it caused no problems in the low-gain mode.

Students soldered up the boards without problems. The only intermittent error that I had to help debug turned out to be a misuse of an alligator clip (the wire had not been screwed down, but only wrapped around the clip). No one soldered a chip in backwards and I did not need any of the spare boards or chips that I had brought along, just in case.

Luckily not everyone was ready to solder at the same time, as the lab support people had no board holders available, so only the two I brought from home were available.  I’ll have to ask them to get some PanaVise juniors (about $27 each) or, if they are too cheap to buy them, then some alligator-clip-based board holders for about $7 each.

Some students had enough time after soldering up their boards that I showed them how to get the frequency information that the KL25Z program was reporting to the SDA USB serial port (using the Arduino Serial Monitor).  Unfortunately, the old version of Windows running on the lab computers seems to have serious problems with cut-and-paste operations, and it was difficult to get more than a screenful of data that way.

2013 February 2

Eleventh day of circuit class

Filed under: Circuits course — gasstationwithoutpumps @ 01:02
Tags: , , , , ,

In today’s class, I planned a discussion of amplifiers.  Because several students were late getting to class, I started with an informal request for suggestions for the phototransistor and FET lab.  I mentioned some of the labs I had rejected (like the MIT lab on DNA melting or the pulse sensor), and mentioned some of the rather boring ones I had come up with.  Students expressed an interest in a sound-based lab, so I promised to look into that.  I have a couple of ideas to try out this weekend, and I’ll blog about them in a separate post once I’ve tried them out.  I have to work quickly though, as I need to get out the lab handout by Wednesday, to give the students a week to read it.  I also have a pile of lab reports to grade and a quiz to write, so this weekend will be pretty busy.

I started today’s amplifier talk by comparing digital and linear amplifiers.  We had already discussed digital amplifiers for the hysteresis lab, so I only had to remind them of that and compare the different notions of gain (both being the slope of a line on the Vout vs. Vin graph).  I mentioned that there are other amplifiers besides voltage amplifiers, but that we would concentrate of voltage in-voltage out amplifiers.

We then covered inverting vs. non-inverting amplifiers, and I got someone to guess correctly that an inverting linear amplifier had negative gain and a downward slope on the Vout vs. Vin graph.

I then moved to differential amplifiers, getting them to derive the Vout=gain(Vp-Vm) formula from what they would want a differential amplifier to me. We then discussed power supplies, input impedance, and output impedance.  It was clear that the students are still struggling with what it means in terms of current to have a very high or very low impedance, but eventually the group managed to converge on the idea that a large input impedance and a small output impedance were desirable. I then declared by fiat (since the idea makes no sense until you use it for a while), that the building block we wanted was a very high gain amplifier (gain over 1000).

Somewhere in there (I don’t remember the order exactly 10 hours later), we had a digression to discuss what the 1x/10x switch on the oscilloscope probes meant. I was pleased that I could remember the oscilloscope input specs (10MΩ in parallel with 25pF), which are conveniently printed on the scopes (doing me no good when the scopes are in a different building from the classroom). Now that I get home and can look at my scope, I see that it is really 1MΩ and 25pF for the Kikusui COS5060 on my bench. Checking on-line, the COS5041 scopes in the lab have the same input impedance. The Tektronix digital scopes are 1MΩ in parallel with 13pF. So I’ll have to tell students to correct their notes: the scopes are 1MΩ input resistance, not 10MΩ, and the 10x switch puts in a 9MΩ resistor, not a 90MΩ resistor.

We did not talk about the other characteristics of real amplifiers, but started looking at ideal op amps, with infinite input impedance, zero output impedance, and infinite gain.  I did (repeatedly) say that real circuits can’t achieve these ideals, and that we need to check after doing a design, whether the real op amp chips are close enough that the simplifying assumptions are reasonable.  I also reassured them that for the low-frequency designs they’ll be doing in the class, the simplifying assumptions are almost always good.

I did not say that the chips we are using have a gain-bandwidth product of 1MHz, because they would have had no idea what I was talking about, but for the pressure sensor and the EKG lab, where the top frequency is around 100Hz, we have much more gain available than we need.  I did mention that we should have a gain around 1000 at 1kHz, and that was plenty.  I will have to discuss slew rates later this quarter, since the class-D amplifier does not work efficiently with the low slew rates of the op amps and needs a high-speed comparator chip.

I had the students derive the first rule of linear design with op amps: that the inputs have the same voltage.  This is a consequence of having infinite gain but only a finite voltage output.

After giving them the idea of an op amp, we had only a few minutes left, so I gave them the simplest of op-amp circuits, which needs no extra components:

The unity-gain buffer (or voltage follower)—the simplest of op-amp circuits.

The unity-gain buffer (or voltage follower)—the simplest of op-amp circuits.

I managed to talk them into believing that the output is the same voltage as the input, not just from the first rule of op amps, but by talking them through what would happen if the input went up, and how the output would have to go up until the difference was zero again. I then tried to get them to think about why one might want an amplifier that wouldn’t change the voltage at all. I tried getting them to compare the effect of a voltage source with a large series resistor driving a resistive load (the voltage divider that is the main theme of the course), with the same source driving the unity-gain buffer which drives the source. I reminded them of oscilloscope probe discussion, where we had talked about the advantages of having the extra series resistance in the probe, despite the smaller signal.

I think that one or two students understood the point of the unity-gain buffer, but I’m not sure that most of them got it. We were out of time, though, so I couldn’t go back and do another approach.

On Monday, we’ll have the quiz. If there is time, I’ll continue the discussion of op amps, but I suspect that too many of the students will have put off reading anything about op amps until after the quiz, so there might not be much point until Wednesday. I also suspect that I’ll make the quiz too long, and we’ll end up using up the whole period on it. I am going to try to scaffold the quiz, with easy questions leading up to harder ones, so that the students are primed with the right ideas for the harder questions. I just hope that is enough to get them past their panicked search for formulas to memorize that cause so many of them to freeze whenever they encounter a slightly unfamiliar problem.

I really want the students to do some of the reading on op amp circuits before Wednesday, so that I can be clarifying and reinforcing ideas for them, rather than having to be their first encounter with the ideas.  I think that today’s difficulty in getting any response from the students (even when I was asking for guesses) was in part due to them not having read any of the amplifier material yet.  They’ve certainly been much livelier in earlier classes.

On Wednesday, I’ll want to have a brainstorming session on the design they need to wire up and debug in Thursday’s lab, so we’ll have to cover non-inverting feedback amplifiers and how to compute their gain (voltage dividers!) fairly quickly. I’ll want them to bring copies of the lab handout to class, so that they can double-check the design constraints and goals as we do the brainstorming. They’ll need to add DC-blocking capacitors (high-pass filters) between the mic and the amplifier, so this might be a very good time to introduce them to block diagrams. It might also be a good time for small group discussions (groups of 3 or 4 students), designing together what each of the blocks needs to contain.

%d bloggers like this: