Gas station without pumps

2016 May 3

Revised pressure sensor lab went very well

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

Today I ran a revised version of the pressure sensor lab (see
Pressure-sensor lab went well, Class-D lab revision didn’t work, Blood pressure monitor, Blood pressure lab, and Blood pressure lab part 2 for descriptions of the old labs).

The revised lab included both blood pressure cuffs and breath pressure using the simplified breath pressure apparatus of Simplified breath pressure apparatus:

The ½" elbow is small enough that I can put my lips around the opening, which would have been a bit difficult with the 1" tee.

The ½” elbow is small enough that I can put my lips around the opening, which would have been a bit difficult with the 1″ tee.

To make the apparatus, the students had to drill 2mm holes in PVC elbows, so I packed up my drill press last night and hauled up the hill in my bike trailer this morning.  For those unfamiliar with Santa Cruz, that is a 3-mile ride with a fairly steady 4% slope, resulting in a climb of about 715′ (218m).  Needless to say, I went slower than usual uphill!  There is a drill press only about 150′ from the lab the students were working in, but the bureaucracy for getting the students access to the drill press is incredible (I tried, and failed, to get a dozen students access last quarter). So it was easier for me to haul my own drill press up the hill on my bike than to deal with the dysfunctional bureaucracy at UCSC to use the drill press supposedly there for student use.

I explained to each pair of students how to use a drill press, including basic safety precautions, and had them drill a 2mm diameter hole in their PVC elbows.  There were no problems with this, and I plan to do the same for the lab in future.

Each pair of students designed an instrumentation amplifier with an INA126P chip as a first stage and an op-amp as a second stage, wired it up on breadboards, checked the calibration, and recorded both breath pressure and blood cuff pressure.  A few students used extra time to play around with some toys I brought in: a hand vacuum pump, a Lego pneumatics pump, and an aquarium air pump.  One group even tried using the pressure sensor as a microphone, using a loudspeaker with a 300Hz sine wave for input (the pressure sensor could detect the 300Hz input without problems, though I suspect that it was not registering the full pressure fluctuation, as I think that the sensor has about a 200Hz bandwidth).

Most groups were done with this week’s lab in the 3 hours of today’s lab, so Thursday’s lab will consist mostly of students doing make-up work to redo old labs, with a few finishing up this week’s lab.  I expect to spend most of Thursday’s lab time grading design reports (I’m about 2 days behind—I got the design reports that were turned in a week ago done and returned yesterday, and I got the prelabs turned in yesterday done and returned today, but I haven’t started yet on the reports turned in last Friday, nor the stack of redone work turned in last week).

The instrumentation-amp lab went surprisingly well this year, despite adding the drill press.  I think that the big advantages over previous years are that they did not have to solder the inst amps this year and that they had already done a multi-stage amplifier for the microphone amp.

I think that I should rewrite the book to introduce multi-stage amplifiers as the default design (since every amplifier they do in the course is now multi-stage), and talk about how to choose the gain for each stage in general, before getting into individual labs.

One minor problem in lab today—students didn’t have the short pieces of tubing to connect up their breath-pressure apparatus.  This turned out to be my fault—I hadn’t included them on the parts list for this year!  Luckily the BELS staff had some pieces leftover from last year, and I had about 20 feet of my own tubing in the box of stuff I’d packed for the lab, so we had enough for everyone to get 6″.

 

2015 September 5

Simplified breath pressure apparatus

Filed under: Circuits course — gasstationwithoutpumps @ 09:45
Tags: , ,

In Breath pressure measurements, I described my first attempt at using PVC to make apparatus for breath-pressure measurements, with a 1″ PVC tee to press against my face:

One leg of the tee holds the 2mm air leak, the stem of the tee holds the barbed fitting for connecting to the pressure sensor, and the other leg of the tee is for putting around my mouth.

One leg of the tee holds the 2mm air leak, the stem of the tee holds the barbed fitting for connecting to the pressure sensor, and the other leg of the tee is for putting around my mouth.

I suggested

Perhaps I should try again with just a 1/2″ female threaded tee—that may be cheap enough that every student can have their own, and only the barbed fittings (which get no flow through them) would be shared.  Students wouldn’t even need to buy their own—I could have a stock of 50 of them, and wash them in a dishwasher after the lab. 

Today, when I went to the hardware store, I did not find any ½” tees with two female threads, so I simplified the design further, eliminating the screw-in plug and just drilling a 5/64″ (2mm) diameter hole into a ½” elbow (one side slip, the other female pipe thread):

The ½" elbow is small enough that I can put my lips around the opening, which would have been a bit difficult with the 1" tee.

The ½” elbow is small enough that I can put my lips around the opening, which would have been a bit difficult with the 1″ tee.

I was able to get similar expiratory breath pressure measurements with either apparatus, but I had trouble getting a good seal for inspiratory measurements with the ½” elbow—I kept getting leaks at the corners of my mouth. None of my measurements today (with either apparatus) got up to the pressures I observed yesterday.  I’ll practice with it a bit more—maybe adding a short length of ½” PVC that I could put a little further into my mouth.  If I can get it to work consistently, it is certainly a cheap enough solution for every student to have their own—79¢ each for the elbows at the hardware store, but only 20¢ from PVC fittings online.

I was not able to figure out where I had bought the 3/16″ barbed fittings from, but I found some for 62¢ each (in 10s) from Cole-Parmer.  At that price, I might even have the students each buy their own, with only the pressure sensors themselves being reused.

2015 September 3

Breath pressure measurements

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

I was never very happy with the breath pressure measurements we made in the applied electronics class, because blowing into a little 3/16″ hose did not correspond well with the measurements reported in the literature.  For one thing, the professional measurements are not into a closed tube, but into a small chamber that has a 2mm diameter hole as an air leak. My fix for this last year was to ignore breath pressure and concentrate on blood-pressure cuffs instead, which worked pretty well. But breath pressure should be easy to measure also, so this week I started looking at making cheap apparatus for doing breath pressure properly.

My first attempt just stuck a barbed tee into the hose. Since the opening of the tee is about 2mm, this should give the pressure vs. air flow curve we need.  This cheap approach sort of worked, but I was not able to get very high pressures recorded—much less than what the literature suggests should be average for a man of my age.  I’m pretty sure my lungs are in better than average condition, both for volume and pressure, so I don’t think this simple setup measured breath pressure well. I don’t know whether the problem is the mouth-to-tubing fit, pressure loss along the tubing, or the tee not really behaving like a 2mm orifice—my understanding of fluid flow in tubes and through orifices is rather weak.

In any event, I decided that the solution was to make apparatus that looked more like the equipment shown in the literature.  I happened to have a few barbed fittings with 1/2″ pipe threads, so I went down to the hardware store to get some PVC parts: a 1″ tee, a couple of bushings to reduce the 1″ slip to 1/2″ female threads, and a 1/2″ male-thread plug.  I drilled a 5/64″ hole (2mm) in the plug and assembled my breath-pressure apparatus:

One leg of the tee holds the 2mm air leak, the stem of the tee holds the barbed fitting for connecting to the pressure sensor, and the other leg of the tee is for putting around my mouth.

One leg of the tee holds the 2mm air leak, the stem of the tee holds the barbed fitting for connecting to the pressure sensor, and the other leg of the tee is for putting around my mouth.

The screw-in plugs allow replacing the hole, in case I want to experiment with different size air leaks. The 1″ circle of the tee provides an adequate seal around my mouth, but is not particularly comfortable. The parts cost about $5, so the apparatus is cheap enough.

With this device I managed to get breath pressure measurements comparable to what was reported in the literature, though it took some practice to get high pressures—normal breathing emphasizes high volume, not high pressure.

Plot of high-pressure exhalations followed by high-pressure inhalations (five attempts). I moved the apparatus away from my mouth between breaths, so these are not full breath cycles.  I don't know exactly what the noise at the end of the magenta trace is—probably jostling a loose connection.

Plot of high-pressure exhalations followed by high-pressure inhalations (five attempts). I moved the apparatus away from my mouth between breaths, so these are not full breath cycles. I don’t know exactly what the noise at the end of the magenta trace is—probably jostling a loose connection.

So the breath-pressure apparatus works, but I’ll need to think more about whether to build a dozen of these for the course. There are questions about cleaning the apparatus between users, for example—I don’t want to be spreading cold viruses among my students! Is there a way to make the apparatus more comfortable to use and get a better seal around the mouth.  Commercial peak-flow meters use disposable cardboard or plastic mouthpieces that cost about 35¢ each (in 100s from Amazon), and redesigning the apparatus to use them might be worthwhile—but even then the recommendation is to clean the equipment between users, unless one-way (exhalation-only) mouthpieces are used.  The standard usage (based on pictures on the web) appears to be to have a mouthpiece small enough to go into the mouth, so that the lips seal around it—my current design does not have that.

Perhaps I should try again with just a 1/2″ female threaded tee—that may be cheap enough that every student can have their own, and only the barbed fittings (which get no flow through them) would be shared.  Students wouldn’t even need to buy their own—I could have a stock of 50 of them, and wash them in a dishwasher after the lab.  I’ll have to see how well that works.

2015 May 15

Blood pressure lab part 2

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

I spent long hours in the lab yesterday (10 a.m.–6:30 p.m.), because students were not as far along as I had thought by the end of Tuesday. I stay in the lab until all the students are finished, even if that is a couple of hours past when the lab should end. A lot of students were still debugging their breadboarded instrumentation-amp circuits 2 hours into the lab session, when I had thought that they would be soldering after at most an hour more breadboarding.

Debugging on both the breadboards and the soldered boards took a lot of time, but the problems were pretty much the standard ones:

  • power not connected
  • wire missing
  • wire to wrong location
  • power supply hooked up backwards to one of the chips
  • bent pin on chip not making contact with breadboard

A couple of groups asked me for debugging help but did not have a drawn schematic to work from.  As I had said earlier in the quarter, I would not help them debug unless they had a schematic to work from.  (I think in both cases the problem was that they had connected up one wire incorrectly, but without a correct schematic to work from, there was no way that they could detect the error.)  Some students have been a bit sloppy about trying to work out of their heads rather than putting things down on paper, and this sloppiness is beginning to be a problem for them.  It has mainly been the weaker students who have been being this sloppy, so perhaps it has been more the case that they have been trying to work out of other people’s heads—copying bits and pieces from other students rather than working things out themselves and then implementing it.

I won’t be helping students debug unless they have shown some effort at making their designs debuggable (like having a clean schematic before they wire things up).

I’m not 100% sure, but I think that all but one group got a soldered instrumentation amplifier working and a blood-pressure measurement run done with it.  The one group that didn’t get that far did have a breadboarded amplifier working.

There were some students missing due to illness, so I’ll probably have to arrange some time next week for make-up lab times.  I’m not sure when that can be.

2015 May 14

Blood pressure lab

Despite fairly poor prelab homework turned in, the first half of the blood pressure lab went well.  After seeing how poorly students were doing on breaking down the problem into pieces (perhaps the main transferable engineering skill I’m trying to get them to develop), I ended up giving them more explicit instructions on the board at the beginning of lab:

  1. calculate sensor voltage difference for 100mmHg with 3.3v power
  2. measure sensor voltage difference for 100mmHg with 3.3v power (also 0mmHg and -100mmHg)
  3. determine upper and lower inputs of voltage for instrumentation amp INA126P from the data sheet, using worst-case rather than typical specs (“worst-case” meaning the smallest remaining voltage range)
  4. use Vout-Vref = G(V+ – V) to determine maximum gain to avoid clipping if input swing is +-180mmHg (+-24kPa)
  5. compute needed gain resistor, wire it up (and virtual ground)
  6. measure voltage at output of instrumentation amp at 0, +100mmHg, -100mmHg
  7. compute gain needed in second stage to get maximum range (without clipping) at final output
  8. wire up op amp and measure final output voltage at 0, +100mmHg, -100mmHg
  9. What is Vout as function of pressure?
  10. record with the PteroDAQ a blood pressure measurement with pressure slowly decaying from 180mmHg down to 40mmHg (not too slowly, or your hand will get swollen).  Check for clipping at high end.  Check that you are using nearly the full range. Check that pulsations are visible when plotting the data.
  11. Use bandpass-filter.py to filter the first channel of the recording (later channels will be discarded)

I may have to put some version of these instructions in the book, though this sort of hand-holding is precisely what I’m trying to cut out in the “descaffolding”.  I’m afraid we’re training a generation of technicians rather than engineers—they’re good at following very explicit instructions, but not so good at breaking problems down into smaller problems.

With these explicit instructions, most of the students managed to get breadboard versions of the pressure sensor amplifiers working. I may have to help out bench 4, as it turned out that their pressure sensor seems to have a 0.7mV offset (which is pretty big—way out of spec).  They’ll have to decide whether to change benches to get a different sensor, compensate for the sensor offset electronically, or compensate for it in the post-processing of the data.  Any of these solutions would be acceptable, but they aren’t all equally easy.

The students needed less help than in previous years in the lab, so I think that having the students struggle with the prelabs, even if they don’t get the answers right, is helping make the lab time more efficient—they only have to get past a couple of misunderstandings, rather than trying to learn all the material for the first time in lab, as so many did the last couple of years.

In lecture on Wednesday, I went over blood pressure waveforms defining pulse rate, systolic pressure, and diastolic pressure, and talking about the frequency ranges of the pulse rate. I then explained to them how the filter program was run (many students still don’t know about the “<” and “>” conventions for standard in and standard out on command lines). I also showed the gnuplot trick that allows using standard out from a program in place of a file in a plot command:
plot '< python bandpass-filter.py < pressure.data' using 1:3 with lines

I did not explain how digital filters worked, but I did say why I chose Bessel filters (to preserve as much of the time-domain structure of the signal as possible).  In response to a question I also explained the effect that choosing 5th order filters had (the rolloff as f5 or f–5, rather than f1 or f–1 as with a first-order RC filter). I also explained that the computation required more and more precise numbers as the order got higher, and that 5th-order was a good tradeoff between needed precision and fast rolloff.

One thing that I didn’t get to was explaining that “filtfilt” does the filtering twice: once with time going forward and again with time running backwards. The time reversal cancels a lot of the distortion in the time domain (so the choice of Bessel filters is not crucial), but doing two passes also doubles the order of the filter, so that the rolloff is really f10 or f–10.

I did remember to tell students that they needed to have the scipy package installed in order to run the filter program, and that if their python was installed from python.org that they could probably just run “pip install scipy”. At least one student in the class is using the Anaconda installation of python, which already has scipy installed.

At the end of the lecture I had only 10 minutes left, so I did not get into the internals of instrumentation amplifiers (needed for the EKG lab at the end of the quarter) nor transimpedance amplifiers (needed for next week’s lab). Instead I covered the voltmeter impedance measurements I made last week, explaining how I did the measurements, how I did the fitting, and what the results were.  In particular, I mentioned that swapping the sets of leads changed the behavior, so the extra capacitance (beyond the 100pF of the meter itself) appears to be coming from the leads.  I sent the data files and gnuplot script to them via e-mail, after one student requested them.

Next Page »

Create a free website or blog at WordPress.com.

%d bloggers like this: