I was doing this project for a kid - an ultrasonic buzzer that alerts you when an object is within 1.7 meters in front of you. We are using an HC-SR04.
I set up a 555 in an astable multivibrator configuration that produces a 10Hz rectangular wave (T = 100ms.)
Now the way this ultrasonic transducer works is realtime generation of a asymmetric PWM, what I mean to say is it does not wait for the ultrasonic echo and then generate a PWM and send it to the ECHO pin. So if there is no object detected, it will send back a 38ms PWM.
For 1.7 meters, the PWM width is 10ms, anything above 10ms is empty space (until you reach there.)
Here is how the wave at TRIGGER AND ECHO look
All I would want to achieve is let 15, 18, 5 ms pass through but the 38ms PWM should be blocked. What should be the approach I should take?