Gas station without pumps

2012 December 30

Mic modeling lab rethought

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

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:

    Current vs. voltage curve for electret mic with more data points, showing that just making measurements from 1v to 10v was a bad idea.

Current vs. voltage curve for the electret mic The magenta curve (with the log dependence on voltage across the mic) was my previous model, based on data from 1v to 10v.  I don’t know what theory gives the appropriate slope to the saturation current—most of the models I’ve seen make that region constant current.

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:

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

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

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 r
  • constant saturation current v/i_{sat}
  • blend of resistance and saturation current \sqrt{r^2 + (v/i_{sat})^2}
  • power-law slope for resistance in saturation region \sqrt{r^2 + (v^{v_{exp}}/i_{sat})^2}

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:

On a log-log scale, both the blended models look pretty good.

On a log-log scale, both the blended models look pretty good.


Changing the current to a linear scale makes the problems with the constant saturation current model clearer.
The multimeter measurements are almost certainly better than the measurements with the Arduino, but the sheer number of measurements with the Arduino (about 1200, once duplicates are removed) makes those measurements dominate the fitting.

It was actually from looking at the equivalent resistance of the microphone that I saw a simple way to produce the blended model without having to introduce new parameters (like saturation voltage).

It was actually from looking at the equivalent resistance of the microphone that I saw a simple way to produce the blended model without having to introduce new parameters (like saturation voltage).  On this plot, the improved fit in the sublinear region for my model is clearer.

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.



  1. […] I think I rescued the electret microphone lab by having the students automate the I-vs-V measurements with the Arduino and the following circuit (see Mic modeling lab rethought): […]

    Pingback by FET modeling lab looking complicated « Gas station without pumps — 2013 January 2 @ 17:06 | Reply

  2. […] how the diodes work, but concentrate on finding simple models that fit the data. For example, the FET models we used for the mic are not quite the standard ones, since there is a clear slope in the saturation region, and it […]

    Pingback by Teaching students to build and use models « Gas station without pumps — 2013 February 16 @ 11:45 | Reply

  3. […] voltage for an electret microphone and then look at the microphone outputs on the oscilloscope (see Mic modeling lab rethought).  I still want to do those parts, but I’d like to add some more reading of the datasheet, […]

    Pingback by Microphone sensitivity exercise | Gas station without pumps — 2013 July 31 @ 13:47 | Reply

  4. […] year, in Mic modeling lab rethought, I designed the DC measurement of an electret microphone around the capabilities of the Arduino […]

    Pingback by New modeling lab for electret microphone | Gas station without pumps — 2014 March 31 @ 19:38 | Reply

  5. […] my posts Diode-connected nFET characteristics, More mess in the FET modeling lab, and Mic modeling rethought showed my learning about the characteristics of nFET transistors, where I ended up with a different […]

    Pingback by Practice, teaching, or genetics | Gas station without pumps — 2014 October 13 @ 10:05 | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: