Gas station without pumps

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.

2015 May 11

Lecture on pressure sensors

Today’s lecture was fairly straightforward:

  • Feedback on the audio-amplifier design report
  • Explanation of RMS vs. amplitude vs. peak-to-peak voltage measurements
  • How pressure sensor works
  • Wheatstone bridge, developed from voltage divider, with second fixed voltage divider to subtract off effect of supply voltage changes

I had wanted to get to the internals of how an instrumentation amplifier is built (the 3-op-amp and 2-op-amp designs), but that can wait until Wednesday.  I also wanted to do a demo of the pressure sensor with digital filtering, but that can wait until Wednesday also (and I forgot to bring in my KL25Z board today anyway).  Discussions of systolic and diastolic blood pressure will need to be done on Wednesday also—I’ll start with that, then move to the demo and show how to measure pulse rate and estimate the blood pressures from the recording.

The main feedback I gave on the design reports consisted of the following points:

  • A lot of students are still invoking V=IR without thinking about what the variables mean—they have to be talking about the voltage across and current through the same resistor, not some other random voltage in the system.  For the design they just did, it was impossible to know the voltage across the resistor until the power supply voltage was chosen, but the voltage across the resistor was not the power-supply voltage!
  • Many students did not justify their design choice for the power supply.  There were constraints on it (from the op-amp data sheet), and they should have chosen a voltage near the upper end, because they wanted as loud an output as possible, and the current limits increased with power-supply voltage.  One or two sentences that said those two things would have sufficed.
  • RC time constants have units (called “seconds”).  I showed the students that ΩF is seconds, by using the definition of Ω as V/A, A as C/s, and F as C/V.
  • Voltage gain, on the other hand, is unitless, being a ratio of two voltages.  I also explained the convention of showing what the ratios are of, express  gain in “units” of V/V.
  • The gain for their audio amplifiers needed to be designed (based on the current limits at the outputs and the loudspeaker impedance, divided by the calculated or measured input voltage to the amplifier).  Too many students got a hint from the group tutor for the class (that turned out to be wrong) and took it as a specification, rather than doing their own design.
  • Many students did not report their loudspeaker impedance, but it was essential for computing the voltage at which the amplifier would clip, and different students had different loudspeakers (some 6Ω and some 8Ω).
  • Paralleling op amps doesn’t increase the gain, merely the current limit for the amplifier.  So clipping happens at a higher voltage, but the gain for small signals remains unchanged.
  • Several students had misdrawn the gain control circuit, using the two ends of potentiometer symbol as if it were a variable resistor. I showed them both the standard symbol for a variable resistor and how to draw the potentiometer used as a variable resistor correctly.
  • Lots of students had very approximate gain measurements, because they had relied exclusively on the oscilloscope for measuring voltages.  I explained why the oscilloscope is inherently less accurate for measuring voltage than a voltmeter.
  • I explained that “surround sound” and “stereo” require different signals to the multiple loudspeakers—multiple speakers wired to the same signal don’t produce the aural position illusion that stereo and multi-channel sound does.
  • One of my pet writing peeves is the mixing up of prepositions in “substitute x for y” and “replace y with x”.  Note that what replaces what swaps positions in the two phrases.  When students mix and match to get “substitute x with y” or “replace y for x” I don’t know whether the verb or the preposition is dominating the meaning.  (In some dialects of English one or both of these phrases may be unambiguous, but they don’t seem to be consistently used in California, so I treat them as errors, rather than as dialect variations.)
  • Students are still starting numbers with periods.  I’ve told them repeatedly not to—numbers shouldn’t start with punctuation (other than a + or – sign), and there should always be a digit in front of any decimal point.
  • The triangle used as a ground symbol should always point down.
Next Page »

The Rubric Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 340 other followers

%d bloggers like this: