Gas station without pumps

2017 April 10

Electret microphone hysteresis

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 09:05
Tags: , , , ,

In attempting to determine the I-vs-V characteristics of an electret microphone, I stumbled across a phenomenon that I’m still having difficulty explaining.  What I was looking for was a plot like this one:

I-vs-V DC characteristics for an electret microphone. The linear and saturation regions are nicely distinguished and there is little noise.

In previous years I had collected the data with PteroDAQ, but this plot was done with my Analog Discovery 2, which combines both the function generator and the data acquisition. Because I was in a bit of a hurry, the first time I tried doing the characterization, I used a shorter period for the function generator, and got a somewhat different plot:

The hysteresis observed here was unexpected. The loop is traced clockwise, with the upper curve for increasing voltage and the lower curve for decreasing voltage.

At first I thought that the effect was a thermal one, like I saw when characterizing power MOSFETs, but a thermal phenomenon would get more pronounced at slower sweep rates (more time to heat up and cool down), while the hysteresis here could be reduced by sweeping very slowly. Also, the hysteresis did not rely on running large currents—the mic was dissipating less than 1mW at the most, and changing the voltage range did not change the hysteresis much.

My next conjecture was a capacitive effect, which I tentatively confirmed by either adding a capacitor in parallel with mic (increasing the hysteresis) or a capacitor in parallel with the 5.1kΩ sense resistor (which reduced the hysteresis or even reversed it).

I tried playing with the frequency of the excitation waveform, to see what happened to the hysteresis:

This pretty plot shows the transition from nearly DC (the curve that looks like the first one of the post) to something that looks almost like a resistor, with current going up linearly with voltage, as the frequency is increased.

Because the hysteresis did not seem to depend on the amount of the sweep, I picked a voltage well into the saturation region (4V), and tried doing a Bode plot of impedance for the mic for a relatively small signal (±1V). I then fit the Bode plot with an (R1+C)||R2 model:

The parallel resistor corresponds to the slope of the DC I-vs-V curve around a bias of 4V. The model fits the data so well that the curve for the data is hidden by the model curve.

I also tried a Bode plot for a DC offset of 2V and an amplitude of ±300mV:

Like with the 4V DC bias, I got an extremely good fit with the (R1+C)||R2 model. The parallel resistance is different, because the slope of the I-vs-V plot is a little higher (so smaller resistance) at 2V than at 4V.

Because the network tool in WaveForms 2015 provides phase information as well as magnitude information, I did my fit first on magnitude, then on phase. The phase fitting was also extremely good:

I show only the 2V phase plot here—the 4V one is similar, though the biggest phase shift is -56.5° at 3.5V, rather than -45.1° at 4.6 Hz.

So I have an excellent electrical model of the behavior of the electret mic at a couple of different bias voltages, with a simple explanation for one of the parameters of the model. I’m still mystified where the capacitance (about 1.7µF) and the other resistance (about 8kΩ) come from. I suppose, theoretically, that they could be tiny surface mount components inside the can of the mic, but I see no reason for the manufacturer to go to the trouble and expense of doing that. The pictures of a disassembled mic at http://www.openmusiclabs.com/learning/sensors/electret-microphones/ suggest a rather low-tech, price-sensitive manufacturing process.

Incidentally, until I looked at those pictures, I had a rather different mental model of how the electret mic was assembled, envisioning one with a simple membrane and the electret on the gate of a MOSFET. It seems that the electret is put on the surface of the membrane and a jFET is used rather than a MOSFET. After thinking about it for a while, I believe that a jFET is used in order to take advantage of the slight leakage current to the gate—the gate will be properly biased as a result of the leakage. The OpenMusicLabs post showed a 2SK596 jFET (an obsolete part), which has an input resistance of only 25—35MΩ, easily low enough to provide bias due to leakage currents. If the gate is biased to be about 0V relative to the source, then the jFET is on by default,

The 1.7µF capacitance is huge—many orders of magnitude larger than I could explain by a Miller effect (unless I’ve screwed up my computations totally) as all the capacitances for the jFET are in the pF range, and the multiplier for the Miller effect should only be around 5–50 (1–10mS times the 5.1kΩ load), so I’m still at a loss to explain the hysteresis. I checked to see whether the effect was something in my test setup, by replacing the mic with a 10kΩ resistor, but it behaved like a 10kΩ resistor across the full range of frequencies that I used for testing the mic—this is not some weird artifact of the test setup, but a phenomenon of the microphone (and probably just of the jFET in the mic).

I suppose I should buy a jFET (maybe a J113, that has a 2mA saturation current with a 0V Vgs) to see if other jFETS have similar properties, connecting the gate to the source with a small capacitor to imitate the electret biasing.

Incidentally, while doing this experimenting, I found a bug in the Waveforms 2015 code: if you sweep the frequencies downward in the network analyzer (which works), on output to a file the frequencies are misreported (as if they had been swept upward). I reported this on the Digilent Forum, and they claim it will be fixed in the next release. The time between the report and the acknowledgement was only a few hours, which is one of the fastest responses I’ve seen for a software bug report. (They didn’t say when the next release will be, but they’ve had several since I bought my Analog Discovery 2 four months ago, so they seem to be releasing bug fix versions rapidly.)

2016 December 15

Electret mic DC characterization with Analog Discovery 2

I tried one of the standard labs for the course, producing an I-vs-V plot for an electret microphone, using the Analog Discovery 2 function generator and oscilloscope, rather than a bench function generator and a Teensy board with PteroDAQ.

It was fairly easy to set up a 0–5V triangle wave, running at a very low frequency (50mHz, for a 20-second period).  The maximum output from the waveform generator is 5V, so setting the amplitude higher did not get larger voltages.  The signal was applied across the microphone in series with a sense resistor, and the voltage measured across the mic and across the sense resistor.

I ended up using two different sense resistors: one for measuring the current at high voltages, and one for measuring the current at low voltages, and I had to adjust the voltage scales on the two channels of the scope for the different ranges.  The results were fairly clean:

The low-voltage behavior of the nFET in the electret mic is not quite a linear resistor, and the saturation current definitely increases with voltage.

The low-voltage behavior of the nFET in the electret mic is not quite a linear resistor, and the saturation current definitely increases with voltage.

I tried extending the voltage range by using the power supply as well as the function generator: I set the function generator to a ±5V triangle wave, and used a -5V supply for the low-voltage reference. This worked well for the higher voltages, but the differential signal for the mic had an offset of about 12mV when the common-mode was -5V, which made the low-voltage measurements very wrong.  This offset may be correctable by recalibrating the scope (I am currently using the factory default settings, because I don’t have a voltmeter at home that I trust to be better than the factory settings), but I’m not counting on it.  When I need measurements of small signals, I’ll try to make sure that the common-mode is also small.

One other minor problem with the Analog Discovery 2: the female headers on the wires seem to have looser than usual springs, so that the wires easily fall off male header pins.  Given the stiffness of the wires, this is a bit

2015 May 5

First op-amp lab was quick

Filed under: Circuits course — gasstationwithoutpumps @ 21:12
Tags: , , , ,

On Monday I provided a little feedback on the design reports for the electrode lab.  The big issues were

  • Students not reporting the models they were fitting to the data.
  • Students not reporting the parameters of the fits after doing the fitting.
  • Students choosing overly complicated models (like R+(R||C) for data showing constant impedance)
  • Students not modeling important phenomena (like the (R||C) input impedance of the voltmeters)

Little issues included

  • Using “due to the fact that” rather than “because”
  • Omitting leading zeros before a decimal point.  Numbers should never start with punctuation.

After that brief intro, I worked with the students to develop a block diagram for an audio amplifier using the electret microphone and loudspeaker that they had already characterized.  This had been part of their homework, but I expected them not to have really grasped the point of a block diagram.

Another thing I went over in class, because I’d seen problems with it in previous reports and prelabs ,was reminding students that V=IR is not a ritual magic incantation. Reciting it doesn’t make solutions to problems right, if it is just randomly applied.  I reminded them that the voltage has to be across the resistor that the current is through—picking random voltages or currents in the circuit is meaningless.  I showed them an example taken from the prelab they were turning in at the end of class.

When I did the grading for the prelab homework Monday night, I saw that many of the students managed to copy the block diagram we had done in class, but none had appropriately labeled the signals between the blocks.  I think I need to provide some more and better examples in the book.  (Ah, I see I already have marginal notes to myself to add a couple in Chapter 2.)

The V=IR error was very common, mostly with V was taken to be the power supply voltage, rather than the voltage across the resistor that biases the microphone.

Students also had a lot of trouble with computing the AC voltage of the signal out of the microphone, based on the loudness of the sound input and the sensitivity of the microphone. I knew this was a difficult assignment, but I thought that it would be relatively easy, because they had supposedly already created a worksheet for themselves as part of Lab 4 (the microphone lab).  Either they forgot everything they learned there, or they never really got the idea of the worksheet they created.  One student asked in class on Monday, quite reasonably, for a worked example.  I’m going to have to come up with one that doesn’t just do all the work for them—I know these students can fill out worksheets, but what I need to get them to do is to solve problems when the steps aren’t all set out for them.

The afternoon lab section (many of them working together) did much better on the prelab than the morning section—the difference between the sections has been noticeable from the beginning, but it seems to be getting bigger, not smaller.  For some reason the descaffolding is working better with the smaller section.  Individuals in the morning lab are doing quite well, but there are more floundering students in that section, and I don’t know how to get them back on track.

Even though the morning lab is struggling more than the afternoon lab, I think that both are doing better than previous year’s classes at this point of the quarter.  With only one or two exceptions, everyone in both lab sections got their op amp circuit designed, wired, and demonstrated within the 3-hour class period.  That means that Thursday’s lab can be a tinkering lab for most of the students, where they can try various ways of improving the design:

  • Switching from a symmetric dual power supply to a single power supply.
  • Paralleling two op-amp chips to get twice the current capability.
  • Adding a potentiometer for variable gain.
  • Adding a unity-gain buffer to separate the loudspeaker driver from the gain amplifier.
  • Adding a tone-control circuit, like the Baxandall tone control on http://www.learnabout-electronics.org/Amplifiers/amplifiers42.  They can’t use exactly that circuit, as they have only 10kΩ potentiometers, not 100kΩ ones.  The idea can be adapted, or the students could do simple treble-cut or bass-cut circuits.
  • Using a loudspeaker as a microphone. I think that should work, as I get about a 500µV signal from my loudspeaker when I talk into it.  The don’t need any DC bias for the loudspeaker mic, and they may even be able to eliminate their high-pass filter, as the loudspeaker mic can be set up to have its output already centered at 0V.

I’ll talk about some of these possibilities in class tomorrow (plus stroking the students a bit about getting the lab done quickly). I attribute he good performance on the lab to them having put in more time on the prelabs, even if they didn’t get the answers to the questions exactly right.  Thinking about the design ahead of time (and getting a little feedback) goes a long way toward clearing up confusion they have had.

There are 4 more amplifier labs coming:

  • Instrumentation amps with a strain-gauge pressure sensor (measuring breath pressure and blood pressure using an arm cuff).  Will need to be 2-stage, since the INA126PA chips we are using aren’t rail-to-rail amplifiers.
  • Transimpedance amplifier fora photodiode to measure pulse.  This will also need to be multistage, since the first stage will have to have limited gain to avoid saturation.  After high-pass filtering much more gain will be needed.
  • Class-D power amplifier.  This is always the toughest lab of the year.  Even small mistakes can result in shoot-through current that gets the FETs hot enough to melt the breadboards (I have two breadboards that I’ve melted holes in).
  • EKG using only op amps (making their own 2-op-amp instrumentation amp, plus high-pass filtering and a second gain stage.  They’ll be using all 4 of the op amps in the quad op amp package for this amplifier.

I’m about a week behind on grading redone assignments—weekends are spent grading design reports, Monday nights grading prelabs, weekends plus Tuesdays adding to the book a chapter ahead of the students, and I squeeze in the redone assignments Wednesday or Thursday night, if I don’t crash too early.

2015 April 16

Microphone labs went OK

Filed under: Circuits course — gasstationwithoutpumps @ 21:19
Tags: , , ,

The microphone labs this week went OK (much better in the afternoon session than the morning session).  On Tuesday the students collected data for an I-vs-V plot of the electret microphone, both using a power supply and a pair of voltmeters and using just the PteroDAQ system on the KL25Z board (see New modeling lab for electret microphone for the basics of the PteroDAQ portion of the lab).  Most groups got all the data they needed on Tuesday, but some were still struggling with it on Thursday.

On Wednesday, I went over the model fitting in gnuplot used to produce the fits for the 4 models I gave them: linear resistance, constant current, a “blended model” that is asymptotically the same but switches smoothly between them, and one that adds one more parameter to get a slope for the saturation region(again, see New modeling lab for electret microphone for the models) .  Some students in the class asked for a copy of the script I developed in class, but I turned them down—the goal is to get them to develop their own scripts, and they had examples of most of what I did from the previous week’s class, which included a worked example.

In previous years, I used to give out all the things developed in class as worked examples, but I’ve stopped doing that, because far too many students just blindly copied and ran scripts without understanding them (often not even changing the parameter values that were different between what I did in the example and the data they collected).  One point of this class is to get students to stop thinking of class work as ritual magic that just requires doing the right memorized or copied procedure, and to get them to think in terms of creating new stuff from building blocks that they understand. It is unfortunate that most of the chemistry and physics labs they have had are exactly that sort of ritual magic, with a worksheet telling them exactly what steps to perform and what results to fill in the blanks with.

They need to learn to generalize from worked examples, read documentation, and figure out how to make things work. I’m always happy to help them debug their efforts, but not to do the work for them.  I’m not in the class to get right answers from the students, but to get them to learn how to design and debug—to ask their own questions and figure out how to answer them. (See Answer getting for more on what change I’m trying to invoke.)  Some of the top students are already on board with the concept and are working hard to understand electronics, modeling, graphing, debugging, and so forth , but a number of the students are still stuck in the “tell me exactly what to memorize and what steps to do” state that seems characteristic of many high school students.  The biology classes they’ve had have not done much to move them away from that—there is far too much memorization without understanding going on in the bio courses.

In addition to the model fitting, I answered questions from the homework—mainly about the calculation of the output voltage from the mic for a given input sound level. I reviewed decibels again and went through the various scaling operations needed to get the output in µV RMS from sound pressure level.  I think that the top students got it, but I’m also pretty sure I lost the bottom ones—it’s a little hard to tell as they all work so hard on looking intelligent that I have a hard time telling when they are lost and when they are bored because I’m going too slow.

Today’s lab was a little bit of design (choosing a load resistor based on the I-vs-V curve, and designing a high-pass filter to block the DC) and practice using the oscilloscope. I did something different this year, having them design their high-pass filter with the input impedance of the oscilloscope as the “R” of the RC filter. In part this was to get them to realize that connecting a test instrument like an oscilloscope or voltmeter always changes the circuit that is being tested.  I even had them design around the 10MΩ input impedance of the 10× scope probe—so the 10MΩ impedance was not “almost infinite” the way many intro electronics courses teach it.  I don’t think I made a clear enough point of this message—neither in the book nor in the lab sections, so I’d better mention it in class tomorrow also.

Unfortunately, some of the material from the old lab (where they used bigger capacitors and smaller resistors for the high-pass filter) was not edited out in making the changes, so the lab chapter was rather confusing.  I’ve left some notes to myself to update the chapter, but I probably won’t have time until this summer.

2015 April 13

Too much prelab homework for microphone lab

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

In putting together the book for this quarter, I added exercises to some of the chapters, and I assigned a chunk of them due today as the pre-lab exercise for the microphone lab.  I just spent over 3 hours grading the set, just marking questions right or wrong. There were too many questions, and even the best in the class got only 8/11, with the bottom of the class getting 3/11. I think that the class is doing better this year than previous years’ classes, but some of them got discouraged by how much and how difficult the homework was.  The amount was certainly more than I had intended, but next week’s homework should be substantially less.  I’ll have to figure out how to distribute the load more evenly next year.

I spent most of today’s lecture going over two of the questions (in response to student request), and I’ll have to do some of the other ones on Wednesday, in addition to showing them how to model DC behavior of the FET in the electret microphone. I may also ask the group tutor for the class to have an extra help session this week.  The two questions that got asked about were the modeling of the oscilloscope probe and computing the sensitivity of the electret microphone circuit with a different load resistor.

Some of the problems students had were ones that can be easily fixed (like that 1/10000 is 0 in gnuplot, because it looks like integer arithmetic—1/10E3 does the right computation, as does 1./10000).  Other problems were fundamental misunderstandings of complex numbers or complex impedance, which may be harder to address.

Next Page »

Blog at WordPress.com.

%d bloggers like this: