LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wiring HC-SR04 Ultrasonic Rangefinder to Elvis II board, not receiving any output to VI

Solved!
Go to solution

I am working on a project for my DAQ class that tasks me to create a VI to measure distance with a HC-SR04 rangefinder.  The VI itself runs without errors (or at least doesn't return an error until I abort) but no matter what channels I use for the trigger/echo I get no value in my output.

Rangefinder code.PNG

 

This is what I'm currently using as my VI.  I've downloaded examples set up by others here but they all don't return an output either.  I want to say it's a problem between the Elvis board and LabView but I cannot say for certain.

0 Kudos
Message 1 of 7
(3,095 Views)

Hey JAddison! Just a few questions here to clarify where the issue might be.

 

Can you tell us a little bit more about how you have your system wired up? 

 

Is your rangefinder providing output--e.g., if tested with a multimeter, do you see voltages? 

 

Is your numeric indicator outputting a zero value or does it stay uninitialized?

Claire M.
Technical Support
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 2 of 7
(3,044 Views)

Can you tell us a little bit more about how you have your system wired up? 

 

I have the input/output to the rangefinder connected to the A0 port on the Elvis board.  LabVIEW recognizes the board and the connection options are there they just don't show.

 

Is your rangefinder providing output--e.g., if tested with a multimeter, do you see voltages? 

 

I tested with a multimeter but the voltage stays the same no matter what's in front of it.  I had to wire it up to a function generator and oscilloscope just to get ANY form of change in reading.

 

Is your numeric indicator outputting a zero value or does it stay uninitialized?

 

The indicator stays at zero the whole time.

0 Kudos
Message 3 of 7
(3,033 Views)

If you wire a known signal to the Elvis board (i.e. function generator), do you get any reading? If not, you may want to reinstall the driver. If that does not work, this may be an issue with your Elvis board.

Brian.D
NI Product Owner
VeriStand
0 Kudos
Message 4 of 7
(3,021 Views)

I said earlier that I did hook the trigger to a function generator and the echo to an oscilloscope in hopes of getting any reading, I was able to get different frequencies when I moved an object within the rangefinder's range.  I don't think this is a problem with the Elvis board because I have used this same board in earlier projects this semester, unless another student's board got swapped with mine.

0 Kudos
Message 5 of 7
(3,017 Views)
Solution
Accepted by topic author JAddison

I am not too familiar with the HC-SR04, but this forum discussed it: https://forums.ni.com/t5/Academic-Hardware-Products-ELVIS/How-to-use-Labview-to-calculate-the-distan.... It seems like you may want to use the Digital I/O.

Brian.D
NI Product Owner
VeriStand
0 Kudos
Message 6 of 7
(2,992 Views)

Brian,

 

While you didn't give me the exact solution I needed, your link did direct me to why I was not getting any output (I had to connect to the counters on the Elvis board, not the analog or digital I/Os).  With that out of the way I can now work on making my own code for the rangefinder.

0 Kudos
Message 7 of 7
(2,971 Views)