Hagisonic HG-MB40A sensor

Does anyone know how to use the HG-MB40A ultrasonic sensor? I am using it in a project and was having trouble getting the distance output wave. I connected the 5 V source, the ground, and used a switch for activating the trigger. I was wondering if I am messing up the configuration for the device or something?

I was using an oscilloscope to measure the distance pulse output pin and it was connected before and after the trigger switch was activated; I did not have another microcontroller or other circuit connected for analysis.

Do you have a microcontroller or other circuit to analyse the output of the sensor before activating your trigger switch?

Using an oscilloscope and a manual switch for testing the sensor is not such a great idea.

In order to properly take a measurement you need to generate a trigger pulse. This pulse must last from 10us to 500us (according to the datasheet). Unfortunately, it is almost humanly impossible to flick a switch so fast and, even if the switch was operated with super human speed, the natural bounce of the contacts would generate a noisy signal that cannot be used as a reliable pulse.

Also, even if you properly trigger the sensor, the resulting pulse will be so fast that you oscilloscope will probably miss it.

The best way to test this would be to use a microcontroller in order to generate a clean and periodical trigger pulse that would result in periodical distance measurements that will show up nicely in an oscilloscope.