peak detector problem

Thread Starter

Z'YonG

Joined Feb 2, 2017
63
Hi, I am building a peak detector and voltage comparator for my returning signal of the ultrasonic transducer.
Below are the circuit diagram of peak detector and voltage comparator:
upload_2017-2-21_10-43-20.png
upload_2017-2-21_10-43-37.png
And below are the screenshot of oscilloscope after peak detector and voltage comparator:
upload_2017-2-21_10-47-9.png
upload_2017-2-21_10-47-26.png
As you can see, it kind of works, it detect the peak at the very beginning, however, what I am interested is the returning signal after the first pulse (the signal that appears in the middle of the screen), and my peak detector is not able to detect it.
Any idea about how to do it?
Thank you.
 

OBW0549

Joined Mar 2, 2015
3,566
I think you need to incorporate some sort of blanking function which will disable your peak detector from just before the outgoing pulse until just before the earliest return you expect. An analog switch such as one section of a 74HC4066 shunting the peak detector output to ground, and enabled during that period, would probably do the job.
 

Thread Starter

Z'YonG

Joined Feb 2, 2017
63
I think you need to incorporate some sort of blanking function which will disable your peak detector from just before the outgoing pulse until just before the earliest return you expect. An analog switch such as one section of a 74HC4066 shunting the peak detector output to ground, and enabled during that period, would probably do the job.
Hi OBW0549,
Thanks for the reply, could you please explain more about the analog switch? I have never deal with it before.
Thank you
 

Thread Starter

Z'YonG

Joined Feb 2, 2017
63
We have tried with the comparator, it works perfectly on multisim, but it doesn't work on the breadboard. so we decided to use the peak detector first, and then the comparator, it was working. but when I test it again this morning, the problem appears as what I stated in this thread. I am pretty sure I didn't touch anything in the circuit, but I don't know why this has happened.
If you can help us out, that will be really appreciate.
Thank you.
 

MrChips

Joined Oct 2, 2009
30,823
We have tried with the comparator, it works perfectly on multisim, but it doesn't work on the breadboard. so we decided to use the peak detector first, and then the comparator, it was working. but when I test it again this morning, the problem appears as what I stated in this thread. I am pretty sure I didn't touch anything in the circuit, but I don't know why this has happened.
If you can help us out, that will be really appreciate.
Thank you.
Because as I said before and also stated by OBW0549 in post #2 above, you have to suppress the signal during the transmission and only allow the signal after the transmitted signal is finished. You have 6-8μs before your reflected signal. During this time, short circuit the signal to GND with a 74HC4066 as OBW0549 has suggested.
 

MrAl

Joined Jun 17, 2014
11,496
Hi, I am building a peak detector and voltage comparator for my returning signal of the ultrasonic transducer.
Below are the circuit diagram of peak detector and voltage comparator:
View attachment 120974
View attachment 120975
And below are the screenshot of oscilloscope after peak detector and voltage comparator:
View attachment 120976
View attachment 120977
As you can see, it kind of works, it detect the peak at the very beginning, however, what I am interested is the returning signal after the first pulse (the signal that appears in the middle of the screen), and my peak detector is not able to detect it.
Any idea about how to do it?
Thank you.
Hello there,

If i understand you right, you have two parts to your input signal, a sharp quick pulse followed by a burst, and you want to only detect the burst not the initial narrow pulse.

If so, then since the energy in the quick narrow pulse is low and the energy in the burst is higher, you may be able to get away with a simple bandwidth limiting input filter. This could be as simple as a RC low pass filter with relatively high cutoff frequency. The idea would be to try a filter that can filter the short pulse into a longer pulse with lower amplitude, and would still allow multiple pulses to increase the amplitude enough to trigger the comparator, and the comparator may have to be adjusted to be able to detect that longer and somewhat taller signal now.

Since you already have a small capacitor in parallel to the input signal, a small value resistor in series with the diode may be all that is required. That will make the circuit look like a high cutoff frequency low pass filter. The value of the resistor could be anything from 1 ohm up to maybe 1k ohms. You should test it thoroughly afterwards.

As a side note, you may need to add some hysteresis in your comparator also.
 

MrChips

Joined Oct 2, 2009
30,823
Hello there,

If i understand you right, you have two parts to your input signal, a sharp quick pulse followed by a burst, and you want to only detect the burst not the initial narrow pulse.

If so, then since the energy in the quick narrow pulse is low and the energy in the burst is higher, you may be able to get away with a simple bandwidth limiting input filter. This could be as simple as a RC low pass filter with relatively high cutoff frequency. The idea would be to try a filter that can filter the short pulse into a longer pulse with lower amplitude, and would still allow multiple pulses to increase the amplitude enough to trigger the comparator, and the comparator may have to be adjusted to be able to detect that longer and somewhat taller signal now.

Since you already have a small capacitor in parallel to the input signal, a small value resistor in series with the diode may be all that is required. That will make the circuit look like a high cutoff frequency low pass filter. The value of the resistor could be anything from 1 ohm up to maybe 1k ohms. You should test it thoroughly afterwards.

As a side note, you may need to add some hysteresis in your comparator also.
No. Filtering is not the solution. The TS needs to accurately measure time of flight. Filtering will diminish that accuracy.

The generation of the first pulse is under control of the TS. TS has to inhibit the received signal for as long as the transmitted signal is active. This is a simple thing to do with what we call a linear gate in signal processing industry. This is standard design in ultrasonic range finder applications.
 

hp1729

Joined Nov 23, 2015
2,304
Hi OBW0549,
Thanks for the reply, could you please explain more about the analog switch? I have never deal with it before.
Thank you
I think something like this is suggested. Is my timing right? After the first big spike I wait 250 ns then enable the peak detector for about 1 us. What is the repetition rate of the signal?
Do you work at the test site out in Nevada?
 

Attachments

Last edited:

OBW0549

Joined Mar 2, 2015
3,566
I think something like this is suggested. Is my timing right?
I don't know about your timing, but your circuit is totally wrong; that's not what I was talking about at all. I specifically said, "An analog switch such as one section of a 74HC4066 shunting the peak detector output to ground."

Instead, for some unfathomable reason, you've put the analog switch in between the logic signal that triggers U3A and the input of the peak detector. Why in the world did you do that? The peak detector is fed from the output of the receiver amplifier, not from that logic signal.
 

Thread Starter

Z'YonG

Joined Feb 2, 2017
63
Because as I said before and also stated by OBW0549 in post #2 above, you have to suppress the signal during the transmission and only allow the signal after the transmitted signal is finished. You have 6-8μs before your reflected signal. During this time, short circuit the signal to GND with a 74HC4066 as OBW0549 has suggested.
As we gonna test with different thickness of metal plate, the reflected signal will appear at different time, so, we are trying to not have a switch there. As long as it can detect the reflected signal and turn it into something readable by the MCU, it should be ok.

I have modify the voltage comparator that you suggested again, it seems like working to me now, and here is what I get:
upload_2017-2-22_17-9-44.png

It doesn't looks very good, however, our MCU is able to detect the signal is going down and measure the time difference according to that. Do you think is there any wrong with it? Is there anyway that I can make it better? should I tried to use the multivibrator or should I leave it?
Thanks for your help
 

MrAl

Joined Jun 17, 2014
11,496
No. Filtering is not the solution. The TS needs to accurately measure time of flight. Filtering will diminish that accuracy.

The generation of the first pulse is under control of the TS. TS has to inhibit the received signal for as long as the transmitted signal is active. This is a simple thing to do with what we call a linear gate in signal processing industry. This is standard design in ultrasonic range finder applications.
Hi there,

What is the required accuracy?
 

hp1729

Joined Nov 23, 2015
2,304
I don't know about your timing, but your circuit is totally wrong; that's not what I was talking about at all. I specifically said, "An analog switch such as one section of a 74HC4066 shunting the peak detector output to ground."

Instead, for some unfathomable reason, you've put the analog switch in between the logic signal that triggers U3A and the input of the peak detector. Why in the world did you do that? The peak detector is fed from the output of the receiver amplifier, not from that logic signal.
Sorry for the misunderstanding. If you had suggested a schematic it might have been clearer.
 

EM Fields

Joined Jun 8, 2016
583
Hi, I am building a peak detector and voltage comparator for my returning signal of the ultrasonic transducer.
1. What's the maximum peak-to-peak voltage of the transmitted pulse measured at the transducer terminals?

2. What's the minimum peak-to-peak voltage of the received pulse measured at the transducer terminals?

3. What's the minimum time between the leading edge of the electrical transmit pulse and the leading edge of
the electrical received pulse?

4. What's the transmit repetition rate?

5. How are you driving the transducer? DC pulse or tone burst at the transducer's resonant frequency or ???
 
Top