From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with a labview project using HC-SR04 distance sensor

Hi everyone,

I am new to programing and using labview. Recently i was introduced to Labview and decided to do a project on my own (just for fun). So i bought an Arduino Uno as well as HC-SR04 ultrasound distance sensor. Can someone give me a step-by-step tutorial on how to set it up? So far i've downloaded the lastest version of Ardunio IDE, uploaded LIFA unto arduino uno, and i've also installed LIFA in the labview using labview manager. But i can't find the distance sensor DAQ icon under ardunio examples in the labview. What am i doing wrong? Any help is appreciated, thank you. 

0 Kudos
Message 1 of 12
(10,186 Views)

There is no way to use that sensor with the default LIFA.  You have to use a custom version that implements a required Arduino function.  See here.

0 Kudos
Message 2 of 12
(5,575 Views)

Thank you for the reply.

I downloaded the zip and uploaded the LIFA that you posted. But when i click "run" i got an error in labview. error.png

Here is the connection i'm using:

HC_SR04 sketch2.jpg

0 Kudos
Message 3 of 12
(5,576 Views)

It seems like there is a problem with labview communicating with the arduino uno. Because i'd get the same error even when the arduino is disconnected from the USB. I've tried the thermistor project and it worked just fine, so i assume it's not a hardware issue with the arduino uno. 

0 Kudos
Message 4 of 12
(5,576 Views)

It's not working because you are trying to run my function alone (it's not designed to work like that).  You need to use my function in a top-level VI.  You can take a look at the Analog Read example for how to make a basic LIFA program.  You would simply replace the Analog Read Pin VI with the Get Distance function in the library.

0 Kudos
Message 5 of 12
(5,576 Views)

How do i replace the Analog Read Pin VI with the Get Distance function in the library? Sorry im still new to this.

0 Kudos
Message 6 of 12
(5,576 Views)

Since you are new to LabVIEW, I highly recommend that you learn some of the basics.  There are many resources online that you can find that can help you learn how to program in LabVIEW.  One place to start is here.

0 Kudos
Message 7 of 12
(5,576 Views)

I just finished learning/reading some things that i searched on the forums about programming in LabVIEW. So i setup the block diagram, uploading the program, and your thing worked! Thanks a lot man. Really appreciate it.

Message 8 of 12
(5,576 Views)

Hello wuuu, how are you?

I'm curious to undestand what you did! Could you send me your files from Labview?

Send me by e-mail: evandro_felippe@yahoo.com.br

BR,

EF

0 Kudos
Message 10 of 12
(5,576 Views)