Gas station without pumps

2022 January 3

Test box resonances

In Microphone test box, I talked about the first steps in building a box for testing microphones, testing hearing aids, and other small sound experiments.  In that post, I just showed the physical setup and did some impedance measurements of the loudspeakers in the box.

I saw only weak indications of acoustic resonances in the impedance measurements of the speakers, but I expected that a wooden rectangular box would actually have strong resonances. So my next step was to put a microphone and transimpedance amplifier in the box to measure the resonances using the Analog Discovery 2 as a network analyzer.

electret-mic-for-network-analysis

Here is the transimpedance amplifier I used for biasing the microphone and converting the current output to a voltage. The bias voltage is set by W2 of the Analog Discovery 2, with a low-pass filter to remove any noise added in the wire. The gain of the amplifier is 1kΩ (so 1µA becomes 1mV). The 5.6kΩ at the scope input reduces the scope impedance, so that current picked up in the wire does not make a large voltage. (More on that below.)

I set up the network analyzer to use a 2V amplitude to drive the loudspeaker. With about an 80Ω load, this makes 25mA as the peak current, which is within the range that the function generator can handle.  I set some of the other parameters to non-default values: 100ms settling time, 5× averaging, and auto offset.  I swept from 10Hz to 10MHz at 50 steps per decade.  For the first set of tests I did not have the 5.6kΩ resistor R3 on the scope input, but I was not satisfied with the results:

mic-no-load

Although I saw a lot of fluctuation in the gain of the loudspeaker+mic, when I removed the mic, I saw signals as large as (or larger than) with the mic, so clearly a lot of the signal I was seeing was not an acoustic signal, but electrical interference.

The electrical interference is not too surprising, as we’re delivering 25mW RMS to the loudspeaker coils, which will radiate a lot of electromagnetic interference.  The low-pass filter on the bias wire should be eliminating any noise picked up there, but  the high-impedance (1MΩ) input of the oscilloscope means that even small currents in the output wire could result in large voltage swings at the scope input.

To test whether the electrical interference was in the output wire, I added a 5.6kΩ resistor in parallel with the scope input.  This reduces the impedance of the scope, so that small currents no longer produce large voltage swings, while not putting too much load on the transimpedance amplifier (<1mA).  The results were much more like what I expected:

mic-load

At low frequencies, almost no electrical interference is seen, but above 10kHz the electrical interference is as big as the acoustic signal.  I don’t know whether the problem is that the loudspeaker is producing essentially no sound at the higher frequencies, or if the electromagnetic interference is still too big.  Above 100kHz, I’m sure that both are the case—no sound and enormous electromagnetic interference. Luckily, I’m not planning to try to do ultrasonic measurements in this box (at least, not with these speakers).  I might consider adding a tweeter to the box, if I need to work above 8kHz.

The resonances seem to be the same with different bias voltages, but the microphone gets a little more sensitive as the bias voltage increases.

My next step is to line the box with foam sound-absorbing tiles, to try to tame the resonances a little.

2020 June 19

Eleventh video for electronics book

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

I’ve just published my eleventh video for my Applied Analog Electronics book.  This video is for part of §27.2, which is the first part of Lab 7, DC characterization of an electret microphone.

I filmed the video using OBS (Open Broadcaster Software), and this is the unedited seventh take. Earlier takes had problems with the order of presentation, technical problems with the green screen, technical problems with the interaction with the Analog Discovery 2, or just stumbles in saying what I intended.

This video is the first one in this series using a green screen, but I found that the lighting on my green screen is not uniform enough for OBS, particularly in a daylit room—I ended up having to do the recording at night so that I could use only artificial light. The chroma key in OBS is nowhere near as easy to use as virtual backgrounds in Zoom.  You can see some problems with the green screen even in the thumbnail shot.

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.

Next Page »