# Gas station without pumps

## 2015 April 9

### Second half of temperature lab went well

Filed under: Circuits course — gasstationwithoutpumps @ 21:11
Tags: , , ,

I continue to be pleased with this Spring’s class.  It is taking up far too much of my time, but the students are doing well. Today they got their resistors (and ceramic capacitors), so they could select whatever resistor value they needed for the optimization problem.  I told them by e-mail last night to optimize for 12°C, which I estimated would require about a 12kΩ resistor.  I change the temperature point each year, so that students can’t just look up an answer—not that it would do them much good if they could, as the design report needs to contain the derivation of the result.  If they can copy the math correctly, then they can do it (especially since we did the derivation in class yesterday).

I put some reminders/instructions on the board at the beginning of lab, something like the following:

• Optimize for max sensitivity @ 12°C
• Measure Vin
• Measure Vout at many temperatures
• Plot Vout vs temp both from model (as curve) and as data points, to check calibration.
• Plot temp vs time for 10 minutes of water warming up from low temperature (using PteroDAQ)

Everyone seemed to be getting good data in the lab.  What students seemed to need the most help with was the concept of putting the predicted behavior of the circuit on the same graph with the measured behavior. They had a formula for the voltage as a function of temperature with 4 parameters: B and R∞ from fitting Tuesday’s data, R that they chose and measured, and Vin that they measured though it was nominally 3.3V. But it was hard going trying to convince them to plot that curve on the same graph as the scatter diagram of today’s measurements.  It may be that they have never been asked to plot a predicted curve and measurements on the same plot before—as if they’ve never actually checked that a model is correct. I would have thought that physics classes would have done that sort of predictive modeling, but apparently not, as the concept seemed completely foreign to many of the students.

Those who did finally get the calibration plot done generally had very good agreement between their measurements and the predicted model.  I’m hoping the rest will get the plots done tonight.  There was at least one group that was seeing about a 0.5°C discrepancy, which could be due to different calibration of the thermometers used on Tuesday and today, or could be due to their using a wrong value for the °C to °K conversion.

The students also recorded a time course of a water bath warming up from about 3°C. I think that next year I might do a higher optimum temperature and ask students to record a water bath cooling down—the temperature change is faster that way (due to evaporation). I’ve asked them to plot this as temperature vs. time, not voltage vs. time, and several students seemed well on their way to doing that correctly—this year’s class seems much more adept at picking up gnuplot techniques than the last two years’ classes.  I don’t know whether that is because of a better ordering of the material this year, or some difference in the cohort.  I like to think it is an improvement in the way I present things, but it is more likely to be a difference in the students.

One pair of students surprised me in a good way—they had done the optimization last night, then tried out the design at home, using the PteroDAQ to read voltage.  Since they did not have the resistor kits yet, they had put the two 22kΩ resistors they did have in parallel to make an 11kΩ resistor.  They were worried I might be upset with them for jumping the gun on the lab—quite the contrary, I’m delighted that they’re preparing before class, and that they realized that a lot of the lab work doesn’t really require the fancy equipment in the lab. I’ve pitched the class as being suitable for creating electronics hobbyists, and if some of them get into that early in the course, then the course is being highly successful!

I’ve even considered rewriting a number of the labs to be doable completely at home, but right now too many would require about a $250 investment in a USB oscilloscope, which makes an all-at-home approach a bit too expensive for me to recommend. It might be an interesting way to market the book though—as a complete electronics at home lab course for about$400.  I think that there is a substantial market for such a kit/course, but it would be a fair amount of work to get the book into shape for use without a lab mentor to guide the students through the rough spots.

I’m looking forward to this week’s reports (that’s right, for once I’m looking forward to the grading, rather than dreading it), as I think that a lot of the class actually got all the concepts that this week’s lab was about.

Tomorrow I’ll be introducing complex impedance (particularly $Z_{C} = \frac{1}{j\omega C}$) and RC filters as voltage dividers.  I’ll be doing most of the lecture as a chalk talk, but I’ll bring my laptop to show them how to create (amplitude) Bode plots with gnuplot.  We’ll be doing various things with model fitting, with variants on voltage dividers, and with complex impedance for the next 3 weeks, and then we’ll start on amplifiers.

## 2015 April 8

### Temperature lab went well

Filed under: Circuits course — gasstationwithoutpumps @ 08:28
Tags: , , ,

The lab for characterizing the thermistors went well—more smoothy than the last two years.  It may be because the lab is now in the second week, rather than the first week, or it may be because I required prelab homework be turned in on Monday, so that students came to lab already prepared, or it may just be that this year’s class is more prepared than previous ones.  I suspect that the main difference is in the prelab requirement, but that may be because that is about the only thing I can really control.

I went into the lab an hour early, to set up the coffee urn with hot water, get ice from the ice machine in the lab upstairs, and check each of the thermometers in ice water.  The cheap student glass thermometers all ready between -1°C and 0°C, but several of the digital thermometers were way off (reading as much as 4°C).  I separated out the digital thermometers that read over 0.5°C and marked them with blue tape as miscalibrated.  (I can believe temperatures slightly below 0°C, since the ice water was tap water, not distilled water, but temperatures over 0°C were almost certainly wrong.)

I started by showing the students how to interpret the part number for the NTCLE428E3103F520L thermistor we were using, since half the class had not figured out that it was a 10kΩ thermistor on the homework.  The data sheet is rather tricky, but in a common way: it is the data sheet for a family of parts, with a key for decoding the part number.

The students managed to collect 20–90 data points of temperature and resistance, with varying levels of noise.  I had them plot the data after they had collected some points, and suggested to students that they fill in more points where they had gaps in the curve, or where they had “bumpy” spots that did not fall along a smooth curve (suggesting measurement errors), and pushing them to get lower and higher temperature measurements.  Students with good lab skills managed to get a lot of data points from 2°C up to 69°C.  The water in the coffee urn was a bit hotter than that, but by the time they got the water back to their benches and made measurements it had cooled off.  It might be interesting some year to have a hot plate at every bench to let them measure up to 100°C, but I don’t think that the expense of the hot plates would be justified for this one lab—and I’d worry about possible spills.

I was worried enough about spills on this lab, reminding students frequently to carry the secondary containment tubs in both hands, and to put it flat on a level surface whenever they weren’t carrying it.  As it turns out, about the only real spill was mine, trying to pour ice water from one thermos to another, and getting a chunk of ice splashing out.  The spill was small (a few cubic centimeters of ice) and not near the lab equipment, and I could mop it up with a couple of paper towels. I was probably made a bit clumsier than usual by having only gotten 4 hours sleep last night (between grading prelab homework and adding material and exercises to the chapters of the book that the students need to read for Friday and next Monday).  Still I felt bad about being the clumsy one in the room.

There were two glass thermometers broken—one was taken in its case by a student to be properly discarded in a broken-glass disposal bin, but the other was just quietly returned to the bin of thermometers.  I have a lot more respect for the student who reported the broken thermometer than the one who tried to hide it.  The thermometers themselves are cheap (about $3), so the breakage doesn’t bother me, but leaving problems for someone else to deal with does. I had a few of the students send me data, which I will use in class today to show students how to use gnuplot to fit models to data. I also plan to go over the homework problem that only one student got—the optimization to maximize the sensitivity of the voltage divider at a particular operating temperature. ## 2014 September 11 ### Thermal models for power resistor with heatsink Last night I fit a simple thermal model to temperature measurements of some power resistors: $T(t) = PD+A+(T_{0}-PD-A)e^{-t/(DM)}$, where P is the power in watts, D is thermal resistance in °K/W, M is thermal mass in J/°K, A is the ambient temperature in °C, and T0 is the initial temperature. I ran into problems with the 1.8Ω 50W THS501R8J resistor, because it heated up very fast and I could only get a few measurements when delivering power, before I had to turn it off. I proposed adding a heatsink, a 6″×12″ sheet of aluminum 0.063″ thick, to increase the thermal mass M and decrease the thermal resistance D. I estimated that the thermal mass should increase by the heat capacity of that much aluminum (74.33 cm3 at 2.422 J/°K/cm3, giving 180 J/°K), but I did not have a good way to estimate the change in thermal resistance. The 6″×12″ plate is much larger than the power resistor, which is bolted in the center with M3 screws (American 6-32 screws are a little too big for the holes in the resistor). I used a thin layer of white thermal grease to get better thermal conduction between the resistor case and the aluminum plate. I do not expect the simple thermal model to work well, because it assumes that you have an isothermal object—all the aluminum at the same temperature. But a large flat plate is going to have significant thermal spreading resistance, so that the resistor in the center is hotter than the edges of the plate. With a heatsink the time constant DM is about 260s, only a little faster than the 347s without the heatsink, but the thermal resistance is much lower, so the maximum temperature (PD+A) is much lower. As expected, the fit is not great. When cooling off, the initial temperature of the resistor is higher than of the surrounding plate, so the initial cooling at the resistor is faster than the eventual cooling, when resistor and the plate are closer in temperature, because heat is being transferred to the plate as well as to the air. The increase in thermal mass (about 100 J/°K) was less than my crude estimate based on the heat capacity of the added aluminum (180 J/°K)—this is probably also due to the thermal spreading resistance and the non-uniform temperature of the heatsink. resistance rated power heatsink? test power M [J/°K] D [°K/W] DM [s] T [°C] 10.10Ω 100W No 8.288W 101.7 6.38 649 75.7 8.21Ω 50W No 10.169W 32 11.58 371 143.7 1.81Ω 50W No 43.174W 31.9 10.87 347 495.8 1.81Ω 50W Yes 43.174W 131.7 1.97 260 110.3 Note: the asymptotic temperature T in the table above is with the 9V power supply I have, which does not have quite constant voltage over the range of powers tested. With a 12v supply, temperatures would be much higher: $D V^2/R +A$. The asymptotic temperature is also the maximum when the resistor is sitting in still air that is unconfined. A fan would reduce thermal resistance and make the asymptotic temperature lower, but confining the resistor in a box (like in the incubator design) would make the “ambient” temperature not be constant—the relevant thermal resistance is how slowly the air in the box loses heat, which for the thick-walled styrofoam boxes we’ll use is a very high thermal resistance. Without a feedback loop and PWM to keep the power down, even the 10Ω resistor would get very hot in a styrofoam box. I should probably test the 10Ω 100W resistor on the heatsink also, to see if that reduces the time constant DM. I expect the thermal mass to go up by something between 100 and 180 J/°K, but the thermal resistance to drop to around 1–1.5 °K/W, getting DM in the ballpark of 300s. I don’t think I’ll do that today, though, as making measurements every 20 seconds for 2000 seconds is tedious and leads to cramping in the hand that aims the IR thermometer and keeps the trigger pulled. Which raises a pedagogical question: Should I have students do the measurements? Should I show them how to make a recording thermometer with a thermistor first? They’ll need to figure out how to use a thermistor for measuring air temperature anyway. The thermistors I have at home (NTCLE100E3103JB0) only go up to 125°C, and I’d want them to have one that goes to at least 175°C for this lab, which means using something like NTCLG100E2103JB (10kΩ, ±5%, ±1.3% on B-value, -40°C to 200°C), which is only 35¢ in 10s, so still cheap. I should get myself some of these higher temperature thermistors and test out the recording . (Or the tighter tolerance NTCLE203E3103SB0, which only goes up to 150°C, or the wider temperature range 135-103LAF-J01, which goes to 300°C.) How will I attach the thermistor to the resistor for temperature measurement? tape? (I have to be sure not to short out the thermistor leads on the aluminum case of the resistor.) Air temperature sensing poses less of a mounting challenge, but the thermal delays will be quite large—I have to look at how difficult it will be to tune a PID or PI controller with large delays—we really don’t want huge overshoot. If the students have multiple temperature measurements (resistor temperature and air temperature, for example), they may need a more complicated control loop than a simple 1-variable PID controller. How much can we simplify this? (Perhaps a PI or PID controller based on the air temperature, with over-temperature shutdown on the resistor temperature? Then tuning the PID controller with the constraint that the gain be kept low enough to keep the over-temperature shutdown from kicking in?) ## 2014 June 18 ### Temperature-control project for freshman design seminar Filed under: freshman design seminar — gasstationwithoutpumps @ 15:22 Tags: , , Although I was planning to work on my book for the circuits class today, while in the shower I had a couple of thoughts about the freshman design seminar that I’d like to record before I forget them. I need to develop some specific projects that students can work either as preliminaries to doing the main project or as the main project. I want to incorporate some Arduino programming and electronics into the projects, but not too much. Previously, I’d been thinking mainly about using LEDs and phototransistors to do a colorimeter, as it is possible to do the mechanical design fairly simply (using foamcore, for example, to build prototypes). The biggest problem is that amplification is needed, and I don’t think I want to cover amplifiers in a 2-unit freshman course. Today’s idea for a project was to do temperature regulation. It is pretty easy to measure temperature with a thermistor, and I’ve already got a lab project for the circuits class that calibrates a thermistor and records temperature vs. time. Turning a heater on and off (the simplest form of control) is also pretty easy to program, so the students should be able design a closed-loop system that keeps the temperature of something constant. The biggest problem is what they should control the temperature of. I was initially thinking of a small water bath (say a coffee cup with about 200ml of water) and was trying to work out how powerful a heater would be needed. Since water has a heat capacity of about 4.18 J/(g ºC), heating 200ml by 1ºC requires about 836 J, and raising it 0.2ºC/sec requires 167W. That’s a lot more power than a microcontroller can handle, and it is more than the bench power supplies in the lab can supply (5A@6V, 1A@25V, and 1A@–25V). The little immersion heaters for heating coffee in a cup run around 500W and could be controlled by a relay board, but I think that they are too dangerous to use in the lab (if they are powered without being immersed, they can fail spectacularly). A 1-liter electric tea kettle runs about 1kW (about as much as the 10A relays on the cheap relay control boards can handle), but already includes some thermostatic control. Do I want freshman playing with mains electricity, though? Air is easier to heat, about 1J/(g ºC), and much lighter than water, about 1–1.3 kg/m3 or 1–1.3 g/l, so heating a liter of air only takes about 1–1.3 J/ºC and a 5W heater should be able to raise air temperature in a closed box by 4 ºC/s. A small cardboard box suitable for building a little temperature-controlled space has an interior volume around 6l and the biggest size cardboard box they’d likely want to work with would be about 44l. So a 10W heater in the little box would raise the temperature about 1 ºC/s and in the big box about 0.2 ºC/s. Those are reasonable rates to be working with. I can get 10W resistors for under 50¢ each and 30W resistors for about$2.50, so the parts cost is low enough also. We could use relays or nFETs to control the resistors. The AOI518 nFETS that I used in the circuits class this year have only about an 8mΩ on-resistance under the conditions we’d be using them (2A–5A source current and 5V VGS).

Students could build up the project gradually, starting with a thermistor temperature measurement, adding a heater and on-off control, adding a 12v power supply, adding a circulation fan, maybe adding a servo-controlled vent, adding insulation, maybe adding proportional control instead of on-off control, … .

Construction, using bread boards, an Arduino, and cardboard boxes, is pretty simple and does not require any tools more sophisticated than an exacto knife.

The controlled-temperature box looks cheap enough and easy enough (as long as it only has to heat and not cool) to be a useful project for the freshman design course.

## 2013 January 14

### Fourth day of circuits class

Filed under: Circuits course — gasstationwithoutpumps @ 18:36
Tags: , , , , , ,

Today’s class went much better than last Friday’s.

I took the advice one of the students gave me last we and started with a “do now” question.  (She had actually suggested an “exit ticket”, but I don’t have the time management skills to leave a block of time at the end of class.)  The question I asked was a design task that was easy if you knew what you were doing, but subtly harder than the standard sort of text-book question, because it was a design question, not an analysis question:

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

I gave the students 10 minutes to work on this at the beginning of class.  A good question to prompt discussion (according to the peer instruction blogs and websites) should be answerable by 30–80% of the students.  More than that and the question was too easy to be useful, and less than that and the question is too hard for peer discussion to be worthwhile.  It turned out that no one had gotten it after 10 minutes (too hard to use as a peer instruction question), so we used it as the basis for a class discussion.

Almost everyone realized that the desired circuit was a voltage source and a voltage divider (not too surprising, since that’s the only circuit they’ve used so far).  The majority also realized that the variable resistor had to be on the lower leg, between the output and ground, and a couple of the students could articulate why.  I suggested the common heuristic of trying extreme values (0 and ∞) for the variable resistor, to see whether the output voltage would go up or down as the resistance changed.

The students were then able to set up the simultaneous equations to solve for the input voltage and the fixed resistance.  The hole in everyone’s thinking when working on the problem initially is that they had not considered the voltage of the source as a design parameter to solve for, though one student had asked about it. This was the blind spot I was expecting, so I was able to use it as a teachable moment.  After we had the equations set up using mainly student input, I gave the students another minute or two to solve them, and about half the class was able to solve them correctly in the time provided. (I suspect that everyone could have if given enough time, but I didn’t want to take any more time in class—those who didn’t solve it in class could practice their algebra at home if they needed to.)  One student had made an algebra or arithmetic mistake, and gotten a source voltage smaller than one of the desired output voltages.  This was also a good mistake to get, since we could use it to talk about sanity checks on results.

I think that the 20 or so minutes of class was well spent, as we uncovered several important misconceptions, and raised awareness of all unspecified variables as potential design parameters, reasoning using extreme values, and the usefulness of sanity checks.

After that, we spent some time discussing different temperature sensors.  From the students, I got thermistor, infrared thermometer, mercury thermometer+camera, and enzyme + other sensor (pH, conductivity, color, …). I added RTD, silicon band-gap, and thermocouple to the mix.  We talked a little about the advantages and disadvantages of each. At the end, I also threw in bimetallic strips and tilt switches for one-bit digitization of temperature.  I wonder how many students will look at the thermostats in their apartments and try to figure out what sensor they include.

For the remainder of the class, we talked about gnuplot commands, particularly the “plot” command.

After class, several of us went over to the lab, where my son met us and helped the students install the DataLoger, python, pyserial, the Arduino environment, and gnuplot.  While he was doing that, I borrowed an Uno R3 Arduino board and made sure that all the computers in the labs had the drivers installed for it.  We had 2 installation failures: on one Windows laptop, my son was unable to get the serial ports to work and one Mac laptop couldn’t install gnuplot.

The problem with the gnuplot installation on that Mac was not solvable by the techniques in the comments for Installing gnuplot—a nightmare, because all the methods there assume that you can install the command-line tools “make” and “gcc”.  The Mac had 10.6.8 installed, but the student had never bothered to install the development tools and had lost the original CD-ROM with the Xcode tools on it.  The Apple Developer site does not provide the command-line tools for anything older than 10.7.3.  The only workaround we could find was to download the 4.1GByte complete Xcode suite for OS 10.6.8, which I was not willing to wait around for. (Other students with 10.6.8 had no trouble installing gnuplot, because they already had the command-line tools, though they’d never used them.)

I did not look at the problem on the Windows machine (the student had to leave for class before I became available), but I don’t know that I could have done anything—my son knows more about Windows than I do, so if he was stuck, I probably would have been also.

Next year I’m going to want to do an install session before the first lab.  (Or, if we go to 2 labs a week, as the first lab.)

On Wednesday, I’ll start with another “do now” question, though I’m not sure what it’ll be on, since I’ve not yet gotten to the material for this week’s lab: how a microphone works. I’ll do a tiny bit of gnuplot (just the “fit” command) and try to get through how a microphone works and an idealized i-vs-v plot for the FET output of the microphone.

Next Page »