Gas station without pumps

2016 December 30

Ultrasonic rangefinder with Analog Discovery 2

In Loudspeaker impedance with Analog Discovery 2, I looked at the impedance of  various loudspeakers including an ultrasonic transducer. Today I looked at shaping pulse bursts for driving an ultrasonic transmitter to get shorter received pulses with an ultrasonic receiver.  I’ve done this before using custom programs on a Teensy 3.1 board (see Ultrasonic rangefinders arrived), but I wanted to see what I could do using just the waveform generator on the Analog Discovery 2.

I measured the magnitude of the impedance of the transmitter (using either a 120kΩ resistor or a 1nF capacitor as a known impedance), then looked at the transmitter+receiver characteristics for frequencies around the resonances.  I’ve marked the peak received resonances on the impedance plot.

The impedance is approx 2.2nF, with 3 apparent resonances.

The impedance is approx 2.2nF, with 3 apparent resonances.

The primary resonance is around 40kHz, and is the frequency that the transmitter is designed to operate at.

The primary resonance is around 40kHz, and is the frequency that the transmitter is designed to operate at.

There is a secondary resonance around 54kHz, though it is considerably weaker than the 40kHz resonance.

There is a secondary resonance around 54kHz, though it is considerably weaker than the 40kHz resonance.

The third resonance, around 330kHz does not provide a very strong signal for the receiver.

The third resonance, around 330kHz does not provide a very strong signal for the receiver.

I tried two tests using the 40.445kHz resonance. In one, I used the simple waveform generator to produce a 40445Hz square wave, then used an 8ms wait and a 148.3µs run time, to produce bursts of 6 square waves. I set the idle output to the offset (0v) and used a 5V amplitude.

In the other test, I used the same wait and run times, but used the “custom” waveform to set up a signal that inverted the last 3 of the 6 periods (so that the half periods were +-+-+--+-+-+. This was fairly easy to set up by generating the 6 periods, then altering them by multiplying by a single period of a square wave. I could have created much more complicated bursts, but this pattern was enough to see the capabilities of the scope.

By triggering the scope on the signal sent to the transmitter (using channel 1), I could average 1000 sweeps to get a very low-noise view of the signal. (I can trigger on the waveform generator itself, freeing up one of the scope channels, but then I can’t average—I think that the averaging relies on interpolating get precise timing of the trigger.)  For plotting, I subtracted off the DC bias (fitted before time 0), as 60Hz interference caused a moderate offset to the signal even after averaging.

The bursts start out the same, but the simple 6-cycle burst results in the received waveform growing for 14 or 15 cycles, while the 3+,3- burst grows for 6–7 cycles and decays very quickly.

The bursts start out the same, but the simple 6-cycle burst results in the received waveform growing for 14 or 15 cycles, while the 3+,3- burst grows for 6–7 cycles and decays very quickly.

I tried some longer and shorter bursts, with the expected result that longer bursts resulted in stronger signals with a longer received burst width. Doing 8 cycles followed by 8 cancelling cycles seemed to produce a reasonable length burst with a fairly strong signal, but I did not explore variants much.

I still think it might be possible to use the phase information to get higher resolution than the approx 7.9mm wavelength, but identifying which pulse of the return waveform is which remains a problem, particularly if there is a complicated reflecting surface that superimposes several differently delayed pulses.

Advertisements

1 Comment »

  1. […] Ultrasonic rangefinder with Analog Discovery 2, I looked at the impedance of  an ultrasonic transmitter with the Analog Discovery 2, but I only […]

    Pingback by Ultrasonic transmitter and receiver impedance measurement | Gas station without pumps — 2017 September 7 @ 18:53 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: