# Posts with «course design» label

I feel pretty good about today’s lecture, though things got a little rushed at the end.

Three-resistor voltage divider for the first question.

I started with a “do now” question, similar to the one from Monday. Actually, I started with 2 questions. The first just asked what the output voltage would be for a 3-resistor voltage divider. The second repeated the question from Monday, but with the additional constraint that the power supply was 5 volts:

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

Several students realized that the first question was a hint for the second one and that the variable resistor had to be RB or RC, and could set up the equations and solve for RA and RC.  This is a better performance than on Monday’s “do now”, but only about 1/3 of the class got it completely, and several of them were not confident of their results, so we again took time to go over the whole solution. I think that everyone (or almost everyone) understood the design process and how to set up and solve the equations by the end of the presentation, which I drew out of the students as much as possible.  I also mentioned that we could have solved the problem with a different circuit (putting RC in parallel with RB instead of in series), but did not further elaborate on that point.

The do-now plus going over the solution took about 33 minutes, which is a little more time than I’d like to be spending on these questions.  It would be good to get the time down to 15 minutes, but I don’t see how to do that without losing half the class.  If the problems are easy enough that everyone gets them, then there is no point to taking up any class time with them, and if they are hard enough that 1/3 to 2/3 of the class don’t get them, then they need to be gone over in class.

After the do-now, we spent a little time discussing the “fit” command of gnuplot, since the students have to fit models to the data they collect tomorrow, and I’m not providing them a script this time (though they can modify the script that was provided in the first lab).

Finally, we got to the theoretical meat of the class—we discussed what sound was (ending up with variations in pressure for a fluid, though we discussed briefly transverse and shear waves in solids).  Then I introduced microphones as transducers, trying to get the students to remember their elementary mechanics, so that we could do pressure→force→displacement→1/capacitance→voltage for electret mics.  The hardest part was getting students to remember that a spring-mounted object had force proportional to displacement (a lot remembered the energy was somehow related to displacement squared and got stuck on that formula).  I suspect that the local physics department would not be seeing a high score on the Force Concept Inventory for students coming out of their physics classes, as a lot of them seem to have concentrated on cramming formulas rather than learning fundamental concepts.  Someone did remember Q=CV and someone else could reason from wanting voltage proportional to displacement to needing constant charge which let me introduce both conventional capacitance microphone (with a large resistor to voltage source) and electrets.  I also explained that the electret had an enormous resistance, so we couldn’t get any measurable current out of it, and we needed an FET transistor to convert the voltage to a current.

Because both the do-now and extracting vague memories of physics from the students took longer than I had planned, we were a bit rushed for the last part of the lesson, which was a simple model of Ids vs Vds for the FET output stage of the electret mic. I asked for advice on drawing the plots for resistors and for current sources, and got the appropriate straight lines.  I then drew a smooth transition between them and claimed that the simple FET models usually consisted of a linear region at low voltage (which my co-instructor refers to as the “triode” region, a usage I’ve seen in some other presentations) and a saturation region at high voltage, and that we usually try to stay out of the sublinear region in between.

I also said that the saturation region is not really constant, but has a slight upward slope, since they will be measuring the I-vs-V characteristic of the electret microphones tomorrow, and they will certainly be observing that.  The lab handout gives them 4 models to fit: linear, constant current, an empirical blend of the two, and a model that allows current increase in the saturation region.  Neither the 3rd nor the 4th model match the ones usually used in circuit simulators, but I had trouble fitting parameters to those models, even with voltage-modulated channel lengths, so I gave up and produced simple models with few parameters that can be fit pretty easily. We’ll be revisiting FETs again before the power-amp lab (where they’ll use pMOS and nMOS power FETs to make a class-D amplifier). Somewhere around then, I’ll have to give them some usable models for how saturation current varies with gate voltage, which I deliberately did not cover in this lecture.

I’m a bit worried about how big tomorrow’s lab is.  There are again 2 parts:

• the DC characterization of the mic using the Arduino to gather data (plus a few hand-collected points for higher voltages than we can subject the Arduino to)
• designing a pull-up resistor to bias the mic into its normal operating range (in the saturation region) and observing the microphone output on the oscilloscope.  I also asked students to hook up their loudspeakers to the signal generators, to provide known inputs to the mic, and some other little stuff, but I’ll probably be happy if everyone gets the first part done and manages to observe waveforms on the scope.

On Friday, most of the lecture will be standard EE stuff by my co-instructor (probably current sources, Thévenin equivalents, and Norton equivalents).  I may have a do-now question at the beginning of the class, if I can come up with one that I think is pedagogically useful.

Filed under: Circuits course Tagged: Arduino, circuits, course design, electret microphone, teaching, voltage divider

I feel pretty good about today’s lecture, though things got a little rushed at the end.

Three-resistor voltage divider for the first question.

I started with a “do now” question, similar to the one from Monday. Actually, I started with 2 questions. The first just asked what the output voltage would be for a 3-resistor voltage divider. The second repeated the question from Monday, but with the additional constraint that the power supply was 5 volts:

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

Several students realized that the first question was a hint for the second one and that the variable resistor had to be RB or RC, and could set up the equations and solve for RA and RC.  This is a better performance than on Monday’s “do now”, but only about 1/3 of the class got it completely, and several of them were not confident of their results, so we again took time to go over the whole solution. I think that everyone (or almost everyone) understood the design process and how to set up and solve the equations by the end of the presentation, which I drew out of the students as much as possible.  I also mentioned that we could have solved the problem with a different circuit (putting RC in parallel with RB instead of in series), but did not further elaborate on that point.

The do-now plus going over the solution took about 33 minutes, which is a little more time than I’d like to be spending on these questions.  It would be good to get the time down to 15 minutes, but I don’t see how to do that without losing half the class.  If the problems are easy enough that everyone gets them, then there is no point to taking up any class time with them, and if they are hard enough that 1/3 to 2/3 of the class don’t get them, then they need to be gone over in class.

After the do-now, we spent a little time discussing the “fit” command of gnuplot, since the students have to fit models to the data they collect tomorrow, and I’m not providing them a script this time (though they can modify the script that was provided in the first lab).

Finally, we got to the theoretical meat of the class—we discussed what sound was (ending up with variations in pressure for a fluid, though we discussed briefly transverse and shear waves in solids).  Then I introduced microphones as transducers, trying to get the students to remember their elementary mechanics, so that we could do pressure→force→displacement→1/capacitance→voltage for electret mics.  The hardest part was getting students to remember that a spring-mounted object had force proportional to displacement (a lot remembered the energy was somehow related to displacement squared and got stuck on that formula).  I suspect that the local physics department would not be seeing a high score on the Force Concept Inventory for students coming out of their physics classes, as a lot of them seem to have concentrated on cramming formulas rather than learning fundamental concepts.  Someone did remember Q=CV and someone else could reason from wanting voltage proportional to displacement to needing constant charge which let me introduce both conventional capacitance microphone (with a large resistor to voltage source) and electrets.  I also explained that the electret had an enormous resistance, so we couldn’t get any measurable current out of it, and we needed an FET transistor to convert the voltage to a current.

Because both the do-now and extracting vague memories of physics from the students took longer than I had planned, we were a bit rushed for the last part of the lesson, which was a simple model of Ids vs Vds for the FET output stage of the electret mic. I asked for advice on drawing the plots for resistors and for current sources, and got the appropriate straight lines.  I then drew a smooth transition between them and claimed that the simple FET models usually consisted of a linear region at low voltage (which my co-instructor refers to as the “triode” region, a usage I’ve seen in some other presentations) and a saturation region at high voltage, and that we usually try to stay out of the sublinear region in between.

I also said that the saturation region is not really constant, but has a slight upward slope, since they will be measuring the I-vs-V characteristic of the electret microphones tomorrow, and they will certainly be observing that.  The lab handout gives them 4 models to fit: linear, constant current, an empirical blend of the two, and a model that allows current increase in the saturation region.  Neither the 3rd nor the 4th model match the ones usually used in circuit simulators, but I had trouble fitting parameters to those models, even with voltage-modulated channel lengths, so I gave up and produced simple models with few parameters that can be fit pretty easily. We’ll be revisiting FETs again before the power-amp lab (where they’ll use pMOS and nMOS power FETs to make a class-D amplifier). Somewhere around then, I’ll have to give them some usable models for how saturation current varies with gate voltage, which I deliberately did not cover in this lecture.

I’m a bit worried about how big tomorrow’s lab is.  There are again 2 parts:

• the DC characterization of the mic using the Arduino to gather data (plus a few hand-collected points for higher voltages than we can subject the Arduino to)
• designing a pull-up resistor to bias the mic into its normal operating range (in the saturation region) and observing the microphone output on the oscilloscope.  I also asked students to hook up their loudspeakers to the signal generators, to provide known inputs to the mic, and some other little stuff, but I’ll probably be happy if everyone gets the first part done and manages to observe waveforms on the scope.

On Friday, most of the lecture will be standard EE stuff by my co-instructor (probably current sources, Thévenin equivalents, and Norton equivalents).  I may have a do-now question at the beginning of the class, if I can come up with one that I think is pedagogically useful.

Filed under: Circuits course Tagged: Arduino, circuits, course design, electret microphone, teaching, voltage divider

On Tuesdays, my son and I usually have our weekly physics class, but in deference to the national holiday on Dec 25th we canceled this week’s class. I spent the day preparing drafts of lab handouts for the first three labs in the circuits course. The handouts are taking longer to produce than I expected, and they are coming out longer than expected also.  I’ll post links to the lab pages once they are past the draft stage—I’m hoping to get feedback from my co-instructor by next week.

1. The draft for the first (thermistor) lab is 10 pages, and still is missing pictures and a couple of paragraphs of text, particularly about using the data logger that my son is still writing for the students in the course to use.
2. The draft for the second (microphone) lab is 5 pages, and still doesn’t explain how to use an oscilloscope. We have both analog and digital scopes in the lab, and the analog ones a pretty easy to learn to use, but the Tektronix digital scopes have a very confusing menu interface that takes a long time to become familiar with. I still have to check out whether the function generators in the lab can drive a loudspeaker, as I’m expecting the students to be able to play sine waves into the microphones.
3. The draft for the third (electrodes) lab is also 5 pages, but it is looking fairly complete to me.

I’ve posted a tentative schedule for the 10 labs of the quarter, http://courses.soe.ucsc.edu/courses/bme194/Winter13/01/schedule:

1. Thermistor lab
2. Microphone lab
3. Electrodes lab
4. Sampling and aliasing lab
5. Audio amplifier lab 1 (op amps)
6. FET measurement lab, phototransistor measurement lab
7. Audio amplifier lab 2 (power amp)
8. Hysteresis lab (capacitive touch sensor, 1st soldering project)
9. Pressure sensor lab (instrumentation amp, soldering)
10. EKG lab

There is a little more measurement and less design content than I had wanted in the first half of the course—I’ve only come up with fairly trivial design exercises until we get to amplifiers, and then the designs get much harder.  I’m still trying to come up with a design lab for the phototransistors—right now I’m just looking a characterizing an LED and phototransistor pair for use as an optoisolator, with appropriate biasing for each to transfer analog signals (digital signals are too easy).  The students will have 3 LEDs (green, red, and infrared), so we could also look at the signal levels with each, to see whether the infrared emitter provides a better signal.

I don’t really know exactly what is in the sampling and aliasing lab, which my co-instructor created for a different course.  I’ll have to get his handouts for it, and type them up in the format I’m using for this course.  I’ll probably have to borrow a board from him also, to run through the lab myself.  It was probably designed as a 2-hour lab, not a 3-hour one, so I may want to add a bit to it.

The Digikey order for parts shipped today, the last on-line order I made, and it looks like the cost per student will be between \$65 and \$66 for tools and parts (see Parts orders for Applied Circuits W13 for more details on the pricing).  I still have to make a packing list for each kit, and put the kits together.  I hope that all the orders arrive by the middle of next week, so that we can distribute the parts kits on Wednesday 2013 Jan 9.

I also hope I’ll be able to package the kits in 1-gallon ZipLock bags—I’m beginning to think I might need to leave the loudspeakers separate, and that it will still be a tight fit. ZipLock does make bigger bags: 3 gallon, 10 gallon, and 20 gallon), but at \$1.18 each for the 3-gallon bags, I’d rather not go there—even 40¢ each for the 2-gallon bags is a bit high.

I’ve also been thinking of getting an Arduino Leonardo for testing my son’s DataLogger code, as the Leonardo has a different serial interface and a different number of analog and digital pins available: 20 I/O pins, of which 7 can be configured for PWM and 12 as analog inputs though 3 of those are also PWM pins, as opposed to the 20 I/O pins of the Uno, 6 of which can be configured for PWM and 6 as analog inputs.  There are several other incompatibilities (like where the TWI interface and that the Leonardo does not reset when the serial connection is first opened as on all previous Arduino boards).  Designing shields for Arduino boards has gotten much more complicated lately, as Arduino has proliferated a number of incompatible interfaces.  I think that this might hurt them in their main market.  I’m wondering it the Raspberry Pi is cheap enough, available enough, and easy enough to interface and program to edge out Arduino in the next few years.  I have some Raspberry Pi boards now, and when I get some time I’ll want to try playing with them.

Filed under: Circuits course, Raspberry Pi Tagged: Arduino, circuits, course design, lab exercises, Raspberry Pi

Now that we’re using a 74HC14 Schmitt trigger in the capacitive touch sensor for the hysteresis oscillator, that lab can be the first soldering project, in addition to learning about hysteresis.

I tried laying out a very compact PC board for the students to solder (still requiring them to do some design—they’ll have to breadboard their design first to get appropriate R and C values). I came up with one very compact design that could get 4 copies into the 50mm×50mm limit of the \$1 boards from ITEAD, making the boards only 25¢ each.

Compact layout to get 4 hysteresis oscillator boards out of one 50mm×50mm board. The gutters are pretty narrow, though, and I’m not sure I’m skillful enough with the board shears to cut that accurately.  The yellow “airwires” are Eagle telling me that the Gnd and +5V wires are not connected between the different copies.

It seemed a little silly to try to squeeze the price down to 25¢, when the other parts cost 90¢: 59¢ for the screw terminals, 28¢ for the Schmitt trigger chip, 1¢ for the resistor, and 2¢ for the capacitor. With this layout it is also a little tricky for the students to properly wire the unused inputs high.

Given the high risk of ruining the boards trying to cute them with the board shears, I decided to redesign for a 50¢ board.

Much looser layout, having only two copies on the 50mm x 50mm board. This version makes it easier for the students to see how things are connected, and has lots of room for the board shears to make the cut.

The lab would now require that the students measure the thresholds of the Schmitt trigger, breadboard the hysteresis oscillator, make a touch pad out of foil and packing tape, measure the frequency of the oscillation to estimate the touch pad capacitance, adjust the parameters of the Arduino program to match the frequencies of their oscillator, solder up the board, and demonstrate it working to control an LED. I think that is plenty for a 3-hour lab.

When I set up the web pages for the course, I’ll try to make sure I put the Eagle design files (.brd and .sch) for each board the students use on the web, so that future instructors can easily order more copies of the board, even if my laptop gets run over by a beer truck.  That will also make it easier for instructors at other schools to try to duplicate the course.

Filed under: Circuits course, Printed Circuit Boards Tagged: Arduino, bioengineering, capacitive touch sensor, circuits, course design, Printed circuit board, Schmitt trigger, sensors, teaching

Schmitt-trigger oscillator.

Since I decided in Capacitive sensing with Schmitt trigger to use an off-the-shelf Schmitt trigger chip (like a 74HC14) and a very simple oscillator, I needed to rethink the lab and expand it.  Students will no longer be spending much time on building the circuit, so we need to play with other uses for the oscillator circuit and other applications of Schmitt triggers.

The Schmitt trigger is a useful device for students to learn about, since hysteresis is an important concept in detecting signals.  Probably the first thing to have them do is to use the oscilloscope in x-y mode to see the Vout vs. Vin curve for the Schmitt trigger inverter. It would be good for them to devise a way to measure the threshold voltages accurately (with their lab writeup describing both the method used and the thresholds measured), using the equipment they have available.  Perhaps bonus points for methods that don’t require any of the bench equipment? (There are some fairly easy methods using the Arduino for voltage measurements, though precision would be limited to about 5mV.)

After characterizing the inverter, they should design and measure one-inverter oscillators for different frequencies, using different combinations of resistors and capacitors (some low-resistance, high-capacitance designs and some high-resistance, low-capacitance designs).  They should show computations for the frequency using the threshold voltages and the R and C values.  It might be worthwhile to have them estimate the parasitic capacitance of the input to the Schmitt trigger (together with the wiring).

Then they should measure capacitance by hooking up an unknown capacitor with a known resistance, measuring the frequency, and computing the capacitance.  We would have to make up some unknowns with a wide range of different values.

Finally, they should make a capacitive touch pad (a piece of aluminum foil covered with a layer of packing tape). I’ve decided that I like foil covered with packing tape better than foil wrapped in plastic wrap.  The tape may be a bit thicker, but the lack of an air bubble makes for a much more repeatable capacitance, and it is less likely to fall apart when handled.

They should use the oscillator frequency to estimate the capacitance of both the plain pad and the pad when touched by a finger.  After observing the oscillator output on the oscilloscope they should adjust the parameters of a simple hysteresis program to turn an LED on and off with the touch sensor so that a firm touch is needed to light the LED and it doesn’t flicker with a light touch:

```void setup(void)
{  pinMode(2,INPUT);
pinMode(13,OUTPUT);
}

void loop(void)
{   digitalWrite(13, LOW);
while (pulseIn(2,HIGH) &lt;= 60) {}
digitalWrite(13, HIGH);
while (pulseIn(2,HIGH) &gt;= 45) {}
}
```

Filed under: Circuits course Tagged: Arduino, bioengineering, capacitive touch sensor, circuits, course design, Schmitt trigger, sensors, teaching

Capacitive sensing with op amps and Capacitive sensing with op amps, continued used a rather complicated circuit to make a Schmitt-trigger oscillator out of op amps:

Modified circuit for longer period. C1 is just the stray capacitance of the touch sensor, with no deliberately added capacitance.

But if we use an off-the-shelf Schmitt trigger chip (like a 74HC14), then a very simple circuit can be made to oscillate:

Schmitt-trigger oscillator.

Without a touch sensor, it oscillates at about 10 kHz. With an untouched touch sensor, the frequency drops to about 9.5 kHz. With a touched sensor, the frequency drops further to around 6.7 kHz. I can make the touch sensor have a bigger relative frequency change by reducing the capacitor to 157pF (3 470pF in series), from 15kHz down to 8kHz. This oscillator works fine with the code I wrote for the op-amp oscillator. Neither the resistor nor the capacitor values are particularly critical (as long as the addition of about 140pF from the touch drops the frequency enough to be measurable).

The Schmitt trigger is a useful device for students to learn about, since hysteresis is an important concept in detecting signals. In fact, it might not be a bad idea to have the code that detects the frequency and turns the LED on or off have some hysteresis, as code that just uses a time-out for debouncing tends to make the LED flash on and off when a near-touch is done.

This circuit is too simple for a full 3-hour lab. It can be wired in a couple of minutes and tested in a few more. I’ll have to think of other things to do with a Schmitt trigger to make this into a full lab.  Perhaps this could be an Arduino programming lab, where they start with just a simple pulseIn program and make some modifications:

```void setup(void)
{  pinMode(2,INPUT);
pinMode(13,OUTPUT);
}

void loop(void)
{
uint8_t on = (pulseIn(2,HIGH) >= 50) ;
digitalWrite(13, on);
}
```

Perhaps a simple hysteresis program:

```void setup(void)
{  pinMode(2,INPUT);
pinMode(13,OUTPUT);
}

void loop(void)
{   digitalWrite(13, LOW);
while (pulseIn(2,HIGH) <= 50) {}
digitalWrite(13, HIGH);
while (pulseIn(2,HIGH) >= 40) {}
}
```

Students would have to measure their oscillator waveforms on the oscilloscope, then play with the constants in the code to get reliable switching. It’s still not a 3-hour lab, but it gives another view of hysteresis.

Filed under: Circuits course Tagged: Arduino, bioengineering, capacitive touch sensor, circuits, course design, op amp, Schmitt trigger, sensors, teaching

In my previous post, I said that I would post drafts of my supplemental sheets describing the course here on my blog, to get feedback before submitting them. Since I’ve been thinking more about the labs than the lectures, I’ll try writing the sheet for the lab first. It will be based, in part, on my prior list of lab topics, somewhat updated.

Information to accompany Request for Course Approval
Course #
102L (I need to get a number from the department that they are not currently using. Since we are planning the course as an alternative prerequisite to EE 104 in place of EE101+L, I think that 102 would be a good number, with the L suffix for the lab course.)
Catalog Title
Applied Circuits Lab

1. Are you proposing a revision to an existing course? If so give the name, number, and GE designations (if applicable) currently held.

This is not a revision to any existing course.

2. In concrete, substantive terms explain how the course will proceed. List the major topics to be covered, preferably by week.

1. Thermistor lab
The lab will start with having students learn about the test equipment by having them use the multimeters to measure other multimeters. What is the resistance of a multimeter that is measuring voltage? of one that is measuring current? what current or voltage is used for the resistance measurement? The first lab will then have three parts, all involving the use of a Vishay BC Components NTCLE413E2103F520L thermistor or equivalent.

First, the students will use a bench multimeter to measure the resistance of the thermistor, dunking it in various water baths (with thermometers in them to measure the temperature). They should fit a simple curve to this data (warning: temperature needs to be on an absolute scale).

Second, they will add a series resistor to make a voltage divider. They have to choose a value to get as large and linear a voltage response as possible at some specified “most-interesting” temperature (perhaps body temperature, perhaps room temperature, perhaps DNA melting temperature). There will be a pre-lab exercise where they derive the formula for maximizing . They will then measure and plot the voltage output for the same set of water baths. If they do it right, they should get a much more linear response than for their resistance measurements.

Finally, they will hook up the voltage divider to an Arduino analog input and record a time series of a water bath cooling off (perhaps adding an ice cube to warm water to get a fast temperature change), and plot temperature as a function of time.EE concepts needed: voltage, resistance, voltage divider, notion of a transducer.

Lab skills developed: use of multimeter for measuring resistance and voltage, use of Arduino with data-acquisition program to record a time series, fitting a model to data points, simple breadboarding.

Equipment needed: multimeter, power supply, thermistor, selection of various resistors, breadboard, clip leads, thermoses for water baths, secondary containment tubs to avoid water spills in the electronics lab. Arduino boards will be part of the student-purchased lab kit (separate from rest of kit, so that students can use Arduinos previously purchased). All uses of the Arduino board assume connection via USB cable to a desktop or laptop computer that has the data logger software that we will provide.

2. Electret microphone

First, we will have the students measure and plot the DC current vs. voltage for the microphone. The microphone is normally operated with a 3V drop across it, but can stand up to 10V, so they should be able to set the Agilent E3631A power supply to various values from 0V to 10V and get the voltage and current readings directly from the bench supply, which has 4-place accuracy for both voltage and current. There is some danger of the students accidentally delivering too much voltage and frying the mic, but as long as they get the polarity right, that isn’t too big a hazard. Ideally, they should see that the current is nearly constant as voltage is varied—nothing like a resistor.

Second, we will have them do current-to-voltage conversion with a 5v power supply to get a 2.5v DC output from the microphone and hook up the output of the microphone to the input of the oscilloscope. Input can be whistling, talking, iPod earpiece, … . They should learn the difference between AC-coupled and DC-coupled inputs to the scope, and how to set the horizontal and vertical scales of the scope.

Third, we will have them design and wire their own DC blocking RC filter (going down to about 1Hz), and confirm that it has a similar effect to the AC coupling on the scope.

Fourth, they will play sine waves from the function generator through a loudspeaker next to the mic, observe the voltage output with the scope, and measure the voltage with a multimeter, plotting output voltage as a function of frequency. Note: the specs for the electret mic show a fairly flat response from 50Hz to 3kHz, so most of what the students will see here is the poor response of a cheap speaker at low frequencies.

Those with extra time could look at putting the speaker and mic at opposite ends of tube and seeing what difference that makes.EE concepts: current sources, AC vs DC, DC blocking by capacitors, RC time constant, sine waves, RMS voltage, properties varying with frequency.

Lab skills: power supply, oscilloscope, function generator, RMS AC voltage measurement.

Equipment needed: multimeter, oscilloscope, function generator, power supply, electret microphone, small loudspeaker, selection of various resistors, breadboard, clip leads.

3. Electrode measurements

First, we will have the students attempt to measure the resistance of a saline solution using a pair of stainless steel electrodes and a multimeter. This should fail, as the multimeter gradually charges the capacitance of the electrode/electrolyte interface.

Second, the students will use a voltage divider, with 10–100Ω load resistor and the function generator driving the voltage divider. The students will measure the RMS voltage across the resistor and across the electrodes for different frequencies from 3Hz to 300kHz (the range of the AC measurements for the Agilent 34401A Multimeter). They will plot the magnitude of the impedance of the electrodes as a function of frequency and fit an R2+(R1||C1) model to the data. A little hand tweaking of parameters should help them understand what each parameter changes about the curve.

Third, the students will repeat the measurements and fits for different concentrations of NaCl, from 0.01M to 1M. Seeing what parameters change a lot and what parameters change only slightly should help them understand the physical basis for the electrical model.

Fourth, students will make Ag/AgCl electrodes from fine silver wire. The two standard methods for this involve either soaking in chlorine bleach or electroplating. To reduce chemical hazards, we will use the electroplating method. Students will calculate the area of their electrodes and the recommended electroplating current, and adjust the bench supplies to get the desired current.

Fifth, the students will measure and plot the resistance of a pair of Ag/AgCl electrodes as a function of frequency (as with the stainless steel electrodes).

Sixth, if there is time, students will measure the potential between a stainless steel electrode and an Ag/AgCl electrode.EE concepts:magnitude of impedance, series and parallel circuits, variation of parameters with frequency, limitations of R+(C||R) model.

Electrochemistry concepts: At least a vague understanding of half-cell potentials. Ag → Ag+ + e-, Ag+ + Cl- → AgCl, Fe + 2 Cl-→ FeCl2 + 2 e-.

Lab skills: bench power supply, function generator, multimeter, fitting functions of complex numbers, handling liquids in proximity of electronic equipment.

Equipment needed: multimeter, function generator, power supply, stainless steel electrode pairs, silver wires, frame for mounting silver wire, resistor, breadboard, clip leads, NaCl solutions in different concentrations, beakers for salt water, secondary containment tubs to avoid salt water spills in the electronics lab.

4. Sampling and Aliasing

Students will use a PC board that samples and digitizes an input with an 8-bit ADC, then reconstructs the waveform with a DAC. An existing lab has been used in other EE courses for explaining and demonstrating aliasing of sampled signals using this board, a signal generator, and a dual-trace oscilloscope. Note: this is a student-executed demo, rather than a design or measurement lab.EE concepts: quantized time, quantized voltage, sampling frequency, Nyquist frequency, aliasing.

Lab skills: dual traces on oscilloscope.Equipment needed: ADC/DAC board, dual-trace oscilloscope, function generator.

5. Audio amplifier

Students will use an op amp to build a simple non-inverting audio amplifier for an electret microphone, setting the gain to around 6 or 7. Note that we are using single-power-supply op amps, so they will have to design a bias voltage supply as well.If this lab is too short, then students could feed the output of the amplifier into an analog input of the Arduino and record the waveform at the highest sampling rate they can with the software we provide (probably around 300–500 Hz). This would again demonstrate aliasing.EE concepts: op amp, DC bias, bias source with unity-gain amplifier, AC coupling, gain computation.

Lab skills: complicated breadboarding (enough wires to have problems with messy wiring). If we add the Arduino recording, we could get into interesting problems with buffer overrun if their sampling rate is higher than the Arduino’s USB link can handle.

Equipment needed: breadboard, op amp chip, assorted resistors and capacitors, electret microphone, Arduino board, optional loudspeaker.

6. Capacitive touch sensor

The students will build an op-amp oscillator (a square-wave one, not a sine wave) whose frequency is dependent on the parasitic capacitance of a touch plate, which the students can make from Al foil and plastic food wrap. Students will have to measure the frequency of the oscillator with and without the plate being touched.

Instead of breadboarding, students will wire this circuit by soldering wires and components on a PC board designed for prototyping op amp and instrumentation amp circuits.
We will also provide a simple Arduino program that is sensitive to changes in the period of the oscillator and turns an LED on or off, to turn the frequency change into an on/off switch.EE concepts: frequency-dependent feedback, oscillator, RC time constants, parallel capacitors.

Lab skills: soldering. Frequency measurement with multimeter.

Equipment needed: Power supply, multimeter, Arduino, clip leads, amplifier prototyping board, oscilloscope.

7. Phototransistor

The details of this lab have not been worked out yet. It will probably involve either making a photointerrupter switch or making and characterizing an optoisolater made from an infrared LED and a phototransistor.EE concepts: LEDs and phototransistors (maybe also photodiodes and photoresistors), optoisolators.

Equipment needed: breadboard, LED, phototransistor, resistors, function generator, oscilloscope, multimeter.

8. Pressure sensor 1—instrumentation amplifier

Students will design an instrumentation amplifier with a gain of 300 or 500 to amplify the differential strain-gauge signal from a medical-grade pressure sensor (the Freescale MPX2300DT1), to make a signal large enough to be read with the Arduino A/D converter. The circuit will be soldered on the instrumentation amp/op amp protoboard.The sensor calibration will be checked with water depth in a small reservoir. Note: the pressure sensor comes in a package that exposes the wire bonds and is too delicate for student assembly by novice solderers. We will make a sensor module that protects the sensor and mounts the sensor side to a 3/4″ PVC male-threaded plug, so that it can be easily incorporated into a reservoir, and mounts the electronic side on a PC board with screw terminals for connecting to student circuits.

EE concepts: differential signals, twisted-pair wiring, strain gauge bridges, instrumentation amplifier, DC coupling, gain.

Equipment needed: Power supply, amplifier prototyping board, oscilloscope, pressure sensor mounted in PVC plug with breakout board for easy connection, water reservoir made of PVC pipe, secondary containment tub to avoid water spills in electronics lab.

9. Pressure sensor 2—modeling fluidics with linear circuits
Students will use the pressure sensors and amplifiers from the previous labs to characterize a pair of water reservoirs connected by a flexible hose. The details of the lab are still being worked out.Students will either induce a step change in pressure in one reservoir and record the step response in each reservoir, or will mount one reservoir on a homemade shaker table driven by a function generator and an audio amplifier.EE concepts: hydraulic analogy, frequency response (both amplitude and phase).

Equipment needed: Power supply, amplifier prototyping board, oscilloscope, Arduino, pressure sensor mounted in PVC plug with breakout board for easy connection, 2 water reservoirs made of PVC pipe, hose connections, secondary containment tub to avoid water spills in electronics lab, possibly home-made shaker table. Note: the shaker table and power amplifier is the most expensive piece of equipment not already in the lab: it will cost about \$50 to build.

10. Electrocardiogram EKG

Students will design and solder an instrumentation amplifier with a gain of 2000 and bandpass of about 0.1Hz to 100Hz. The amplifier will be used with 3 disposable EKG electrodes to display EKG signals on the oscilloscope and record them on the Arduino.Equipment needed: Instrumentation amplifier protoboard, EKG electrodes, alligator clips, Arduino, oscilloscope.

3. Systemwide Senate Regulation 760 specifies that 1 academic credit corresponds to 3 hours of work per week for the student in a 10-week quarter. Please briefly explain how the course will lead to sufficient work with reference to e.g., lectures, sections, amount of homework, field trips, etc. [Please note that if significant changes are proposed to the format of the course after its initial approval, you will need to submit new course approval paperwork to answer this question in light of the new course format.]

This is a 2-unit course. Three hours a week will be spent in scheduled labs, another 3 hours a week in pre-lab design activity and post-lab write-ups.

4. Include a complete reading list or its equivalent in other media.

Wikipedia book: http://en.wikipedia.org/wiki/User:Kevin_k/Books/applied_circuits
Because no existing textbook covers all the material of the course, collection of relevant Wikipedia articles has been made that covers all the major topics. The book is available online for free, but students can purchase a printed and bound version (about 350 pages), if they want. Some of the Wikipedia articles contain more detail than is needed for the course, but about 90% of the content is relevant and will be required.

Data sheets: Students will be required to find and read data sheets for each of the components that they use in the lab.

Op amps for everyone by Ron Mancini http://www.e-booksdirectory.com/details.php?ebook=1469 Chapters 1–6 This free book duplicates some of the material in the Wikipedia book, but provides more detail and a cleaner presentation of some of the op-amp material.

Op Amp Applications Handbook by Analog Devices http://www.analog.com/library/analogDialogue/archives/39-05/op_amp_applications_handbook.html has some useful material, particularly in Sections 1-1 and 1-4, but is generally too advanced for a first circuits course. Readings in this book will be optional for the more advanced students.

The classic book The Art of Electronics by Horowitz and Hill has one of the best presentations of op amps in Chapter 4. Chapters 1 and 4, and parts of Chapters 5 and 7 are relevant to this course. Unfortunately, the book is now 23 years old and much of the description of specific chips is obsolete, but the book is still quite expensive. We will provide page and section numbers for optional readings in this book that correspond to the readings in the main texts, but not require this book.

5. State the basis on which evaluation of individual students’ achievements in this course will be made by the instructor (e.g., class participation, examinations, papers, projects).

Students will be evaluated on in-lab demonstrations of skills and on the lab write-ups.

6. List other UCSC courses covering similar material, if known.

EE 101L covers some of the same basic electronic lab skills, but without the focus on sensors or design, and without instrumentation amps.

Physics 160 offers a similar level of practical electronics, but focuses on physics applications, rather than on bioengineering applications, and is only offered in alternate years.

7. List expected resource requirements including course support and specialized facilities or equipment for divisional review. (This information must also be reported to the scheduling office each quarter the course is offered.)

The course will need the equipment of a standard analog electronics teaching lab: power supply, multimeter, function generator,  oscilloscope, and computer plus soldering irons. The equipment in Baskin Engineering 150 (used for EE 101L) is ideally suited for this lab. There are 24 stations in the lab, but only 12 function generators. Adding a dozen \$300 function generators would make all 24 stations simultaneously usable, but the lab could be run with only half the stations, if all labs requiring function generators are done only with student pairs rather than individuals.

In addition, a few special-purpose setups will be needed for some of the labs. The special-purpose equipment was designed to be easily constructed with simple tools and to cost around \$50/setup. One of the teachers is prototyping all the lab setups at home, to make sure that they can be effectively made within budget without expensive parts or much shop time.

There are a number of consumable parts used for the labs (integrated circuits, resistors, capacitors, PC boards, wire, and so forth), but these are easily covered by standard School of Engineering lab fees.

The course requires a faculty member (simultaneously teaching the co-requisite Applied Circuits course) and a teaching assistant (for providing help in the labs and for evaluating student lab demonstrations).

8. If applicable, justify any pre-requisites or enrollment restrictions proposed for this course. For pre-requisites sponsored by other departments/programs, please provide evidence of consultation.

Students will be required to have single-variable calculus and a physics electricity and magnetism course. Both are standard prerequisites for any circuits course. Although DC circuits can be analyzed without calculus, differentiation and integration are fundamental to AC analysis. Students should have already been introduced to the ideas of capacitors and inductors.

9. Proposals for new or revised Disciplinary Communication courses will be considered within the context of the approved DC plan for the relevant major(s). If applicable, please complete and submit the new proposal form (http://reg.ucsc.edu/forms/DC_statement_form.doc or http://reg.ucsc.edu/forms/DC_statement_form.pdf) or the revisions to approved plans form (http://reg.ucsc.edu/forms/DC_approval_revision.doc or http://reg.ucsc.edu/forms/DC_approval_revision.pdf).

This course is not expected to contribute to any major’s disciplinary communication requirement.

10. If you are requesting a GE designation for the proposed course, please justify your request making reference to the attached guidelines.

No General Education code is proposed for this course, as all relevant codes will have already been satisfied by the prerequisites.

11. If this is a new course and you requesting a new GE, do you think an old GE designation(s) is also appropriate? (CEP would like to maintain as many old GE offerings as is possible for the time being.)

No General Education code is proposed for this course, as all relevant codes (old or new) will have already been satisfied by the prerequisites.

Filed under: Circuits course, Pressure gauge Tagged: Arduino, bioengineering, capacitive touch sensor, circuits, course design, ECG, EKG, electret mic, electret microphone, electrocardiogram, electrodes, electronics, multimeter, op amp, oscilloscope, phototransistor, pressure sensor, sensors, teaching, thermistor

I had a good discussion with Steve P. this afternoon about the order and purpose of the labs I’ve designed so far.  He’ll be putting together a list of EE topics we have to cover to coordinate with the labs, so that students will have enough theory to do each lab, but not be overwhelmed with theory that they don’t yet have a use for.

I’ve designed the labs mainly around the interests of bioengineering majors, but I’ve tried to keep in mind other possible students, such as Digital Arts and New Media students, who would be interested in practical sensor circuits for interfacing to art projects (particularly for inputs to Arduino microprocessors).

### Lab 1: thermistor

See posts

The first lab will consist of 3 parts, all involving the use of a Vishay BC Components NTCLE413E2103F520L thermistor.

First, the students would use a bench multimeter to measure the resistance of the thermistor, dunking it in various water baths (with thermometers in them to measure the temperature).  They should fit a simple curve to this data (warning: temperature needs to be on an absolute scale).

Second, they would add a series resistor to make a voltage divider. They have to choose a value to get as large and linear a voltage response as possible at some specified “most-interesting” temperature (perhaps body temperature, perhaps room temperature, perhaps DNA melting temperature).  There should probably be a pre-lab exercise where they derive the formula for maximizing . They would then measure and plot the voltage output for the same set of water baths. If they do it right, they should get a much more linear response than for their resistance measurements.

Finally, they would hook up the voltage divider to an Arduino analog input and record a time series of a water bath cooling off (perhaps adding an ice cube to warm water to get a fast temperature change), and plot temperature as a function of time.

EE concepts needed: voltage, resistance, voltage divider, notion of a transducer.

Lab skills developed: use of multimeter for measuring resistance and voltage, use of Arduino with data-acquisition program to record a time series, fitting a model to data points, simple breadboarding.

Note:  Mylène suggested that we start student familiarization with the test equipment by having them use the multimeters to measure other multimeters.  What is the resistance of a multimeter that is measuring voltage?  of one that is measuring current? what current or voltage is used for the resistance measurement?  We might want to do this first.

### Lab 2: electret microphone

See posts

Mylène suggested that we start oscilloscope familiarity by looking at the output of power supplies. What ripple can you see on the voltage output of a benchtop supply? of a cheap wall wart?  This requires the students to learn the difference between DC and AC input coupling for oscilloscopes.  I think that we may be able to teach what we need here without measuring the power supplies, though that is a good backup plan.

First, we would have the students measure and plot the DC current vs. voltage for the microphone.  The microphone is normally operated with a 3V drop across it, but can stand up to 10V, so they should be able to set the Agilent E3631A power supply to various values from 0V to 10V and get the voltage and current readings directly from the bench supply, which has 4-place accuracy for both voltage and current.  There is some danger of the students accidentally delivering too much voltage and frying the mic, but as long as they get the polarity right, that isn’t too big a hazard.  Ideally, they should see that the current is nearly constant as voltage is varied—nothing like a resistor.

Second, we would have them do current-to-voltage conversion with a 5v power supply to get a 2.5v DC output and hook up the output of the microphone to the input of the oscilloscope.  Input can be whistling, talking, iPod earpiece, … . They should learn the difference between AC coupled and DC coupled inputs to the scope, and how to set the horizontal and vertical scales of the scope.

Third, we would have them design and wire their own DC blocking filter (going down to about 1Hz), and confirm that it has a similar effect to the AC coupling on the scope.

Fourth, they should play sine waves from the function generator through a loudspeaker next to the mic, observe the voltage output with the scope, and measure the voltage with a multimeter, plotting output voltage as a function of frequency.  Note: the specs for the electret mic show a fairly flat response from 50Hz to 3kHz, so most of what the students will see here is the poor response of a cheap speaker at low frequencies.  Those with extra time could look at putting the speaker and mic at opposite ends of tube and seeing what difference that makes.

EE concepts: current sources, AC vs DC, DC blocking by capacitors, RC time constant, sine waves, RMS voltage, properties varying with frequency.

Lab skills: power supply, oscilloscope, function generator, RMS AC voltage measurement.

### Lab 3: electrode measurements

See posts

First, we would have the students attempt to measure the resistance of a saline solution using a pair of stainless steel electrodes and a multimeter.  This should fail, as the multimeter gradually charges the capacitance of the electrode/electrolyte interface.  For the safety of the lab equipment, we should have the beakers with salt water in a secondary containment tray at all times.

Second, the students should again use a voltage divider, with 10–100Ω load resistor, but with the function generator driving the voltage divider.  The students should measure the RMS voltage across the resistor and across the electrodes for different frequencies from 3Hz to 300kHz (the range of the AC measurements for the Agilent 34401A Multimeter).  They should plot the magnitude of the impedance of the electrodes as a function of frequency and fit an R2+(R1||C1) model to the data.  A little hand tweaking of parameters should help them understand what each parameter changes about the curve.

Third, the students should repeat the measurements and fits for different concentrations of NaCl (we’ll have to get a liter or so of each stock solution made up by one of the wet labs).  Seeing what parameters change a lot and what parameters change only slightly should help them understand the physical basis for the electrical model.

Fourth, students should make Ag/AgCl electrodes from fine silver wire. To avoid possible problems with Clorox in the lab, we’ll probably have them electroplate in NaCl solutions.  If their electrodes have an area of about 0.8 cm2 (2.5cm of 18 gauge wire with a diameter of 1.024mm), we can electroplate at the recommended current density of 1mA/cm2 (so 0.8mA) in 0.9% (0.16M) NaCl for a minute, reversing polarity occasionally to improve the chloride coat. The instructions I’ve seen vary a lot, so neither the salt concentration nor the current density seem to be particularly critical values. We could provide a constant-current supply, but we can probably get by with just having them use a bench supply and adjust the voltage manually to keep the current around 1mA, using visual feedback to terminate the process. (Some instructions just call for using a 9v battery and a whole coil of silver wire.)  According to Warner Instruments

The color of a well plated electrode will be light gray to a purplish gray. While plating, occasionally reversing the polarity for several seconds tends to deepen the chloride coating and yield a more stable electrode.

Fifth, the students should measure and plot the resistance of a pair of Ag/AgCl electrodes as a function of frequency (as with the stainless steel electrodes). We’ll have to think of an easy way for them to mount their electrodes so that they don’t move and so that the silver-copper interface is not near the salt water.

Sixth, if there is time, measuring the potential between a stainless steel electrode and an Ag/AgCl electrode.

EE concepts: impedance, series and parallel circuits, variation of parameters with frequency.

Electrochemistry concepts: At least a vague understanding of half-cell potentials. Ag → Ag+ + e-,  Ag+ + Cl- → AgCl.

Lab skills: bench power supply, function generator, multimeter, fitting functions of complex numbers, handling liquids in proximity of electronic equipment.

### Lab 4: Sampling and aliasing

I don’t know the details of this lab, but Steve P. has a PC board that samples and digitizes an input with an 8-bit ADC, then reconstructs the waveform with a DAC.  He has worked out a lab for explaining and demonstrating aliasing of sampled signals using this board, a signal generator, and a dual-trace oscilloscope.  I’ll have to borrow the board and the lab handout from him to see if there is anything in the lab I’d want to tweak.

EE concepts: quantized time, quantized voltage, sampling frequency, Nyquist frequency, aliasing.

Lab skills: dual traces on oscilloscope.

### Lab 5: Op amp basics

See post Op-amp lab

Use an op amp to build a simple non-inverting audio amplifier for an electret microphone, setting the gain to around 6 or 7.  Note that we are using single-power-supply op amps.

If this lab is too short, then students could feed the output of the amplifier into an analog input of the Arduino and record the waveform at the highest sampling rate they can with the software we provide (probably around 300–500 Hz).  This would again demonstrate aliasing.

EE concepts: op amp, DC bias, bias source with unity-gain amplifier, AC coupling, gain computation.

Lab skills: complicated breadboarding (enough wires to have problems with messy wiring). If we add the Arduino recording, we could get into interesting problems with buffer overrun if their sampling rate is higher than the Arduino’s USB link can handle.

### Lab 6: capacitive touch sensor

See posts

The students would build an op-amp oscillator (a square-wave one, not a sine wave) whose frequency is dependent on the parasitic capacitance of a touch plate, which the students can make from Al foil and plastic food wrap. Students would have to measure the frequency of the oscillator with and without the plate being touched.

We can provide a simple Arduino program that is sensitive to changes in the period of the oscillator (see example in Capacitive sensing with op amps, continued) and turns an LED on or off.

EE concepts: frequency-dependent feedback, oscillator, RC time constants, parallel capacitors.

Lab skills: more messy breadboarding.  Frequency measurement.

### Lab 7: Phototransistor

See posts

Since optical detection is such an important part of many biomolecular lab techniques, I really want to do something with an LED and phototransistor (or CdS cell or photodiode), but so far none of my ideas have worked out.  I have a nice Fairchild QRE1113 reflectance sensor that uses a matched 940nm wavelength LED and phototransistor, which I’ve used a tachometer for motors for the robotics club. Unfortunately, a tachometer is more appropriate for a mechatronics lab than a biengineering circuits course.

I thought that I might be able to use it to measure arterial pulses by reflection, but I don’t seem to get a signal at my heart rate (I did better with the uncomfortable ear clip).

The reflectance sensor is good for measuring finger tremor if you hold a finger close to (but not touching) the sensor.  The effect is optical, not capacitive coupling, since the signal is stronger if a non-conducting white piece of paper is held near the sensor rather than a finger.  The reflectance sensor is remarkably insensitive to ambient light, though shining a laser pointer on the sensor is easily detected.

We can easily do labs involving interrupting light beams, but there isn’t much “circuit” stuff for the simple ones and not much “bio” stuff either.  We could up the circuit content (perhaps too much) by modulating the light beam and using a synchronous demodulator to detect the beam even in the presence of high ambient light.

I still need to find something that is feasible and somehow related to bioengineering.  This needs more thought.

### Lab 8: No idea

I’m still missing a lab.  I’ve not done anything with position, pressure, or volume sensing yet.  Of course, it is possible that some of the earlier labs will take longer than I think, and we’ll need to slip the schedule anyway.  The EKG lab looks pretty packed, so may be some portion of that could be foreshadowed here.  Perhaps bandpass filtering and characterizing a simple filter?  That would be useful, but rather boring.

Maybe an electronic music lab of some sort would be fun here?

### Labs 9 and 10: EKG

See posts

The electrocardiogram will be the final project for the course, and I think it will take two full lab sessions. The first lab session would consist of soldering up the instrumentation amp protoboard, checking for opens and shorts, and designing and characterizing a differential amplifier with an adjustable gain of about 100–1000 (including AC coupling to eliminate problems with DC offset saturating later stages).  The amplifier should have a bandwidth of about 0.01Hz–150Hz.

The second one would be and making a twisted-wire harness with alligator clips to attach to the EKG electrodes, connecting the amplifier to the electrodes, debugging the student-designed EKG amplifiers, and adjusting the gain.  I suspect that a few students will get a design that works in the first week, but that a lot of students will be doing a lot of unsoldering and resoldering as they find bugs in their design, hence the need for 2 weeks in the lab.

Student check out will require that they be able to blink an LED in time with their heart beat, display the EKG waveform on the oscilloscope, and record a minute of EKG signal at 200 samples/second using the Arduino, all without adjusting their board between demos.

EE concepts: biopotentials, instrumentation amplifier, common-mode signal, differential signal, twisted pair wiring, grounding to avoid common-mode signal saturating an instrumentation amplifier, Ac coupling, simple bandpass filtering.

Lab skills: soldering.

### Summary

I have a pretty clear idea how I think the lab part of the course should start and how it should end, but there are a couple of weeks just before the end that are still a bit vague.  Perhaps as Steve starts aligning the EE topics with the labs he can identify some topics that need a lab exercise to clarify them.  Maybe some of my blog readers (those who haven’t deserted me during this long process of designing a course) can make some more suggestions—even repeating some old suggestions would not be a bad idea now, as I need a creative kick.

Filed under: Circuits course, Data acquisition Tagged: Arduino, bioengineering, capacitive touch sensor, circuits, course design, ECG, EKG, electret mic, electret microphone, electrocardiogram, electrodes, electronics, multimeter, op amp, oscilloscope, phototransistor, sensors, teaching, thermistor

One of the people that I asked to look over the course notes and give me suggestions suggested another lab that would likely appeal to bioengineers:

another cheap experiment, accelerometers from Sparkfun to measure gait patterns or detect falls.  If really ambitious, you can teach chaos theory here with analyzing chaos levels in gait patterns—they are different for men and women.

I’ve used accelerometers before, both the analog output ADXL335 and the I2C MQA8452Q. The ADXL335 breakout board was from Adafruit Industries, the MQA8452Q from Sparkfun.  Although I personally prefer the I2C interface, since it takes up only 2 Arduino pins, programming is outside the scope of this class.

This lab sounds like fun, and it would be good for the bioengineers to think of accelerometers as cheap sensors that are easily used, rather than as magic that comes in cell phones, I’m not sure how we would get a circuits lab out of this. Even the analog-output accelerometer just needs to have its XYZ pins connected to analog inputs on the Arduino.  Anything interesting you do with the accelerometer is in either the mechanical mounting or in the software analyzing the data, not in electronic circuits.

We have several constraints in selecting labs for this circuits course:

• Lab must teach something useful to the students.
• Lab must seem interesting (or at least useful) to bioengineering students.
• Lab must not be dangerous (either to students or to equipment).
• Lab must be doable in one 3-hour lab session (we can afford at most 2 labs that are 2-session labs).
• Lab cannot require students to be able to program computers.
• Lab cannot require knowledge of electronics beyond what is taught in the course.
• Lab should support the teaching of traditional linear circuits.
• Lab should involve student design and not just analysis of existing designs.

The accelerometer lab fails on two points: any design component would have to be software and there is no support for teaching linear circuits in the lab.  That’s too bad, because it is otherwise a cool lab idea.

Filed under: Accelerometer, Circuits course Tagged: accelerometer, Arduino, bioengineering, circuits, course design

### DNA melting

I spent some time yesterday thinking about whether we could do optical detection of DNA (particularly some variant of the DNA melting lab from MIT—see also the Fall 2008 class handouts).  I noted in the 2008 handouts that they were using a blue LED array driven by a 0.29A current source (made from an LM317T voltage regulator, a rather inefficient method). The wiki page uses a regulated 5V supply and a 25Ω series resistor, which would be around 60–70mA for a typical forward drop of 3.2–3.5V in a blue LED.  That’s still a pretty powerful light source for an LED. They say they are using LZ1-00B200, which has a 3.6V forward voltage, but can handle a full amp of current, so is more LED than is needed.

We can get a blue LED for under \$2 that can handle 50mA continuously (LTL911CBKS5), though it has a forward voltage of typically 4.3V.  In surface mount for \$1.14, we could get MLEBLU-A1-0000-000T01, which has a dominant wavelength of 465–485nm (depending on bin code) and a luminous flux of 10.7 lm at 150mA (forward voltage 3.2V).  I estimate the LED MIT mentions produces about 6lm at that current.  The expensive part of the illumination is not the LED, but the focusing lenses to concentrate the light and the optical filtering needed to keep the excitation wavelength from being detected by the photodiode.

I was thinking that it would be cool to use a laser as an excitation source, rather than an LED, since then no lenses or filter would be needed on the source—just a blocking filter on the photoreceptor. Unfortunately, blue lasers are very expensive.  What are cheap are the blue-violet lasers at 405nm, since the laser diodes are made in quantity for BluRay players. (Amazon has 405nm laser pointers for under \$10 with shipping.) Unfortunately the usual fluorescent dyes used for DNA melting measurements (SYBR Green, LC Green Plus, EvaGreen) are not excited at 405nm, and need excitation wavelengths in the range 440nm–470nm).  I’ve been wondering whether one of the 405nm-sensitive dyes used in flow cytometry (like Sytox Blue dead cell stain) could be used.  But I’ve not found a double-stranded DNA dye for sale that is easily excited at 405nm (even Sytox Blue is way down in sensitivity from its peak), so laser excitation seems to be out—the excitation wavelengths needed for standard dyes require fairly expensive lasers.  The benchtop lasers usually used in labs and flow cytometry equipment are priced in the “if-you-have-to-ask” price range.  Buying enough copies for a student lab is more than this lab is worth.

I still don’t see a way to make the DNA melting curve project work within our course.  Even MIT gives up half a semester to this lab, and we don’t have that much time (nor that caliber of students, on average).

### Soldering project

I want the students to learn to solder (at least through-hole parts, not necessarily surface-mount). I don’t want to do the traditional blinky-light soldering practice, so I’ve been looking for a place in the course where it makes sense to require soldering, rather than wiring up a breadboard.

Breadboards have problems with loose wires, so the more complex the circuit, the more problems a breadboard causes.  Breadboards also have problems connecting to wires that have to leave the breadboard—particularly wires to moving objects.  This suggests that the EKG/EMG circuit would be the most appropriate as a soldering project, as it is fairly complicated and the long wires to the Ag/AgCl gel electrodes can cause a lot of problems with loose connections (my first check on debugging is to wiggle the header pins for those wires).

But I want the students to be doing some designing for the EKG circuit, not just soldering up a predetermined circuit, so I’m thinking of designing an instrumentation-amp protoboard, which has an ina126 instrumentation amp and an MCP6002 dual op amp chip, with power pins wired up and a place for the Rgain resistor and bypass capacitors, but everything else in a breadboard-like configuration, so that resistors, capacitors, and jumper wires could be added.   Off-board connections could be done with screw terminals to make sturdy connections.

My son and I came up with the further idea of adding an optional LED output, to make a blinky-light-EKG device.  I think that the approximately 1.5V, 30msec pulse that I was seeing for the R segment of the EKG would be enough to make a visible flash—I’ll have to try it out on my breadboard.  I tried it today, but I was only seeing 0.5V pulses today (poorer contact with the electrodes?), and I had to raise the 3.9kΩ feedback resistor to 10kΩ to increase the gain of the final stage., which was enough to get weak flashes from an LED with a 100Ω series resistor.  Because the op amp has limited output current (±23mA short circuit), I felt it fairly safe to put the LED directly between the op amp output and the Vref signal, which gives a good flash even with a green LED.

The lower voltage that I got this time (until I raised the gain) makes it clear that if I do make an EKG protoboard, it should have room for some trim pots for adjusting the final gain.

Filed under: Circuits course Tagged: Arduino, bioengineering, blinking light, circuits, course design, DNA melting, ECG, EKG, electrocardiogram, instrumentation amplifier, laser, op amp, pulse, violet lasers