From 11:00 PM CST Friday, Apr 11th - 1:30 PM CST Saturday, Apr 12th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CST Friday, Apr 11th - 1:30 PM CST Saturday, Apr 12th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
To download NI software, including the products shown below, visit ni.com/downloads.
Overview
The example demonstrates how interface with HC-SR04 sensor.
Description:
The HC-SR04 sensor uses sound waves to help compute the distance of an object by sending out ultrasonic sound waves to an object and measuring the time it takes to come back to the sensor.
The sensor sends out about eight 40 kHz pulses and waits for an object to bounce the waves back to the receiver. It then outputs a high pulse proportional to the time it takes for the sound waves to be sent and received. To use the sensor, a continuous pulse train is generated by a counter output task with a set high time and low time. A 100 uS pulse send on the TRIG line triggers the HC-SR04 module to start sending the ultrasonic pulses followed by a 100 ms low time. A voltage high is sent on the ECHO line until the sound waves bounce back to the receiver. Since the speed of sound at sea level is known to be about 13397 inches per second we can use the high time of the ECHO line and the ratio of inches per second to get the distance traveled by the sound wave. To get the object distance we need to divide by this by two. This can be simplified into a single multiplication since the only unknown variable is the high time.
Steps to implement or execute code
To implement this example:
Requirements
Software
LabVIEW 2012 or compatible
NI-DAQmx 16.0 or compatible
Hardware
cDAQ with C series that have counter feature module or compatible DAQ devices.
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Que complemento de software labview tengo que tener para que el ejemplo relacionado para el sensor ultrasonico HC SR04, pueda correr de forma correcta y no me envie errores al ejecutarlo
Necesita un Multifunction DAQ como el PCI-6220. Este ejemplo usa dos counters en el Multifunction DAQ, una para emitir un pulso y el otro para medir distancia.
hay alguna otra forma de realizar un .VI utilizando ese mismo sensor pero sin utilizar Multifunction DAQ.
solo cuento con una LABJACK espero y me puedan ayudar a realizar este .VI utilizando esta targea de adquisicion de datos
como puedo mmunicar el sensor ultasonicocon con el arduino conectado al labview
se puede conectar con el daq
Hi Guys
I really stroggled a lot to get this module/code working on the DAQ card PCI-6220. The problem was that the DAQ assistent I used to find the terminal to achieve the echo signal misguided me. Thus, use pin 14 on the breakout board for 5V, use pin 2 (PFI12/P2.4) to generate the signal, use pin 7 as ground and finally pin 41 (PFI4/P1.4) to aquire the echo signal. Then the code works perfect.
Hola, podrian enviarme quien tenga una programación de labview para medir la distancia del sesor ultrasonico hc-sr04 conectado al arduino, ya tengo el LIFA cargado al arduino, ya he comunicado el arduino con labview a un sensor de humedad, pero no logo optener datos del sensor ultrasonico, mi arduino es un mega2560 y la vercion del software del arduino es 1.0.1.
Gracias.
Hello, this experiment on how to use myDAQmx
Hola, tengo una NI my daq y necesito ayuda para el programa del Sensor Ultrasonico para medir distancia
Greetings,
I have used DAQ card USB-6251 for running this program and was successful. To generate a trigger pulse CTR 0 OUT/ pin 89 /PFI12.
The only change that I found was using the CTR 1 Z i.e. PIN 77 PF4/P1.4 to capture echo signals. Then the code works perfectly.