I’m still working on doing the ultrasonic rangefinder project myself, though I have already determined that it is feasible for the freshmen in the design seminar. 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.
Yesterday and today, I tried setting up a rangefinder without an amplifier, using the resonant piezoelectric receiver, instead of the non-resonant microphone and amplifier.
I used this circuit in lab today to demonstrate the use of the digital oscilloscopes. We looked at the signal to the transmitter and the signal back from the receiver. I showed them the use of an extra channel (and an extra digital output from the Teensy board—pin 13 to flash the on-board LED) to trigger the sweep when the burst signal started.
If I make the initial burst loud enough (which requires making it last longer, with more cycles to build up the resonance), I can see the return echo even with no amplification:
The delays are a little longer than I would have expected, but I don’t know whether this is because of sloppy measurement of the distance, failure to check the temperature and relative humidity and compute the speed of sound more accurately, or longer ringing than expected and not seeing the beginning of the burst. All probably contribute to the error.
We can zoom in on the raw recorded signal around the first echo:
It is not entirely clear where the echo starts—I’m guessing around 4020µs, when I would have expected it closer to 3880µs. That would be about a 2.4cm error in measuring the distance to the table, which is possible, but a larger error than I would have expected (the bottom of the table is not smooth, but the fluctuations in distance are 1cm, not 2.4cm). The 3.6% difference in time corresponds to a very low temperature—maybe –30°C, and my bedroom is not that cold! (It is probably around 17°C, for a speed of sound around 342 m/s, which would suggest a delay of 3860µs, even earlier than the 3880µs I estimated when using 340m/s as a crude estimate of the speed of sound.
The second bump around 4800–5200µs is probably the vibrations from the mode change that we saw in the transmitter recordings in Ultrasonic rangefinders arrived.
The digital filtering improved the signal-to-noise ratio, from about 3:1 to about 6:1 for the first echo. Amplifying the signal from the receiver before digitizing it should improve the signal-to-noise ratio, since much of the noise we’re seeing is the noise of the analog-to-digital converter—using more of its range should clean the signal up a lot.