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.


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:


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:


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.

2021 December 10

Microphone test box

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

For several years I’ve had the idea of building a testing box for testing microphones, hearing aids, and other small sound devices, but I never got around to doing anything about it until recently.  My original plan was to buy some sort of solid box, line it with sound-reducing foam, and add a partition with a loudspeaker at one end.  At the other end I would mount the device being tested, with an extra microphone to monitor how loud the sound is outside the device.

A few months ago, one of our neighbors down the street was selling their house and had dumped a rather large, but ugly double wooden chest on the corner to give away.  This box seemed ideal for my project, and I’m a sucker for free things, so I went home to get my hand truck and wheeled the chest home.  It sat on the hand truck in my garage for months, waiting for me to get the loudspeakers, a hole saw, and sound-reducing foam.


This box has two lids, each of which opens into a separate compartment. The compartments are about 82 cm long, 40 cm wide, and 33 cm high. The wood seems to be fir or pine.


The box is solidly made, but rather roughly finished inside.

I finally started work on the project this week, having bought a 4¼” hole saw, a huge number of sound-reducing foam tiles, and two Valcom 936398 intercom loudspeakers. I chose the loudspeakers because they were cheap ($5 each) midrange speakers with 45Ω impedance.  Having a large impedance means that I can drive the speakers directly from the Analog Discovery 2 function generator with reasonable power, without hitting the 30mA current limit of the function generator.  By putting two in series I should get 90Ω, which would mean a maximum voltage of about 2.7V  at the maximum current and 81 mW of power.  With a sensitivity from the spec sheet of 85.95dB @ 2.83V and 1m, I should be able to get about 79dB at 1m.  Inside the box, the mic will be closer and there will be reflections of the walls, so the sound may be quite a bit louder, but there are likely to be weird resonances.

My first task was to do impedance spectroscopy on the loudspeakers just sitting on a table (no box), using the Analog Discovery 2 impedance analyzer.  For the individual speakers, I used a 100Ω sense resistor and a 1V amplitude, and I played with different voltages for the series connection.  The impedance measurements were pretty much the same for different voltages. I ended up using a 1kΩ sense resistor and 5V amplitude, to avoid any possibility of clipping when doing the short-circuit compensation.


The resonant frequencies are around 124Hz and 111Hz, with the series pair having a resonance around 122Hz.  The impedance is more like 40Ω than 45Ω, and the series impedance is around 80Ω, so my max power is about 72mW (or about 36mW for a sine wave).

I marked and drilled the 4 corner holes for each loudspeaker, then cut out the large hole with the hole saw.  I was surprised by how much the hole saw kicked when its teeth engaged the wood—the first time  it happened I was not holding the drill firmly enough and it broke the ¼” guide bit!


The bit snapped off very cleanly, but luckily I had a spare drill bit I could use.

I braced my arm against the edge of the box and managed to hold the drill steady enough to cut the circles, but I ended up with linear bruises from the edge of the box. I probably will not be using the hole saw with a hand drill in any future projects—I’ll clamp stuff very firmly and use the drill press!  Unfortunately, that was not really a possibility for this chest, as I was not about to try to disassemble and reassemble it.

The holes came out ugly (I couldn’t hold the drill steady when it kicked) and a bit too big.


Here are the holes from the side I started and finished on. In the middle I tried cutting from the other side, so as not to have massive tear-out when the blade finally came through.


Here are the holes from the other side. Despite the guide hole from the ¼” drill bit, the holes did not line up precisely, and I had to use a rasp to remove a little of the wood.

Although the hole from hole saw was a little too big and intersected with some of the holes for the bolts, it was still possible to bolt the loudspeakers in place with 1½” 10-24 machine screws and nuts.


Here are the loudspeakers viewed from the front


And here they are from the back.

My next step was to measure the impedance again with the loudspeakers in the box.


The resonant frequency is the same, but there are many smaller secondary resonances. These resonances are probably from acoustic resonances of the box, not just noise, as they were repeatable even with different voltages and sense resistance and redoing the short-circuit and open-circuit compensations

My next step is to try to remove some of the resonances of the wooden box by lining both compartments with sound-reducing foam.  The foam comes vacuum-packed, and it expands quite impressively when the plastic wrapping is removed.


Here are the foam tiles, completely filling one compartment. I’ll use over half the tiles lining each side.

I got a bunch of double-stick adhesive pieces to mount the foam tiles on the bottom, sides, and top of each compartment, but that is going to be fairly tedious cutting and sticking to make it all fit, so I did not have the energy to do that yesterday or today. Tomorrow my wife and I are talking one of our walks, and Sunday it is going to rain (we hope), so I won’t want to work on the porch where I have this box set up. So it may be a while before I get to the next step of testing with the foam in place. I won’t bother modeling the loudspeakers until I get the box lined, and I’ll probably only model up to about 2MHz—I’m pretty sure that there is not going to be any sound from the loudspeakers above about 40kHz (and I’d even be surprised to see much signal even at that frequency).

Once that is done, I can hook up a microphone and do network analysis to see what sort of frequency range I can get out of this setup.

The photos in this post were all done with my moto g(7) phone, and they required more color correction and exposure modification than I’m used to doing—I really have to get around to ordering a new camera!

2020 June 7

Tenth video for electronics book

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

I’ve just published my tenth video for my Applied Analog Electronics book.  This video is for part of §29.2.2—fitting models for loudspeakers.

I filmed the video using OBS (Open Broadcaster Software), and this is the unedited first take. This is my longest video yet in the series.

2020 June 3

Ninth video for electronics book

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

I’ve just published my ninth video for my Applied Analog Electronics book.  This video is for part of §29.2.1—models for loudspeakers.

I filmed the video using OBS (Open Broadcaster Software), and this is the unedited first take.

2020 May 25

Eighth video for electronics book

Filed under: Circuits course — gasstationwithoutpumps @ 16:14
Tags: , , , ,

I’ve just published my eighth video for my Applied Analog Electronics book.  This video is for part of §29.2—the definition of the nonlinear impedance used for modeling loudspeakers.

I filmed the video using OBS (Open Broadcaster Software), and this is the unedited first take.

Next Page »

%d bloggers like this: