In Mic modeling lab too complicated, I complained about the following graph being too complicated for the 2nd week lab for the circuits for bioengineers course:
I spent all day yesterday rethinking this lab and trying a number of different approaches. (Well, not quite all day—I spent some time in the morning testing all 12 pressure sensor boards I’d soldered up the day before.)
What I decided to do was to embrace the non-linearity and have students characterize the part, but I’ll give them some simple models to fit. I also decided to have the students use the Arduino to automate the data measurement—I didn’t have enough use of the Arduino in the course, and automating tedious measurements is precisely why we decided to include the use of the Arduino in the course.
Of course, there are some limitations of the Arduino analog-to-digital converter that are important for this lab:
- 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.
I think I’ll 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. Then I’ll have them wire up a simple circuit on the breadboard:
The idea is simple: the bench power supply will provide a known voltage (between 0.5v and 5.0v) to the external reference AREF, and the data logger code will measure the voltage across the load resistor and across the load resistor every 100msec. The students will adjust the trimpot (they have 18-turn 10kΩ trimpots in their parts kits), while the Arduino measures the voltages. They’ll then use gnuplot to plot the i-vs.-v and r-vs.-v curves for the device. They’ll probably have to collect two or three files of data, with different AREF voltages (0.55v, 2v, 5V, for example) in order to cover the full range of values with adequate precision.
I put the load resistor on the lower leg, so that I could get more accurate readings of low currents. I had tried it on the upper-leg first, but the results were not as consistent with different AREF voltages.
I’ll give them four models to fit and some hints on how to fit multi-variable models with gnuplot, here expressed as resistances:
- constant resistance
- constant saturation current
- blend of resistance and saturation current
- power-law slope for resistance in saturation region
The first two models are the ones most often used as rules of thumb when designing. The third one provides a decent blending between them, though it is purely an empirical fit—there is no theory that says this is the right model in the sublinear region (though the usual model for pinch-off current seems just as arbitrary to me). The last model has no theoretical justification at all, it just provides a good way to match the empirically observed dependence of the “saturation” current on voltage. I played with lots of models before deciding on these four.
Here are some plots of how well they fit the data I measured:
I think that the “linear” region may actually be better modeled with a resistance that varies with voltage, rather than a constant resistance, but the data I have at the low voltage end is rather bad: the quantization errors are extreme and I don’t really trust the numbers. Trying to add more complexity for the linear region did not seem to improve the fit, and we never use the mic in the linear region anyway, so I decided to keep the models simple.
So the microphone lab will have two major components:
- DC characterization of the microphone, using the Arduino to automate measurements.
- Visualization of AC waveforms using the oscilloscope.
I just hope that there is enough time in the 3-hour lab for the students to do both.