Gas station without pumps

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.


2015 April 4

JanSport warranty not something to wait for

Filed under: Uncategorized — gasstationwithoutpumps @ 20:27
Tags: , ,

As I reported in Testing JanSport warranty and JanSport warranty works, I got a replacement backpack from JanSport for a worn-out one that I sent in for warranty repair or replacement.  It took about a month, and the new pack was their closest current equivalent to the old one (not quite as well-designed for my needs, but ok).

In December, I found another worn-out JanSport pack in our hall closet—my wife, my son, and I all wear backpacks daily, sometimes with heavy loads of books or groceries, so we wear out packs fairly often.  So I sent it in for warranty repair also (the $5.32 shipping is less than the price of even a much lower-quality backpack). It took JanSport a month to email acknowledgment of receipt of the backpack, and another 10 weeks to send us a replacement pack (in black, rather than the original grey, but black is an acceptable color for us).

The replacement pack seems to be very similar in features and quality to the one it replaces, so my only complaint about JanSport’s warranty

JanSport engineers quality, durable, and reliable products. So, if your pack ever breaks down, simply return it to our warranty center. We’ll fix it or if we can’t we’ll replace it or refund it. We stand by our packs for a lifetime and since we’ve been making packs since 1967, that’s a guarantee you can stand by.  []

is how very slow they are at following through on the promise.  It should not take them 3.5 months to recognize that a pack is worn out beyond repair and send a replacement.

Third lecture: resistance and voltage dividers

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

Yesterday’s lecture was pure chalk talk, with no projector.  I took a number of somewhat random questions from students, then started on getting the class to try to define resistance. I got a number of fairly vague statements, until someone dredged up Ohm’s Law from their high school physics classes (or perhaps the reading they were supposed to have done before class), and suggested voltage divided by current, which is a good answer for this course.  I then explained to them the difference between resistance (V/I) and dynamic resistance (dV/dI) for non-linear devices, but I think that confused people more than helped them.  I should probably wait on the concept of dynamic resistance until they actually need it (perhaps with the electret mic?).

A question came up about how resistors were made, which I hadn’t planned to talk about, but was a reasonable digression, so I described wire-wound, metal-film, and carbon resistors.  We won’t use wire-wound resistors in this class, but half the class will have 1% metal-film resistors (bought last year) and half will have 5% carbon resistors (what the staff bought this year).  Maybe I’ll bring in a wire-wound power resistor to show them what they look like—the cooling fins on a 100W resistor are fairly impressive. I did tell them that they could experiment with carbon resistors by using pencil leads of different lengths, diameters, and compositions (the hardness of a pencil lead is dependent on the graphite/clay ratio, and the graphite is the carbon part of a carbon resistor).

I had the students do a simple Ohm’s Law exercise (3.3V across 1kΩ), then introduced a voltage divider with 5V across 2 1kΩ resistors in series. I had the students work out the current (after first getting them to realize that we needed to add a constraint that the current through the output is known to be 0A), and then the voltage output of the voltage divider.  I also had them work out what the effect would be if we tied the Vout node to ground, instead of having no current through it.

Throughout the class I relied on dice-assisted cold calling, so that students had to keep paying attention, lest they get called on without having thought about the question. As suggested in Teach Like a Champion, I asked the question before rolling the dice and choosing who would answer, so that (almost) all students were engaged with the question for at least a little while. I had 32 students registered in the class, so I was using D100 divided by 3 (round up) to get numbers on the class list, which is a bit slow.  I think I’ll switch to rolling a D8 and a D4, and computing 4*(D8-1)+D4 to get the numbers.

I did not get quite as far as I wanted to—we did not get to the general form of voltage dividers with all symbolic values (and I suspect that half the students are still having trouble switching from arithmetic to algebra, despite having had a couple of calculus classes and possibly more math). The material is in the book, which the students were supposed to have read before class (and probably didn’t), so they should be able to do the homework exercises for Monday’s class.

On Monday I’ll take questions about voltage dividers (I suspect that there will be some) and do a quick derivation of the Vout/Vin = R1 / (R1+R2) formula, perhaps in the form Vout/R1 = Vin/(R1+R2), since that corresponds directly to the notion of the currents being the same.  The rest of Monday’s lecture will be about temperature measurement using thermistors, RTDs, thermocouples, and diode junctions. I probably won’t have time for all of those, so I’ll concentrate on thermistors (which we’ll use in next week’s lab) and RTDs  (which are used for high-precision measurements in biological temperature ranges).  I don’t really care if we don’t cover thermocouples and diode-based temperature sensors, as neither are particularly important for bioengineers, and I have some material on them in the reading they are supposed to do by Monday..


2015 April 2

Moving sampling lab early was a good idea

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

This year I moved the sampling and aliasing lab to the first week, from the middle of the quarter.  To do this, I had to remove the design component from the lab: I gave them the circuit for the high-pass filter that re-centers the function generator output halfway between the power rails.  I didn’t tell the students that the function generator has the ability to set a DC offset itself, so we could have done the observations without building the filter, because a big point of the lab was to get students to translate a schematic into components and wires on a breadboard.  I was worried that the lab would not make sense before we’d covered RC filters, but by treating the filter as “magic” to be explained later, we could concentrate on the lab skills of wiring and running the PteroDAQ software, without them having to figure out a design at the same time.  The rest of the quarter will all be design labs.

I started the lab class with a mini-lecture covering:

  • block diagram.  I constructed a block diagram starting from the two ends: the function generator and the PteroDAQ, and working out what was needed in the middle to make the output of the function generator match the input of the KL25Z analog-to-digital converter in the PteroDAQ.
  • schematic. I redrew the schematic from my book:
    The DC-blocking filter they built has a corner frequency of 0.03Hz, and they were looking at waveforms in the 1Hz–25Hz range.

    The DC-blocking filter they built has a corner frequency of 0.03Hz, and they were looking at waveforms in the 1Hz–25Hz range.

    I explained briefly how capacitors block DC but allow AC currents, how electrolytic capacitors work, and how the insulating layer self-repairs when the voltage is in the right polarity and how it can catastrophically fail with the polarity reversed.  (I did mention blowing up capacitors.)  I did not explain RC time constants, high-pass filters, or even voltage dividers, promising that all the theory for this circuit would be coming over the next two weeks.

  • resistor color codes. I did not give the full resistor color code, but just explained the red-red-orange-gold bands on the 22E3Ω±5% resistors we had.
  • breadboard layout. I explained what holes were connected to what on the breadboards, and why the central channel was there (for dual-inline packages, which also dictate the 0.1″ spacing).
  • black/red color convention. I insist on students using black for GND and only for GND, and using red for the positive power rail (3.3V in this case) and only for the positive power rail.  I handed out about 4″ each of red, black, blue, and green 22-gauge wire to each pair of students.  (The lab has a couple of big spools of white and orange 24-gauge wire, but I’ve found 24-gauge unreliable in breadboards, so we’re going to use small amounts of 22-gauge instead.)
  • plotting two channels with gnuplot.  The assignment called for plotting the same signal twice, once at 50Hz and again down-sampled 10× to 5Hz), so I needed to show them how to plot both on the same plot in gnuplot (plot “data.txt” using 1:2, “data.txt” using 1:3 ).
  • V always relative to ground.  I reminded students that voltage is always the difference between points, and when we talk about the voltage at one node (like at the input), we always mean relative to the special node we call ground.
  • SchemeIt to create schematics.  I suggested to students that since the report this week is primarily about learning to use the tools they’ll need all quarter, it would be best if they reproduced the schematic using SchemeIt, rather than just cutting-and-pasting from the book.
  • function generator and oscilloscope demo. I demonstrated the use of the function generator and told them about the peak-to-peak voltage being a deliberate lie and needing to double what the function generator claims the output is (since we don’t use the expected 50Ω load, but an effectively infinite resistance).

After the mini-lecture, I had the students set up the function generators and observe the output on the digital oscilloscopes.  They also built their circuits, which I inspected before they powered them up.  There were the usual confusions about what holes were connected, but they seemed to clear up faster than usual this year.  For the morning lab, I had not mentioned the “V relative to ground” convention at the beginning of class and had to do a very short mini-lecture in the middle of class.  Perhaps because I made notes on the board of everything I ended up covering in the first lab, the second lab went a lot smoother.

I did find out this evening that one group had not read the assignment properly and missed the whole point of the sampling and aliasing lab—they only recorded one channel of data, not two at different sampling frequencies.  They’ll borrow correct data from another group (with appropriate credit).  I hope that the other group put appropriate metadata in the notes, so they can figure out what they are looking at.  I also hope that finding out at the last minute that they’d done the lab wrong will induce the students to read the assignments before lab in future, when the stakes are higher.  I am requiring pre-lab homework to be turned in on Mondays starting next week, so there will at least be a deadline before lab for them to have done some of the reading and thinking.

The students still have not gotten their full parts and tools kits.  They got breadboards and electrolytic capacitors today—we only loaned the 22kΩ resistors, since the resistor assortments have not arrived yet.

I was in the lab essentially all day 9:45—17:45, except for a break to eat my lunch just outside the lab between the two lab sections.  During that time I helped a lot of the students with installing the software they needed.  Incidentally, the widened hallway outside the lab is a popular study spot for engineering students (there are frequent formal and informal group study sessions there)—the area has been informally named “Jack’s Lounge” after the picture of a generous donor at the entrance (Jack Baskin, after whom both the building and the School of Engineering is named).  I don’t know if the implication is intended to be that Jack’s idea of “lounging” is studying hard, but if so it is rather flattering to him.

Next week’s lab will probably require more of my time, as they involve the temperature measurements, and I have to set up the hot water urn and ice water well before class starts.

2015 April 1

Second lecture in Spring 2015 electronics

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

The lecture today started by me redoing the demo that failed on Monday, showing them how to run PteroDAQ and display the results with gnuplot.  Everything worked fine this time. I even showed them the use of two channels, by putting the Bandgap voltage reference (1v) on the second channel, and plotting its variation over time:

The ADC was measuring consistently slightly low (probably because the power supply voltage had drifted a little) from when PteroDAQ measured the bandgap reference to set the calibration).

The ADC was measuring consistently slightly low (probably because the power supply voltage had drifted a little) from when PteroDAQ measured the bandgap reference to set the calibration).

I showed them how to plot the signal divided by the bandgap signal to correct for such calibration problems.  The plot also gave a good segue to talking about resolution, precision (which I equated with repeatability), and accuracy, because the step size of about 50µV for the ADC is clearly visible (3.3V/216), but the signal is not repeatable to 50µV.  The precision is limited to about ±200µV and the inaccuracy can be as much as 700µV.

I then walked them through a gnuplot script for demonstrating sampling:

# frequencies in Hz
sine_freq = 1.100 *1.0
sample_freq= 40. *1.0

sampled(t) = sine_wave( floor(t*sample_freq+0.5)/sample_freq )

set title sprintf("Sine wave of %.2fHz, sampled at %.2fHz", sine_freq, sample_freq)
set xlabel "time [seconds]"
set ylabel "signal"

set samples 5000
set yrange[-1.05:1.05]
set xrange [0:2]
plot sampled(x) notitle, sine_wave(x) lt 3 notitle

which produces a simple example of discrete-time sampling:

Sampling a 1.1Hz signal at 40Hz does a good job of representing the waveform.

Sampling a 1.1Hz signal at 40Hz does a good job of representing the waveform.

I even explained why I used “lt 3″ for making a red/blue color distinction rather than a red/green one (around 5–7% of males have some form of red-green color blindness).

I then showed them the effect of changing the sampling rate (by alternating “sample_freq=…” and “replot” commands). I think that this will help them with tomorrow’s lab, in which they use the function generators in the lab to generate sine waves, and look at them with PteroDAQ software on the KL25Z boards.

Speaking of PteroDAQ, one of the students in the class and I figured out what was going wrong on the Mac OS 10.10.1 installations of PteroDAQ. It turns out that the problem was not specific to the OS 10.10.1, or even to Macs, as we observed the same problem of not being able to select a port (because the GUI automatically deselected it) even on a Windows 7 box.  It turned out to be a problem in Python 3.4.3 (the latest release on not playing nicely with Tkinter.  Rolling back to Python 3.4.0 fixed the problem (with either Tcl/Tk 8.5 or 8.6).  We’ve not yet looked to see whether 3.4.1 or 3.4.2 work correctly.

The rollback to Python 3.4.0 worked on both Mac OS 10.10.1 and on Windows 7.  The only machines we haven’t yet gotten a demonstrably working PteroDAQ installation are Windows 8 machines—the problem there seems to be installing drivers for the USB port.  The Arduino community has encountered the same problem (Windows 8 insisting on digitally signed drivers) and the community figured out how to turn off that insistence. The instructions there (,94651.msg727588.html#msg727588) are rather scary.  A more tutorial presentation is given by SparkFun at


« Previous PageNext Page »

The Rubric Theme. Blog at


Get every new post delivered to your Inbox.

Join 309 other followers

%d bloggers like this: