Hi, for long time now I am looking for a simple and cheap way to measure waterdepth with a sonar. After many attemps, I think I made it. I manage to drive and read echo from a cheap 200 khz transducer with a ESP using the circuit presented in the schematic below. This circuit work well in my 1m test tank but I still need to try it on the field. Unfortunately breadboard is not convenient for outdoor testing, especially with water, so I think I will design a pcb before field testing. Before doing this, I am looking for advice about obvious thing that don't seem right in my circuit? I am self-learning in electronic... Specifically, I would like advices about AC coupling, signal filtering and problem with single supply (vbias) configuration if any?
This circuit work as follow:
Trigger: The ESP send a 200 kHz PWM square signal to the 200 khz center frequency transducer. I have 0 - 340 mV amplitude for this signal.
Pad A: The signal and returning echo (about 26v p-p) is then "scaled" by the oppose diode connected to ground. I obtain about 152 mV p-p signal.
Gain: The scaled signal enter a variable gain stage and get amplified. At point B I measure about 650 mV p-p.
Rectifier: This signal enter the Half-wave rectifier followed by a comparator that allow to produce a square signal that can be monitored by a pulseIn function of the ESP. The output signal is about 0 - 350 mV. I could certainly use more gain here!
The circuit work but have some specific behavior I don't understand.
The variable gain stage don't amplify much. I selected the OPA2320 for GBP of 20 Mhz. From the datasheet it should amplify by a gain of up to 40 at 200 khz (fig 4 page 10 here: https://www.ti.com/lit/ds/symlink/opa2320.pdf?ts=1679948880076&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FOPA2320). I can only obtain about 4. I would like to have more since I think that the echo will become smaller with increase depth and this transducer can work in it's original state up to 100m while my test are only 1m depth.
Another weird thing (for me!) is that I need to apply about 1 volt on pin 5 of the opamp forming the half-wave rectifier. If I connect the pin to Vbias or to ground, the stage don't work. At 1 volt, I have a rectified signal looking like a enveloppe follower. Why it only work with 1 volt?
There is 2 comparators. Only one is really needed. If I could use the other half for a better purpose (like adding gain to the rectified signal or before?), I am fully open to advices here!
Capacitor C2 just close to point A is 10 pF. I think this ne have to do with the resonance of the transducer. It might need to be precisely determine? I tried with value from 10 pF up to 100 nf. From what I could tell, the higher the farad, the lower is my signal at pad A. Since I don't have lower value than 10 pF. It's 10 pF for now.
I have pictures of the signal at each point T, A, B, C and D of the circuit and can add them to the post if needed.
Thank you for your help, time and advice.
Charles