I’m still working on doing the ultrasonic rangefinder project (In More testing for ultrasonic rangefinder, I gave a digital filter and showed it working with a non-resonant electret microphone and amplifier and pings from a Maxbotix rangefinder. In Ultrasonic rangefinders arrived, I looked at generating good 40kHz pings while listening to the direct sound with a microphone and amplifier. In Ultrasonic rangefinder without amplifier, I tried seeing if we could use the transducers without an amplifier. In Ultrasonic rangefinder with loudspeaker, I tried using a midrange loudspeaker to generate the pings (but was limited to about 20kHz.)
For the past couple of days I’ve been working with a tiny (10mm) loudspeaker, to see if I could get to higher frequencies without a resonant transducer, so that I could play with doing spread-spectrum pings that can be deconvolved to get more precise and more accurate measurements of echoes. I expected the 8Ω loudspeaker to be much less efficient than a resonant transmitter, but beyond that I had few preconceived notions of how well it would work.
Here is the front of the CDM-10008 10mm loudspeaker.
Here is the back of the loudspeaker, with the two solder points visible on the bottom.
Soldering the leads on was more difficult than I expected. I started out putting the loudspeaker face down on the bench and approaching it with the wire and soldering iron, but the loudspeaker jumped off the bench and stuck to the iron—I’d forgotten that the soldering iron tip really does contain iron, and that the magnet for the tiny loudspeaker is unshielded. After sticking the loudspeaker into a Panavise board holder, I had no trouble soldering on the leads.
Here is the loudspeaker with wires soldered on, and a female header with some double-ended male header pins to make it easier to attach to a breadboard.
The first thing to do (after checking that the leads weren’t shorted) was to measure the impedance as a function of frequency, using a voltmeter, a 100Ω series resistor, and a function generator. I was working at home, so I used a Fluke 8060A multimeter that I bought used on e-bay (which replaced my old 8060A that had failed). Unfortunately, the “new” meter is not much better, as the different voltage ranges seem to have radically different calibration. I used one range consistently for the loudspeaker voltage, and another consistently for the resistor voltage, so the shape of the curve should be ok (up to 300kHz), but |Z| may need to be shifted up or down by as much as 20%.
The resonant peak at 1340Hz is consistent with the datasheet, which specifies 1200Hz with a range from 960Hz to 1440Hz. They specify the power output for the speaker in the range around the resonant peak, which gives an exaggerated view of the response elsewhere.
I tried driving the loudspeaker directly from pins 16 and 17 of the Teensy LC, which I had configured for high drive, with the setup() routine containing
CORE_PIN16_CONFIG |= PORT_PCR_DSE;
CORE_PIN17_CONFIG |= PORT_PCR_DSE;
I also put a 10Ω resistor in series with the 8Ω loudspeaker, to limit the current demanded of the I/O pins (though still far more than they are supposed to deliver). With this setup I got about ±1.6V between the pins, ±860mV across the resistor (so ±86mA), and ±670mV across the loudspeaker. The loudspeaker voltages showed spikes, but the resistor voltages were fairly clean square waves, even with 100kHz square waves.
I then made an amplifier for the electret microphone, keeping the gain per stage low to avoid the 1MHz gain-bandwidth limit of the MCP6004 op amps. With a gain of only 10 per stage, I should have a bandwidth close to 100kHz.
Here is the schematic for my test fixture. I looked at the microphone and speaker signals with both my Bitscope oscilloscope and at the microphone signals with the Teensy ADC.
I started out looking a some complicated pulse patterns that I had designed to have high energy in the 20kHz–50kHz range, but a low autocorrelation other than at 0s. These pulse patterns should be good for the spread-spectrum tests I wanted to make. I was disappointed, however, in not being able to see the patterns in the recordings from the microphone, so I switched to a simpler stimulus—a single short pulse.
Short pulses seemed to trigger a resonance in the loudspeaker at about 9.4kHz, though short pulses resulted in an initial higher frequency mode being excited.
Each of the plots were made by averaging about 3 dozen traces recorded by the Teensy, to reduce noise. I found that I had to unplug the power supply from the laptop that was providing the USB power, as I otherwise got a lot of 90kHz noise.
I don’t see any resonance around 9.4kHz in the impedance plot, though I admit not looking for narrow resonance peaks in that range. I was a little worried that it might be related to the high-pass filters in the amplifiers which had a corner frequency near there, so I redid the tests with different filters, changing the 330pF to 680pF, so lowering the corner frequency to 4590Hz. The impulse response is much the same:
The signal is a little stronger with the high-pass having a lower corner frequency, but otherwise not changed much.
Note: the signal visible before the sound arrives is probably due to electrical noise from the loudspeaker coupled through the power supply,as it appears as the pulse is shut off.
Unfortunately, this little loudspeaker does not seem to be usable for the spread-spectrum sound production that I had hoped for, as the 9.4kHz ringing is definitely going to corrupt any high-frequency waveform I try to impose.
The ringing the loudspeaker is larger than for the ultrasonic transducer, so we’re actually getting more sound, but the transducer takes much less current, and I’ve not attempted to compare efficiencies. Both ring for 1–1.5ms, which is too long for what I wanted to do.