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.
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.
Page last edited March 08, 2024
Text editor powered by tinymce.