gating an analog signal  : how to do that ?

Hi all, I'm playing with a sonar. I tried square waves directly from the arduino but that gave too much harmonics.

I'm now considering an R-2R DAC generating a sine. I want to push this signal to the piezo. But directly afterwards, I want no driving of the line any more (so the piezo can show me the echo signal).

Therefore I (think I) need to be able to gate the sine wave signal. I create a continuous signal, but allow it to drive the piezo for a short while only, then release it's electrical "grip" on the wire going to the piezo.

Any suggestions what sort of device I can use to achieve this ? as said, I need to pass an analog signal, not a digital one.

Therefore I (think I) need to be able to gate the sine wave signal.

Why not just stop sending it?

ok, a fet does not require much current. but how would I hook it up ?

gate to digital signal port, drain and source to the sine generator and the piezo ?

I had been thinking in hooking up a transistor that way but my analog skills leave to be desired.

indeed the low impedance is killing. basically you short the signal line to ground. you need to flip the arduino port to input in order to be able to see the signal the piezo is generating for the echo.

thanks for the comments so far, any other options ? (I admit I have to do some more trolling the Internet for sonar circuit designs)

Sounds like you are trying to use he same pin to send and receive. I’d try using two seperate pins, digital out and analog in. On the digital out put a small signal diode, then down stream of the diode make a tie to the analog in pin and the transducer. Then when the echo is returned the diode will block any losses to the digital pin, shunting the return to the analog in pin. The initial send signal will probably be detected by the analog in pin, so a short delay may be needed to wait for just the return echo.

Hopefully the diode would block a reverse voltage up to 50v. As no info has been provided on the propertys of the transducer, not a lot can be said as how to interface with it. As to the harmonic problem, I don't see how a slowly increasing/decreasing voltage sent signal would be a fix.

I also don't see why harmonics would be a problem. Wouldn't the transducer itself act like a very sharp bandpass filter sending and receiving only the frequency it is built and tuned to operate at? A square wave includes the fundamental frequency so the information is there.


Hi , thanks for your cooperation.

I want to try to make a small scale imaging sonar, or see how close I can get. I have bought 3 500khz composite piezo crystals, which can be teased into having a flat frequency response instead of a very sharp resonance freq with "normal" piezo. problem is that I do not know the electrical parameters of this stuff. And I'm not sure how to measure these. so I'm fiddling instead.

I have set up a single transducer, being kicked by the arduino at 500khz (that is 16 instructions of Vcc followed by 16 instructions of gnd on pin 11, set pin 11 to input and wait a few ms)

what I saw on the scope is that the echo was always a frequency far higher than what I sent it, and also that this frequency in the echo did not vary with the frequency of the arduino signal. It improved when I used an inductor across the leads. I bought a whole range and simply selected the one which gave the best performance (the least residual "ringing" in this case)

My current hypothesis is that in order to know it's frequency response I need to make sure I kick it with a sine, and not a hodgepodge of sine signals, otherwise known as a square wave..

So now I have build two transducers, using one for beeping, and another for listening. I want to transform the square from the arduino to a sine, feed it continuously, and record the response on the other transducer using my scope.

using this setup I can plot the freq. response graph and continue fiddling with the inductor to find the sweetspot for that flattened part.

when I have archieved this, I expect the receiver will show an unmolested copy of the transmitted signal. By varying the frequency over the flat range (chirping) the resolution of the detected objects can be improved, as the start of the echo can be calculated from the match of the whole pulsetrain (known as pulse compression).