Hobbyist Toolkit

Showing results for 
Search instead for 
Did you mean: 

Problema de lectura de sensor ultrasonico HC-SR04 con libreria linx

Buen dia, he realizado pruebas de lectura de datos con los modulos de la paqueteria linx la mayoria a sido un exito, el problema se ha dado al intentar realizar la lectura del sensor ultrasonico HC-SR04 con el nodo read que se encuentra en las funciones de Linx, Sensors, Distance, Ultrasonic.

Una vez que lo ejecuto no envia ningun resultado a los indicadores numericos que le he colocado en sus salidas de datos, la version de labview que uso es 18 y la version de la paqueteria Linx es, he probado el funcionamiento de mi sensor en la plataforma arduino directamente y si funciona. Alguien puede apoyarme?, se lo hagradeceria. Adjunto VI usado.

0 Kudos
Message 1 of 4

Have you deployed the Linx Firmware to the Arduino? What was the result of that? This would be under Tools -> MakerHub -> Linx -> Linx Firmware Wizard...


Are you able to just turn on / off the LED attached to pin D13 using Linx?

0 Kudos
Message 2 of 4

Tengo el mismo problema, ¿lo lograste resolver? 

0 Kudos
Message 3 of 4

Hey @Dave_H69, I'll give you a step by step instructions:


with arduino plugged on a USB port follow the instructions to upload the firmware:




I'm using a LabVIEW 2020SP1 professional, with LINX installed.


Create a new VI, insert OPEN.vi, READ.vi from ULTRASSONIC pallete and CLOSE.vi, all from Makerhub/LINX pallete. do not mix LIFA and LINX VIs.


Wire your code as image bellow:


Open the Read.vi inside the while loop, and add a constant to Stimulus Pulse input, and set the enum to Active High.



Save and close this subVI. (Note: this will change your library file, keep that in mind)

Set the inputs: In this example, DO Channel = 2 (arduino pin) connected to Trig pin of HC-SR04 and DI Channel = 4, connected to Echo pin of HC-SR04.


You may want to put a filter or ptbypt mean before the Centimeters (or inches) Indicator, to dump a bit the reading rate. Also, set your loop wait function according to your application.


Here is the result of using a 30 CM ruler.




Also i am posting the VI, remember to edit the library file!



Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
0 Kudos
Message 4 of 4