From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programming a HC-SR04 sensor with a myDAQ

Hello,

I am trying to build a circuit to measure distance using a HC-SR04 ultrasonic sensor and a myDAQ without and Arduino provided by my university. However, we are struggling to set up the DAQ to produce the signal and receive the signal. wondering is you shred some light on this?

0 Kudos
Message 1 of 3
(2,835 Views)

Hello Greenernick,

Where exactly are you struggling? Setting up the hardware? Drivers? LabVIEW coding?

 

Had you seen Getting Started with NI-DAQmx?

Also, when you have LabVIEW installed and NI-DAQmx afterwards, there are lots of examples available: LabVIEW » Help » Find Examples » Browse in Task structure » Hardware Input and Output » DAQmx.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 2 of 3
(2,784 Views)

Have a look at my reply in this thread:

https://forums.ni.com/t5/LabVIEW/Connecting-HC-SR04-to-NI-USB-6001-and-LabVIEW/m-p/3905639/highlight...

 

You'll find two links to possible solutions. You have to combine parts of these solutions.

 

I'm not familiar with the myDAQ device, but it seems that it can measure the pulse width of a digitial signal. That would give you the distance. But it does not seem to be possible to create a pulse train on the second counter of the myDAQ so you have to find another solution there.


Regards, Jens

Kudos are welcome...
Message 3 of 3
(2,777 Views)