06-22-2017 09:02 AM
How to monitoring distance with hcsr04 ultarasonic sensor on sbrio 9637?
06-22-2017
09:19 AM
- last edited on
04-08-2025
01:25 PM
by
Content Cleaner
This unit uses digital only to do the ranging and timing measurements to do the distance calculation. You'd only need two channels it looks like. Trigger (output) and Echo (input).
Implement in the FPGA and output the trigger pulse, and then monitor the input echo channel for the Echo F-> T rising edge (save time in clock ticks or us) then monitor for T -> F transition, subtract the two to get the high time then convert per manual:
Formula: uS / 58 = centimeters or uS / 148 =inch; or: the range = high level time * velocity (340M/S) / 2
They suggest in the manual to wait at least 60ms between output triggers in order to prevent trigger signal interfering with the echo signal.
You can then publish the distance result through one of the FPGA mechanisms for use on the FPGA or send it over to the RT via Front Panel indicator or DMA. You'll probably only need Tag access type though, through programmatic front panel method.
To physically connect it you need to access the DIO lines on the IDC connector - you can do that various ways - here is an easy one: https://www.ni.com/en/search.html?q=784507-01
Have you taken the Embedded Control and Monitoring using LabVIEW course?