# Gas station without pumps

## 2014 April 20

### Designing courses to teach design—draft 4

Today I tried practicing my talk for Wednesday with my son as an audience (I figured I could get some useful feedback from him based on his years of theater experience). He asked me a number of good questions about my audience and what effect I wanted to have on them (the same sort of questions I ask my students, but often have difficulty applying myself). He gave me some good advice about changing the tone of my talk, making it more conversational and less lecturing.  (I’m good at that in my usual improvisational lecture style, but I know that I couldn’t keep to time if I tried to be extemporaneous with this material.)

After getting his suggestions, I rewrote the talk and delivered it to him again.  It runs about 9 minutes, and my target is “under 10 minutes”, so I think the length is about right. I welcome suggestions from my readers also—the talk isn’t until Wednesday, so I may have time to make more revisions.

Because of the time constraints, I’m going to read my talk—something I’ve never done before, so forgive me if the presentation is a bit awkward.

I want to talk to you today about two courses I created in the past two years. These courses were in part a reaction against the University pressure to create MOOCs. University education is not supposed to be mega-lecture courses, but students getting detailed feedback on their work from experts.

The courses I’m talking about are not easy, cheap fixes (like was claimed for MOOCs)—they are high-contact, hands-on courses, which take a lot of time to create and teach, and so are expensive to offer.

Designing the courses started from goals and constraints: “what problem was I trying to solve?” and “what resources were available?”

The two problems I was trying to solve were in the bioengineering curriculum:

• students weren’t getting enough engineering design practice (and that mostly in the senior year, which is much too late) and
• too many students were selecting the biomolecular concentration, where we were exceeding our capacity for senior capstone and senior thesis projects.  The other concentrations were under-enrolled.

The main constraints were that

• there was no room in the curriculum for adding more required courses,
• there were no resources for new lab space or equipment, and
• all existing engineering design courses had huge prerequisite chains.

Because I couldn’t ask someone else to create and teach a new course, the content had to be something I already knew or could learn quickly. So, no wet labs!

The first course I’ll talk about is a replacement for the previously required EE 101 circuits course. The EE course is a theory class that prepares students to do design in later courses—but most bioengineering students never take those later courses, so were getting prepared for something they didn’t do. (That’s a general problem in the bioengineering program—“creeping prerequistism” in the 8 or 9 departments providing courses results in the students always preparing to do stuff, and not getting to the doing until senior year.)

The goal of the new Applied Circuits for Bioengineers course is to have students design and build simple amplifiers to interface biosensors to computers. We work with a range of sensors from easy ones like thermistors, microphones, and phototransistors to more difficult ones like EKG electrodes and strain-gauge pressure sensors.

The goal is for students to do design in every lab, even the first one where they know almost no electronics, and to write detailed design reports on each lab—not fill-in-the-blank worksheets, like they get in other intro labs.

The course was designed around the weekly design projects, not around topics that must be covered. Themes emerged only after the design projects were selected—the class comes back again and again to variations on voltage dividers, complex impedance, and op amps with negative feedback.

There wasn’t a textbook available that covered things the way I wanted, so the students use free online materials instead. The savings on textbooks is used to justify a lab fee of  about $130 for tools and parts. They don’t get just a few parts, but 20 each of 64 different sizes of resistors and 10 each of 25 different sizes of capacitors, along with a microprocessor board and lots of other tools and parts. I don’t want their designs to be multiple-choice questions (“there are only 5 resistors in the kit—so one of them must be the right answer”). Coming up with usable design exercises was hard—I tried lots of them at home, rejecting some as too hard, some as too easy, and tweaking others until they seemed feasible. I even designed three different custom printed circuit boards for the course: a board for pressure sensors, a hysteresis oscillator for soldering practice, and a prototyping board for their two instrumentation-amplifier projects. (pass boards around) By the way, PC board design has gotten very cheap—I used free tools for doing the design, and the boards themselves cost only 50¢ to$1—it would have cost thousands to have done custom boards like this when I was first hired at UCSC.

Developing a hands-on course like this is not quick—creating the course took me almost 6 months of full-time effort!—so we’re probably not going to see huge numbers of such courses being started. But they’re worth it!

To make it somewhat easier for someone who wants to create a similar course, I posted all my notes on designing the course on my blog—over 100 blog posts before class even started! There are now around 240 posts (the URL is on the quarter-page handout, along with the URL for the course syllabus and lab assignments).

The course was prototyped last year as BME 194+194F “Group Tutorial” before being submitted to CEP for approval. Incidentally, I highly recommend prototyping before submitting the paperwork for new courses—there were a lot of changes that came out of the prototype run. For example, the lab time was increased from 3 hours to 6 hours a week.

That change has a high cost—not only am I spending over 10 hours a week of direct classroom and lab time, but I’m spending every weekend this quarter rewriting all the lab handouts—splitting the material between the lab times and adding at-home or in-class design exercises between the two parts. Even with the extra lab time, some labs ran over this quarter, so I’ve got still more tweaking to do for next year.

It isn’t just the design of a new course that is expensive—each time the course is offered takes a lot of faculty time. In addition to the 10 hours a week of direct contact, I have office hours, grading, prep time for both labs and lectures, and rewriting the lab handouts.  If I have 2 lab sections next year, I’ll have 16 hours a week of direct contact. Just providing feedback on the 5–10-page weekly design reports takes about 15 minutes per student per week (half an hour per report).

But enough about the circuits course.

The other course I want to talk about is one I created last quarter: a new freshman design seminar in conjunction with the student Biomedical Engineering Society. This course has no prereqs, is only 2 units, and does not count towards any major or campus requirements (it might get a “Collaborative Endeavor” gen-ed code).
I’d not taught a freshman class in over a decade, having taught mainly seniors and grad students, so I had no idea what skills and interests the students would bring to the class. With no prereqs for the course, I couldn’t assume that students had any relevant skills, though it turned out that all this year’s students had had biology, chemistry, and at least conceptual physics in high school.

Because I didn’t know what to expect, I didn’t choose the projects ahead of time, but tried to adapt the course on the fly to what the students could do and what they wanted to do.  (They wanted to do more than they could do in the time available, of course.)

I did try out three or four projects ahead of time, looking for design projects with a low entry barrier. But all the projects I tried assumed some computer programming skills, and only one student had ever done any computer programming—a big hole in California high school education.  Even more concerning for engineering majors is that only a few had any experience building anything. (AP physics classes were the most common exposure to building something.)

On the first-day survey the students indicated an interest in learning some programming and electronics, so we did a little programming with an Arduino microcontroller board—I’ll try to up that content next year, adding some more electronics.

The class started with generic design concepts using a photospectrometer as an example. The concepts include such basics as specifying design goals and constraints, dividing a problem into subproblems, interface specification, and iterative design. The photospectrometer turned out to be too complex and unfamiliar to students, and I’ll probably start with a simpler design (perhaps a colorimeter) next year, and have the students design, build, and program it before they start on their own projects.

One positive thing—the course had more women than men, and at the end of the course they indicated that the course had made them more likely to continue in engineering!

I could go on all afternoon about these courses, but I’m running out of time, so I’ll leave you with these take-away messages:

• The value of University education is in doing things and getting detailed feedback from experts, not sitting in lectures.
• Students should be solving real problems with multiple solutions, not fill-in-the-blank or multiple-choice toy exercises.
• Hands-on courses require a lot of time from the professors, both to create and to run, and so they are expensive to offer.
• Failure to teach such courses, though, makes a University education no longer worthy of the name.

## 2014 April 13

### Designing courses to teach design—draft 3

The talk I was scheduled to give last quarter (2014 Feb 24) was rescheduled, because two of the four speakers were unable to make that date.  It is now scheduled for Wed 2014 Apr 23  at 3:30 in the Merrill Cultural Center, which used to be the Merrill Dining Hall, before they consolidated dining halls in the east colleges. There are now 6 speakers in 90 minutes, which means 15 minutes each (maybe 10 minutes speaking, 5 minutes for questions).  I’ll have to run over from my class which ends at 3:10 on the opposite side of campus (0.6 miles, 13 minutes according to Google Maps), though running may be difficult along the crowded sidewalks between classes.

The talk needs to be updated from last quarter, as I have now taught prototype runs for both the applied circuits class and the freshman design class, and am in the second run of the applied circuits class.

Here is my current draft of the text—please give me some suggestions in the comments for improvement.  The ending seems particularly awkward to me, but I’m having trouble fixing it.

Designing Courses to Teach Design

I believe that the main value of a University education does not come from MOOCable mega-lecture courses, but from students working in their field and getting detailed feedback on that work. I’ll talk today about some courses I’ve created ths year and last to teach students to do engineering design. These courses are high-contact, hands-on courses—the antithesis of MOOC courses.

Design starts from goals and constraints: “what problem are you trying to solve?” and “what resources are available?” So what were my goals and constraints?

The two problems I was trying to solve were in the bioengineering curriculum:

1. students weren’t getting enough engineering design practice (and what they were getting was mostly in the senior year, which is much too late) and
2. too many students were selecting the biomolecular concentration, where we were exceeding our capacity for senior capstone and senior thesis projects.  The other concentrations were under-enrolled.

The main constraints were that

1. there was no room in the curriculum for adding required courses,
2. there were no resources for new lab space or equipment, and
3. all relevant engineering courses had huge prerequisite chains.

Furthermore, I would have to teach any new course myself, so the content had to be something I already knew or could learn quickly. Those constraints meant the new course would not have wet labs (though I have encouraged wet-lab faculty to add design exercises to their existing courses).

My first partial solution was to replace the required EE circuits course with a new Applied Circuits course. The existing EE101 course is a theory class (mostly applied math) that prepares students to do design in later courses—but most bioengineering students never take those later courses, so were getting prepared for something they didn’t do. Due to “creeping prerequistism” in the 8 or 9 departments providing courses for the major, the bioengineering students were already taking far too many preparatory courses and far too few courses where they actually did things.

The goal of the new course is to have students design and build simple amplifiers to interface biosensors to computers. I chose a range of sensors from easy ones like thermistors, microphones, and phototransistors to ones more difficult to interface like EKG electrodes and strain-gauge pressure sensors. I’m not interested in cookbook, fill-in-the-blank labs—I want students to experience doing design in every lab, even the first one where they knew almost no electronics—and I want them to write detailed design reports on each lab, not fill-in-the-blank worksheets, like they get in chem and physics labs, and even intro EE labs.

The course was designed around the weekly design projects, not around preset topics that must be covered. Themes emerged only after the design projects were selected—the class comes back again and again to variations on voltage dividers, complex impedance, and op amps with negative feedback.

Students used a free online textbook rather than buying one, but bought about \$90 of tools and parts. I tried out every potential design exercise at home—rejecting some as too hard, some as too easy, and tweaking others until they seemed feasible. I designed and had fabricated three different printed circuit boards for the course (not counting two boards which I redesigned after testing the lab at home).  One of the PC boards is a prototyping board for students to solder their own amplifier designs for the pressure-sensor and EKG labs. (Pass boards around.)

Developing a hands-on course like this is not a trivial exercise. I spent about 6 months almost full time working on the course design (without course relief). I made over 100 blog posts about the design of the course before class even started, and I now have over 230 posts (the URL is on the quarter-page handout, along with the URL for the course syllabus and lab assignments).  Since the posts average a couple of pages, this is more writing than a textbook (though not nearly as organized).

The course was prototyped last year as BME 194+194F “Group Tutorial” before being submitted to CEP for approval, and I wrote up notes after each class or lab (another 60 or so blog posts). Last year’s prototyping lead me to increase the lab time from 3 hours to 6 hours a week, which means I’m spending a lot of time this quarter rewriting all the lab handouts—splitting the material between the lab times and adding at-home or in-class design exercises between the two parts. Some of the fixes have worked well (students got comfortable plotting their data with gnuplot weeks earlier this year), but we’ve still run over time in some labs, even with 6 hours a week of lab, so more tweaking is needed.

This course is expensive in terms of professor time: I’m spending over 10 hours a week of direct classroom and lab time (not counting office hours, grading, prep time, or rewriting the lab handouts). Just providing feedback on the 5–10-page weekly design reports takes about 15 minutes per student per week (half an hour per report).

The students taking Applied Circuits last year were mostly seniors who had been avoiding EE 101, rather than the sophomores I’d intended the class for. This year, I have juniors and seniors, but still no sophomores. So the course still does not provide early exposure to engineering design, nor does it direct more students to the bioelectronics concentration rather than the biomolecular one (those there’s still hope for the latter).

My second partial solution was to create a new freshman design seminar in conjunction with the student Biomedical Engineering Society. This course has no prereqs, is only 2 units, and does not count towards any major or campus requirements.

Unlike the Applied Circuits course, I didn’t choose the design projects for this course ahead of time, because I had no idea what skills and interests the students would bring to the class—I’d not taught a freshman class in over a decade, having taught mainly seniors and grad students. I did try out 3 or 4 design projects on my own to gauge the skills needed to do them, but those projects all assumed some computer programming skills.

I prototyped the freshman design course last quarter as BME 94F and have submitted course forms to CEP for approval. Once again, I blogged notes after each class meeting (only about 39 posts, though—this was a less intensive effort on my part).

With no prereqs, I couldn’t assume that students had any relevant skills, though it turned out that all this year’s students had had biology, chemistry, and at least conceptual physics in high school. Only one student had ever done any computer programming, though—a big hole in California high school education—and only a few had any experience building anything. (AP physics classes were the most common exposure to building something.) On the first-day survey the students indicated an interest in learning some programming and electronics, so we did a little programming with an Arduino microcontroller board—I’ll try to up that content next year.

I started out teaching generic design concepts using a photospectrometer as an example. The concepts include specifying design goals and constraints, dividing a problem into subproblems, interface specification, and iterative design.The photospectrometer turned out to be too complex, and I’ll probably start with a simpler colorimeter next year, and have the students design, build, and program it before they start on their own projects.

My third partial solution has been a complete overhaul of the bioengineering curriculum, which is currently before CEP for approval. No new courses were created for this overhaul, but all the concentrations were changed. For example, half the chemistry courses were removed from concentrations other than biomolecular, to make room for more courses in electronics, robotics, psychology, or computer science. And some the orphan math courses were removed from the biomolecular concentration to make room for more advanced biology. Long-term, I’m hoping to convince some of the other departments to remove excessive prerequisites, so that students can take more interesting and useful courses before their senior year.

I could go on all afternoon about these courses and curriculum design, but I’m running out of  time, so I’ll leave you with these take-away messages:

1. The value of University education is in detailed feedback from professors in labs and on written reports, not in the lectures.
2. Students should be solving real problems with multiple solutions, not fill-in-the-blank or multiple-choice toy exercises.
3. These courses require a lot of time from the professors, and so they are expensive to offer.
4. Failure to teach such courses, though, makes the University education no longer worthy of the name.

For those of you not present—the quarter-page handout will have the URLs for this blog’s table of contents pages for the circuits course and the freshman design course, in addition to the two class web pages:

In addition to the quarter-page handout, I also plan to have copies of the prototyping board (both bare boards and ones that I used for testing out EKG or instrumentation amp circuits), one of the pressure sensors (on another PC board I designed), and the hysteresis oscillator boards.  If I can get it working again, I may also wear the blinky EKG while I’m talking.

Preparing this talk has been weird for me—I can’t remember ever having scripted out a talk to this level of detail.  For research talks, I usually spend many hours designing slides, and relying on the slides to trigger the appropriate talk. For classes, I usually think obsessively about the material for a day or two ahead of time, sometimes writing down a few key words to trigger my memory, but mainly giving an extemporaneous performance that relies heavily on audience participation. I had one memorable experience where a student asked me for a copy of my lecture notes after a class—I handed her the 1″ PostIt that had my notes, but warned her that I’d only covered the first word that day, and that it would take the rest of the week to cover the rest.

Doing this short a talk without slides and without time to rehearse will probably require me to read the talk—something else I’ve never done. (I know, I should have rehearsed during our one-week spring break, but I had a 2-day RNA research symposium, a faculty meeting about who we would offer our faculty slot to, meetings with grad students, and feverish rewriting of the first few lab handouts for the circuits course.)

## 2014 March 31

### New modeling lab for electret microphone

Last year, in Mic modeling lab rethought, I designed the DC measurement of an electret microphone around the capabilities of the Arduino analog-to-digital converters:

Circuit for measuring DC characteristics of an electret microphone. The four labeled nodes are connected to the Arduino.

• The highest voltage allowed is 5v and the lowest is 0v.
• The resolution is only 10 bits (1024 steps).
• The steps seem to be more uniformly spaced at the low end of the range than the high end (so differences at the high end are less accurate than differences at the low end).
• The external reference voltage AREF must be at least 0.5v (this is not in the data sheet, but when I tried lower AREF voltages, the reading was always 1023).

Test fixture for measuring I-vs-V DC characteristics of electret microphone.

This year we’ll be using the KL25Z boards, which have different constraints:

• The highest voltage is 3.3v and the lowest is 0v.
• The resolution is 16 bits (15 bits in differential mode).
• Differential mode only works if you stay away from the power rails—clipping occurs if you get too close.
• The external reference must be at least 1.13v.  With less than a 3-fold range for the external reference, varying the external reference to get different ranges seems rather limited.

I think I’ll still have the students start with using the multimeter and the bench power supply to measure voltage and current pairs for 1V to 10v in steps of 1v.  But then I’ll have them wire up a different test fixture. The resistor R2 is one that students will have to choose to get an appropriate measuring range. Resistors R3 and R4 keep the voltages for the differential measurements E20–E21 and E22–E23 away from the power rails. I tried using smaller values, but 200Ω was not enough—I still got clipping problems. So 63mV is too close to the rails, but 275mV seems fine.  I suspect that the limit is around 100mV to 150mV, but I did not try to narrow it down.

I found that the differential measurements had less noise than single-ended measurements, despite having a resolution of about 100µV rather than the 50µV of single-ended measurements. Doing 32× hardware averaging also helped keep the noise down. (Note: the data sheet for the KL25 chip does claim a higher effective number of bits for differential measurement than for single-ended measurement, perhaps because of reduction in common-mode noise.)

I was able to get fairly clean measurements with just two different resistor sizes, to which I fit 4 different models:

• linear resistance: $I = V /R$
• constant current $I = I_{sat}$
• blended: $I = V/ \sqrt{ R^2 + (V/I_{sat})^2)}$
• blended with exponent: $I = V/ \sqrt{ R^2 + (V^p/I_{sat})^2)}$

The blended fit with the extra exponent on voltage does a pretty good job of fitting over the full range (it looks good on a log-log scale also)

Because of the large characters used for the data points, the lines look fat, but the noise level is fairly small—about ±300µV Some of that may be due to the movement of the potentiometer, as the voltage and current aren’t measured at precisely the same time, but I suspect most is electrical noise in the processor itself.

## 2014 March 17

### Revised plan for circuits labs

Filed under: Circuits course — gasstationwithoutpumps @ 14:39
Tags: , , , ,

In Plan for rearranged circuits labs I provided a tentative schedule for the applied circuits course and lab,  which starts on 2014 March 31.But after my experimenting with optical pulse detection this weekend, I need to rearrange the labs to move the phototransistor lab later and allow more time for it.  This post is my attempt to do that rearrangement.

 Monday 2014 Mar 31 Administrivia: structure of course, rotating partners, labs not cookbook—need to read carefully before coming to lab. Pre-lab homework. Demo pressure sensor or EKG? Ohms law, voltage dividers. Homework: install gnuplot on own computers, read Wikipedia on thermistors and the Steinhart-Hart equation, draw voltage divider with schematic capture tool (probably Digi-key’s SchemeIt) Tuesday 2014 Apr 1 Unpacking parts, labeling capacitor bags, using wire strippers, making clip leads, measuring input resistance of multimeter, measuring thermistor resistance at many temperatures. Wednesday 2014 Apr 2 Do-now resistance-to-voltage converter. Gnuplot: fitting thermistor theory to measured data. Derivatives of voltage w.r.t. temperature to maximize sensitivity (and linearize output). Homework: install data logger on own computer and KL25Z, record accelerometer? Thursday 2014 Apr 3 Soldering headers onto KL25Z boards, downloading data logger to KL25Z, if not already done. Measuring voltage of thermistor voltage divider, recording voltage vs. time. See soldering instructions at Soldering headers on a Freedom board and Jameco soldering tips Friday 2014 Apr 4 Voltage-divider do-now exercise. Other temperature measuring devices (RTDs, thermocouples, silicon bandgap temp sensors). Monday 2014 Apr 7 Three-resistor do-now question. Feedback on design reports, i-vs-v plots, how electret mic works.  AC voltage (sine wave: amplitude, peak-to-peak, RMS voltage). DC blocking capacitors, RC filters (without complex impedance). Tuesday 2014 Apr 8 Measure I-vs-V DC characteristic of resistor and of electret mic, both with multimeter and with KL25Z board. Wednesday 2014 Apr 9 Gnuplot: plotting transformed data, fitting various models to i-vs-v (resistor, current source, blending of resistor and current source, more complex model). Thursday 2014 Apr 10 Look at mic with resistor load on oscilloscope (AC & DC coupling).  Capacitor for own AC coupling. Loudspeaker on function generator? Friday 2014 Apr 11 Another 3-resistor do-now question. Voltage sources, current sources, load lines, Thévenin and Norton equivalents. Monday 2014 April 14 Hysteresis. Applications: cleaning up noisy signals to on/off signals, feedback control. Differential equation for capacitor, derived from Q=CV, RC time constant. Basic idea of hysteresis oscillator (demo of touch tensor?) Tuesday 2014 Apr 15 Characterize hysteresis in Schmitt trigger chip using data logger. Breadboard hysteresis oscillator with various R and C values, measuring frequency or period (oscilloscope or frequency meter?). Make and test touch sensor with breadboard oscillator. Solder hysteresis oscillator. Estimate capacitance of touch from change in period of hysteresis oscillator. Note:I’ll have to write touch sensor code for KL25Z. Wednesday 2014 Apr 16 Theory of sampling and aliasing Thursday 2014 Apr 17 Sampling and aliasing lab. Awkward that this gets split from sampling and aliasing theory, but I want to analyze loudspeaker data this week. Friday 2014 Apr 18 High-pass and low-pass RC filters as voltage dividers. Gnuplot plots and Bode plots for amplitude. Make sure they see ω=0 and ω=∞ simplifications, and straight-line approximations (f, 1/f, constant) away from corner frequency.  Introduce dB and dB/decade rolloff. Monday 2014 Apr 21 RC filter/voltage divider quiz/midterm Tuesday 2014 Apr 22 Impedance of stainless steel (polarizing) electrodes in different NaCl concentrations (at several frequencies). Wednesday 2014 Apr 23 Gnuplot: Functions for impedance: Z_C, Z_L, Z_parallel. Fitting R1+(R2‖C) models to data, maybe fitting other models? Polarizing and nonpolarizing electrodes. Properties of stainless steel (corrosion resistance in oxidizing environments, biocompatibility, poor choice for electrodes) Thursday 2014 Apr 24 Impedance of Ag/AgCl (non-polarizing) electrodes in different NaCl concentrations (at several frequencies) Friday 2014 Apr 25 Intro to op amps, unity gain buffer, transimpedance amplifier. Monday 2014 Apr 28 Inverting and non-inverting amplifier. Tuesday 2014 Apr 29 Characterizing impedance of loudspeaker vs. frequency Wednesday 2014 Apr 30 Gnuplot: fitting models for loudspeaker impedance. Thursday 2014 May 1 Measuring nFET current with constant VDS and varying VGS, also with constant VGS and varying VDS. (pFET also?) Friday 2014 May 2 Gnuplot: fitting nMOS transistor models to measured data. nFET and pFET as switches. Monday 2014 May 5 System thinking and block diagrams: developing for audio amplifier Tuesday 2014 May 6 Low-power single-stage audio amplifier with op amp Wednesday 2014 May 7 Op-amp quiz/midterm Thursday 2014 May 8 catchup day? characterizing pFET? characterizing LED? Friday 2014 May 9 Op amps with RC voltage dividers (active filters) Monday 2014 May 12 Do now: transimpedance amplifier.  Models for photodiodes and phototransistors.  (other photosensors?) Tuesday 2014 May 13 Photodiode and phototransistor with single-stage simple transimpedance amplifier. Freeform soldering to attach leads for fingertip transmission sensor. I need to drill a dozen blocks of wood for the fingertip alignment blocks. Cut-and-try design for transimpedance gain needed to see reasonable signal without saturating amplifier. (Determine AC and DC components of current) Wednesday 2014 May 14 Gnuplot: model gain of 1-stage and 2-stage amplifiers with RC filters.  Develop block diagram for 2-stage pulse detector with approximately 0.3Hz–30Hz bandpass. Thursday 2014 May 15 Fingertip pulse sensor with 2-stage amplifier and bandpass filtering. Friday 2014 May 16 class D amplifier  concept. Monday 2014 May19 Developing class D block diagram Tuesday 2014 May 20 class D audio amplifier day 1(preamp and comparators) Wednesday 2014 May 21 Gnuplot: analyzing loudspeaker load, adding LC filter in front of loudspeaker to make sharp cutoff without ringing. Thursday 2014 May 22 class D audio amplifier day 2 (output stage) Friday 2014 May 23 Do-now: Wheatstone bridge. Strain gauges and Wheatstone bridges. Instrumentation amps. Homework: block diagram and design for pressure sensor. Monday 2014 May 26 Memorial Day, no class Tuesday 2014 May 27 Pressure sensor day 1: design and soldering instrumentation amp prototype board Wednesday 2014 May 28 catch up day? Thursday 2014 May 29 Pressure sensor day 2: further debugging. Recording pressure pulses from aquarium air pump?  Would need to buy some more air pumps. Friday 2014 May 30 Action potentials in nerve and muscle cells? Monday 2014 Jun 2 Why EKG signals differ based on placement of electrodes.  (Vector model) Tuesday 2014 Jun 3 EKG day 1:  breadboard and debugging (confident students could go directly to soldering) Wednesday 2014 Jun 4 Catch up? Thursday 2014 Jun 5 EKG day 2: soldering, debugging, and demo.  Last day for any catchup labs. Friday 2014 Jun 6 Catch up? Monday 2014 Jun 9 4–7 p.m. Final exam? (probably not needed, except as a lab catch-up day)

I’m not 100% satisfied with this schedule, and things will probably slip as I discover unexpected difficulties in student preparation, but I think it is likely to run more smoothly than last year, and last year was not bad.

If any of my readers have suggestions on improvements that could be made in the labs or the order of topics, please let me know. I have to buckle down and (re)write the lab handouts soon!

## 2014 March 16

### New phototransistor lab

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

In Phototransistor I talked about one possible phototransistor lab, that looked at the response speed of a phototransistor, as a function of the load resistor.  I rejected that last year as insufficiently interesting for bioengineers.

The lab for phototransistors that I used last year was a “tinkering” lab, where I tried to get the students to play with the hysteresis oscillator that they had built, modulating it with light (see Idea for phototransistor/FET lab). I didn’t think that it was a very successful lab (see Tinkering lab reports show problems), and I’d rather have a lab that seems more directly “bio” oriented.

One lab I’ve not given in class, but have played with a lot at home, trying to find something that works at the right level of complexity for the students is an optical pulse monitor:

Scott Prahl’s estimate of oxyhemoglobin and deoxyhemoglobin molar extinction coefficients, copied from http://omlc.ogi.edu/spectra/hemoglobin/summary.gif
The higher the curve here the less light is transmitted. Note that 700nm has very low absorption, but 627nm has much higher absorption.

I played around with the idea some more last week, using a transimpedance amplifier to convert current to voltage (as in Colorimeter design—weird behavior). I can easily get enough gain to see pulse for a 700nm LED shining through a finger, but I listed the “brighter” LED red diffuse 3mm 625nm WP710A10ID part for this year’s parts kit, so I need to test with it (or with LED IR emitter 5mm 950nm SFH 4512). Because I’ll be making the mechanical part of the pulse monitor for the students, I have to know whether a 5mm or 3mm LED will be used.

Because oxyhemoglobin has its lowest absorbance near 700nm, I expect that switching to either 950nm or 627nm will greatly reduce the signal, needing an extra gain of 5.

The mechanical design I’m thinking of using is a simple one: a 3/4″ diameter hole drilled 2″ deep into a 3″-long block of wood that is 1.5″ by 1.5″, with a 1/8″ hole drilled at right angles to accommodate the LED and phototransistor. Carving out a small channel allows the block to sit flat on the tabletop.

The block with LED in the top hole and the phototransistor in the bottom hole. The phototransistor has a bit of rim, necessitating a shallow 5/32″ drill allow the phototransistor to go deep enough into the block for the block to sit flush on a tabletop.

Block viewed from end with 3/4″ hole. The cross hole for the LED (or phototransistor) and the channel for its wires can be seen on the front.

To connect the LED and phototransistor to a breadboard, the leads need to be extended:

I added color-coded leads to the phototransistor and LED, making sure that the negative lead (the cathode for the LED and the emitter for the NPN phototransistor) were given the black wire.
Careful folding and crimping with long-nose pliers gives a good mechanical connection.

Next the connections are soldered to make good electrical connections. It will be good for students to do a little freehand soldering, as their other soldering projects use PC boards.

Finally, one or both of the connections should be covered with electrical tape, so that the wires don’t short. (The students don’t have electrical tape in their kits—I’ll have to remember to bring some in.)

In order to help me remember which side has the phototransistor and which the LED, I color-coded the leads differently (yellow wire for LED anode, green wire for phototransistor collector), and used colored electrical tape to hold the optoelectronic parts in the block (red tape for the LED, blue tape for the phototransistor—matching their package colors).

I did manage to get  the pulse monitor working sometimes, but it seems to be excessively finicky—I need very high gain with careful setting of the bandpass filter parameters to get a signal. The biggest problem is that the second stage of the amplifier, where I do the high-pass filtering to remove the DC component and slow drift, can end up getting saturated.  Because of the high impedance of the feedback resistor, the output stage takes a long time to recover from being saturated. Saturation is a frequent problem with high-gain amplifiers, but I’m not sure I want students dealing with it on this lab.

Initially, the light is bright and the amplifier saturates at one rail. When a finger is inserted in the sensor, the light drops enormously, and the amplifier output swings to the other rail. It takes a very long time (about 30 second here) before the limited current through the feedback resistor can charge the capacitor in the high-pass filter enough to restore the op-amp inputs being the same voltage.

The combined gain of the two stages at 1Hz (about the frequency of my pulse) is around 132MΩ, and the output is still only about 0.25V, so the fluctuation in the input current must be around 2nA. That’s not as small as the signals in a nanopore, but it is small enough to be troublesome.

I tried a different set of components that gave me a gain of about 240MΩ at 0.9 Hz, and that amplifier started clipping the output, swinging from around -0.8v to +1.6v.

After the first stage (with a gain of about 1.7MΩ at 0.9Hz and 5.6MΩ at 0Hz), I see about a 10mV swing on top of a DC signal of 0.6 to 0.8v (with considerable drift). That implies about a 6nA signal at 0.9Hz, while the DC signal is about 125nA.  The magnitude of both the DC and the AC component varies a lot, depending on which finger I use and how firmly I press the finger against the sensor.  I can pretty consistently get 2–9nA of AC on top of 100–150nA DC.  I think that good corner frequencies for the low-pass and high-pass filters are around 0.3Hz and 30Hz. By making the gain of the transimpedance amplifier as high as I can (without saturating with the DC signal), I can keep the gain of the second amplifier low enough to avoid the problem of saturation in the second stage, and the pulse monitor can detect the pulse within 5 seconds.

Another option is to make the first-stage amplification be a logarithmic transimpedance amplifier, rather than linear one, by using a Schottky diode as the feedback element instead of a resistor.  But that is getting well outside what I’m comfortable assigning as a design exercise to the Applied Circuits class. I tried it anyway, but the signal from the log amplifier was too small:  a 10% variation in current only results in a 2.4mV change in the output of the log amplifier, needing a much higher gain than my second stage currently provides.

While the 700nm LED provides a stronger signal, the 627nm LED works well enough, and a 2-stage transimpedance amplifier is reasonable for the students to design.  I probably want it to be a 2-day lab, though, with the low-pass first stage designed and tested for the first day, then the high-pass second stage added to solve the problem of DC offset and drift.  That will require reworking my schedule, as I only allowed one day for the lab in the current schedule.

Next Page »