The Ultrasound Pulses

sensors_hcsr04-logicanalyser-threemeasurements.png
Logic analyser showing three distance measurements.

A logic analyser can be used to look at the communication between the CPX board and sensor. It can also be connected to the ultrasonic transmitter to see the high frequency chirp but won't work on the unamplified receiver output. A basic logic analyser cannot show the full detail of the analogue voltages as it makes everything appear rectangular. There are some examples of what the signal really looks like on David Pilling's HC-SR04 page.

sensors_hcsr04-logicanalyser-onemeasurement.png
Logic analyser showing one distance measurement.

The screenshot at the top of the page shows three distance measurements. The screenshot just above is one of the measurements zoomed in showing:

  • Trig (yellow): the pulse requesting the sensor to make a measurement,
  • Tx Pulses (blue): the actual burst of eight pulses which constitute the ultrasonic chirp,
  • Echo (green): the sensor's output measured by the logic analyser as 858 microseconds.

The 858 microseconds divided by 58 gives 14.8cm. The target was placed at 15.0cm which suggests this can be very accurate. The voltage thresholds for low and high on the logic analyser may differ by a tiny amount compared to the CPX board.

The TX Pulses can be used to determine the audio frequency. Using a higher resolution trace made at 25MHz, measuring seven pulses from the leading edge for best accuracy gives 173.24 microseconds, 7 / 173.24 * 1000 = 40.41kHz, clearly in the ultrasound range.

This guide was first published on Sep 17, 2018. It was last updated on Sep 17, 2018. This page (The Ultrasound Pulses) was last updated on Nov 11, 2019.