# 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.

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.

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.

## 2014 April 16

### Between halves of the hysteresis lab

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

In Hysteresis lab too long, I planned for today’s lecture:

The groups then struggled with coming up with the right RC time constant for their oscillators. I’m probably going go over the calculation in class tomorrow, since I think everyone got a reasonable result, but not everyone was clear enough about their method to write it up well. I want to see clear explanations in the lab report, so I’ll go over it to help them smooth out the bumps in their explanations.

Some other things I want to do tomorrow:

• Talk about Carol Dweck’s work on mindset, as one of the students frequently wonders aloud whether the class is too difficult for her, and some of the other students may be thinking that they “don’t have the ability”. So far as I can tell, everyone in the class has the ability to master all the material in the class—but I need to get them out of “fixed mindset” into “growth mindset” and recognize that they can do more than they credit themselves with, if they are willing to work for it.
• Have them go over their computations of the finger-touch capacitive sensor and compare answers with each other. I want to make sure that they express their answers in standard units (like pF) and that they are careful about units (mixing mils, cm, and F/m probably confused a lot of students).
During the lab time, I had each group come up to use my micrometer to measure a double-thickness of packing tape. I must be using a different roll of tape than in previous years, because we consistently got about 1.7mil (0.043mm) with my Imperial units micrometer (that is we measured 3.4–3.5 mil for the double thickness), while last year I had 2.2mil.  I should probably get a metric one, but I may be too cheap to spend $14 on a tool I use once a year in this class. Besides, this gave me an opportunity to tell students the difference between mil and mm, which most of them did not know. Since a lot of materials still come with thickness specifications in mil, they should at least be aware of the existence of the unit and the potential for confusion. (Several had done the prelab homework assuming 2.2mm, which would be very thick packing tape.) • Assign one of the voltage-divider do-now problems from last year. Perhaps this one? • What is the output voltage for a 3-resistor voltage divider? (I’ll draw the circuit) • 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Ω). And that was pretty much how things went today. I started with the fixed-vs.-growth mindset message, and pointed them to my blog post on Carol Dweck’s book (not for the book or the post, but for the pointers in the post). I then spent a fair amount of time going over one way to estimate the needed RC time constant from the design spec for the period of the oscillator. I tried to make a few points: that we were using the simplest model we could get away with, that there is no point to spending hours on theory when a couple of minutes with 5¢ components would let them adjust the parameters, and that we were re-using the same few formulas over and over again. I told them that I was not going to give them detailed instructions for any of the design tasks—I likened it to the difference between getting a Lego kit with detailed instructions of what pieces to put together, or getting a pile of Lego blocks and being asked to build a box with a particular volume. I’m going to give them bricks, not kits. I did show them the sort of signal one might see on the oscilloscope, just sketching it by hand, and talked with them about where this big deviation from what our model predicted came from (capacitive feedback from the output to the input). I used that as a segue to talking about capacitive voltage dividers, where we derived the formula from our standard voltage divider formula and the impedance of a capacitor. I pointed out that since we had not included this phenomenon in our model, the periods would end up being much smaller than the simple RC calculation suggested. I also told them that they should try to figure out what is going on when they have unexpected results like that—where are the models wrong and does it matter? We spent just a little time on doing the finger-touch capacitance together. I did not set anything up for them, but just asked them to explain how they had done it, writing it up on the board as we went. We ended up with estimates of the finger touch capacitance around 45pF. ## 2014 April 15 ### Hysteresis lab too long After re-reading my notes on last year’s hysteresis lab, I realized that my schedule for this week in the Revised plan for circuits labs, with both the hysteresis lab and the sampling lab in the same week was too ambitious. There was a chance that the students could do the hysteresis lab in 3 hours, but only if they already understood everything in the pre-lab assignment and worked efficiently. A lot of the students, however, only learn by repeatedly bumping into a brick wall, and don’t really have any notion of solving general problems before they encounter them in the lab, so I expected a lot of students to waste time today doing the pre-lab assignment in lab. My expectation there was amply fulfilled. I decided to cancel (or at least postpone) the sampling and aliasing lab, and spend both Tuesday and Thursday on the hysteresis lab. I don’t think we’ll be able to double up the labs next week, but the week after may be a little thinner, and we may be able to squeeze in the sampling and aliasing then. Everyone got the two input thresholds for the 74HC14N Schmitt trigger (with 3.3v inputs) measured, and they all got essentially the same values. Some of them took a long time getting there, because I did not hand them a test circuit, but asked them to come up with one themselves. One group used an adjustable bench power supply for Vin, but the rest (eventually) came up with using a potentiometer as a voltage divider and recording the input and output with the PteroDAQ software. For some, I had to do more guidance than I really liked, getting them to decompose the problem into having the Schmitt trigger as one component with a variable input and the pot as another component with a variable output. Since they had done a very similar setup for the mic lab last week, and I had explained the pot as a variable voltage divider at that time, I had expected them to instantly see how to apply it, but most did not. Still, everyone eventually got it, and I think that the ones who struggled the most now have a much solider understanding of voltage dividers and potentiometers than if I had just given them a circuit to copy. I did get to show the PteroDAQ users a useful feature of the program—by connecting the output to PTD4 (or one of the other digital pins of port A or port D), PteroDAQ can be set to trigger whenever the output changes values. A few sweeps of the pot past the threshold values reveals quite repeatable voltages at which the transition occurs, without having to page through a long trace of uninteresting info. The groups then struggled with coming up with the right RC time constant for their oscillators. I’m probably going go over the calculation in class tomorrow, since I think everyone got a reasonable result, but not everyone was clear enough about their method to write it up well. I want to see clear explanations in the lab report, so I’ll go over it to help them smooth out the bumps in their explanations. Some other things I want to do tomorrow: • Talk about Carol Dweck’s work on mindset, as one of the students frequently wonders aloud whether the class is too difficult for her, and some of the other students may be thinking that they “don’t have the ability”. So far as I can tell, everyone in the class has the ability to master all the material in the class—but I need to get them out of “fixed mindset” into “growth mindset” and recognize that they can do more than they credit themselves with, if they are willing to work for it. • Have them go over their computations of the finger-touch capacitive sensor and compare answers with each other. I want to make sure that they express their answers in standard units (like pF) and that they are careful about units (mixing mils, cm, and F/m probably confused a lot of students). During the lab time, I had each group come up to use my micrometer to measure a double-thickness of packing tape. I must be using a different roll of tape than in previous years, because we consistently got about 1.7mil (0.043mm) with my Imperial units micrometer (that is we measured 3.4–3.5 mil for the double thickness), while last year I had 2.2mil. I should probably get a metric one, but I may be too cheap to spend$14 on a tool I use once a year in this class. Besides, this gave me an opportunity to tell students the difference between mil and mm, which most of them did not know. Since a lot of materials still come with thickness specifications in mil, they should at least be aware of the existence of the unit and the potential for confusion. (Several had done the prelab homework assuming 2.2mm, which would be very thick packing tape.)
• Assign one of the voltage-divider do-now problems from last year. Perhaps this one?
• What is the output voltage for a 3-resistor voltage divider? (I’ll draw the circuit)
• 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Ω).

Two or three of the groups managed to get their relaxation oscillators to oscillate and measured the frequency on the digital scopes. One group got as far as adjusting the R and C values to get the frequency within the spec given in the homework (10kHz to 100kHz), and started the next step (making the capacitance touch sensor out of aluminum foil and packing tape). Lab on Thursday will consist of everyone getting the oscillators working in spec, testing the change in frequency for a finger touch (which may need some capacitor changes, as I think some are using a small R and large C, which won’t have enough frequency change with the small capacitance of a finger touch), testing the oscillator with the KL25Z boards (with my new code), and soldering up the circuits on PC boards.

Students are beginning to get the  message that when they ask me whether some result is right, my answer will be what my father taught me: “Try it and see!” When they ask me for help using the equipment or debugging when they get too frustrated, I’m more helpful, but I’m not going to check their work for them when the real world can do that so much better.  Besides, the simple models we are using are not all that accurate—even if they do a perfect job of the computation, the real-world behavior will be enough different that they’ll need to tweak the component values anyway. This is another lesson I want them to get—the real world is not as simple as the spherical-cow models used in physics classes and intro EE, but the spherical-cow models are nonetheless useful.

## 2014 April 14

### Hysteresis lecture

Filed under: Circuits course — gasstationwithoutpumps @ 23:16
Tags: , , ,

Today’s class started with feedback on their second design reports (the electret mic lab). Everyone in the class got a “redo” on this assignment.  Some of them actually had pretty good write-ups, but I had warned them that errors on schematics or with units would trigger automatic redos, and every report had at least one serious error (like 200A, instead of 200µA, or short-circuiting the mic). I’m going to hold them to getting their schematics and units right—details matter in engineering, and they have got to develop a habit of double-checking what they write.

After a little more feedback (on how to improve their plots, for example, and little details like capitalizing “Figure 1″ or using the prepositions with voltage and current), I switched to new material on hysteresis that they’ll need for tomorrow’s lab.  I actually gave them a fairly detailed description of hysteresis in the lab handout (I wonder if anyone has read it yet?), but I covered it again anyway. I also talked about DIP vs. SMD parts (the 74HC14N chip they’ll use is in a DIP), and introduced them to a simple relaxation oscillator.  We worked through how it functioned to produce a triangle wave on the input and square wave on the output, but I did not mention the capacitive coupling from the output to the input that changes the triangle wave rather dramatically when the capacitor in the RC circuit is small.

Input (yellow) and output (green) of a Schmitt-trigger relaxation oscillator (approx 67kHz). Note that the large output step is capacitively coupled to the input, causing a small step in addition to the expected triangle wave.  Note, the two traces are separate sweeps and the frequency modulation by 60Hz noise is big enough that the periods are not exactly the same on the two sweeps.  (click to embiggen)

The funny step in the input is not visible if large capacitors are used, but accounts for a big part of the charge transfer for small capacitors (throwing off the RC calculations that determine period).

With a 680kΩ resistor and a 10pF capacitor, attaching a BitScope probe to the input changes the period from about 4.5µs to about 14µs. With the same resistor and a 30pF capacitor, attaching the probe changes the period from 17.5µs to 28.5µs—the change due to the input impedance of the scope makes a big difference in the behavior of the circuit. I’ll have to make sure that the students observe the effect that a scope probe has on their circuit—they’re probably still thinking of the measurements as being non-disruptive.  (They may get even bigger changes in period with standard oscilloscope probes—with the 30pF capacitor I get periods of 220µs for a 1× probe and 30µs with a 10× probe on my Kikusui oscilloscope—the BitScope input is similar to the 10× probe.)

Last year’s hysteresis oscillator lab ran quite long, but I’m hoping for better time tomorrow. I went through the behavior of the oscillator a bit more thoroughly, and I think I impressed on them the importance of doing the algebra and calculations before lab time. I also suggested how they could find the input threshold voltages using PteroDAQ at home (triggering on both rising and falling edges).

Next Page »