SONAR imput signal and filter issues  - Page 1
Forum section: electronics / beginners

author: paltanuoto
author_rank: Newbie
timestamp: July 05, 2025, 03:44:02 pm
content: Hi guys, I need your help! It's my first time building electronic circuits and I'm really struggling as I'm a total noob when it comes to electronics.I'm building a SONAR and I'm using an Arduino Due (mainly due to its higher ADC speed, as the sonar works at 25kHz). I've checked the entire transmission line and I'm sure that everything there works fine.Analyzing the receiving line, though, I noticed a couple of strange things. Since I don't have an oscilloscope, I'm using the analog pin of my Arduino to check the signal. I transmit a continuous 25 kHz wave for the debugging. When I read the raw input from the receiver (detaching all the circuit that follows the receiver), I see a signal that decreases in steps, and I don't understand why.Furthermore, after filtering it with a Sallen-Key filter (high-pass with cut -off frequency at 20 kHz), I still see a decaying trend in the output while ideally i expect a signal centered in 0 and filtered.My question is: do you have any clue why I don't simply receive a 25kHz wave (with some noise, obviously) and why my filter doesn't seem to work?I'd be really grateful for any help!!!

author: jwet
author_rank: Frequent Contributor
timestamp: July 09, 2025, 05:19:59 pm
content: What you have is reasonable and the values line up with what you want.I imagine the circuit might be oscillating or just amplifying a lot of noise. You don't need so much bandwidth. Excess bandwidth equals noise. The op-amp has a 10 Mhz gain bandwidth product, if you make a 20 K high pass with such an amp, you will have gain out to 10 Mhz, this is AM radio territory and a bunch of noise sources around your house like switching power supplies, etc. I would roll the gain off at perhaps 100 Khz. This is as simple as putting a 300 pF or so cap across the feedback resistor, you could increase this value a bit to give you a narrower BW and better signal to noise. If you put a 500 pF here, you could roll off at 50K which might be better. I suspect the signals you're getting back are just buried in noise with no upper limit on your input filter.I don't know what range you're shooting for but echo systems like sonar and radar signals fall off very fast and range takes big signals and receive amplifiers. Basically signals fall at r^4 power. You're radiating into a space which is r^2 and the echo is radiating back with r^2. I don't know how big your signal levels on that the receiver would be, depends on sensitivity of your "microphone", but some gain might be required. You could replace that op-amp bias circuit that you have with just a divider of 2x 22k resistors in series from 3.3v to ground. This will give you the V/2 with the 11K for the Sallen Key. Bypass the top of the 22k divider with a .1uF cap. to keep supply noise out. You could then follow your filter with an amplifier with a gain of 10 or more after your filter with the spared amp.An inexpensive oscilloscope would help your experimenting a lot. There are hobby type 1Mhz oscilloscopes that would work. At very low frequencies, you can use a PC sound card but you're just outside the audio band so probably wouldn't work.One thing you could try would be to experiment with the circuit at say 2KHz with little speakers and a PC sound card. Speakers work as mics and speakers. You could get a feel for things and then go ultrasonic. There is a free program called Waveforms that is designed to work with Digilent lab cards but it also will works with just a sound card. It includes a signal generator function and oscilloscope function along with loads of other stuff.Good luck with your experimenting.

author: paltanuoto
author_rank: Newbie
timestamp: July 11, 2025, 02:13:53 pm
content: That was helpful, thanks a lot. Allow me to ask you another brief question: is it a good idea to use the buffer after the transducer rather than after the voltage divider?Thank you again in advance

author: jwet
author_rank: Frequent Contributor
timestamp: July 11, 2025, 03:11:39 pm
content: Use the thanks button for thanks.The follower (buffer) amp is being used to make a pseudo ground. The buffer makes this low impedance or "stiff" rail like a ground would be. This is useful to minimize interstage interference in circuits where this ground might be shared by other stages and nodes. If this node had a high Z, it could be pushed around. In your circuit, this buffered output is only going to one place, an 11k resistor in a sallen key filter. This is not a low impedance and is not shared, so the buffer isn't required.The order of amplifiers in a chain should be setup to get small signals out of the noise early. If you take a gain of ten in a preamp, nothing downstream matters much SNR wise, later contributions are lessened by the preamp gain. Filters should also precede gain blocks so you're not amplifying noise with signal as much. In circuits with wide dynamic range like radio receivers, there is another consideration- saturation. If your signal can vary a lot, you don't want to take too much arbitrary gain. In a sonar, the signal levels can vary a lot depending on range. In most sonars, the gain of the preamp is stepped up as the signal is gone longer in time. Polaroid used ultrasonic rangers in their cameras and they had a clever circuit with a time controlled gain control. TI made the chips and you can google them. (TL851/2) They made a designer's kit that was pretty cool. Sparkfun in the US still sells some of this stuff. I used the Polaroid system in automated toll fare collecting equipment at SAIC in the 90's, we were trying to tell the difference between two cars in the lane and a car with a boat in tow- the difference is the trailer tongue. We had an array of ultrasonic sensors to see the tongue- super weird. Could be done with cameras better today....In your case, it would be best if your filter could take some gain. You can add gain to the amplifier- it's just acting like a follower now. You'll have to adjust other component values because this gain will affect the Q of the filter. There are plenty of online filter calcs.Having a buffer after the filter would be useful as a line driver if required but doesn't add much unless you want to take some gain, again watching out for dynamic range/clippling.

author: jwet
author_rank: Frequent Contributor
timestamp: July 16, 2025, 03:10:49 pm
content: Just curious. How did things come out with the sonar, did you have any luck.Regards