LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

5 Pin Ultrasonic Sensor LIFA help

Solved!
Go to solution

Dear all,

I have been trying to measure distance from the US-100 5 pin ultrasonic sensor using LIFA:

Steps: I connect :

-vcc to 5V

-echo to pin 7

-trigger to pin 6

-out to nothing

-ground to ground

So it works basically like a 4 pin sensor

next, I open LIFA Base and upload the file successfully.

I close the window and open labview and build the attached code according to the arduino code I found which I attached along with the code

The thing is I'm trying to get a reading in centimeters and find myself still unable to get anything eventhough no errors are encountered

Can someone help me with that issue?

Sincerely,

Chimof

0 Kudos
Message 1 of 9
(8,370 Views)

Unfortunately, this sensor will not work with the default LIFA.  This sensor requires the use of the pulseIn() function on the Arduino which is not implemented in LIFA.  This sensor, however, is nearly identical to the other ultra sonic sensors that people have posted here about (SRF05 and the Parallax Ping).  These use the same pin for the trigger and the echo but you can modify it to use separate pins.

Message 2 of 9
(5,728 Views)

Dear Nathan,

Thank you again for the help,

Please note that the DYP-ME007 I got similar to the US-100(I think) can behave as a 3 pin / 4 pin or 5 pin sensor

I understand perfectly what you said however can't modify the VI in order to get 2 pins as input. I mean i'm new to all that so I skipped a lot of basics and I am very bound by time.

It would be great if you showed me an example/tutorial/how!

Thanks,

Chimof

0 Kudos
Message 3 of 9
(5,728 Views)

Four pins are required for both of these sensors according to the documentation.

Since these are very similar to the PING sensor, I decided to make something that will work for all of them (i.e. use the same firmware).  So, I've come up with this library.  Please test it and let me know if it works for you.

UPDATE:  I've converted my Parallax PING))) document to a general ultrasonic distance sensor document with my library that supports several different sensor models.

Message 4 of 9
(5,728 Views)

Nathan!

Thank you for all your support, I am getting some errors in the LIFA Base folder ( undeclared functions ), once I overcome the trouble i'll let you know.

0 Kudos
Message 5 of 9
(5,728 Views)
Solution
Accepted by topic author chimof

Sorry about that, I forgot to test compile the firmware.  I've updated to version 1.1.0 and it is posted as a document.

Message 6 of 9
(5,728 Views)

Well Nathan the VI worked thank you very much for the library. I would like to add that you have to insert a time delay in the while loop of SR05 or DYP-ME , maybe since arduino can't handle fast sample rate.

I will update you on results as soon as i set up a convenient test bench.

0 Kudos
Message 7 of 9
(5,728 Views)

No problem.

I would like to add that you have to insert a time delay in the while loop of SR05 or DYP-ME , maybe since arduino can't handle fast sample rate.

The arduino will limit the loop time during operation so the Arduino will dictate the loop speed and I've never had to slow down the loop to communicate with Arduino.  There are sometimes that the sensor can't handle a super fast sample rate but I've not heard of this for the SRF05 based on all the discussions with positive results (IIRC).  So, what makes you think that you need to have a delay?

0 Kudos
Message 8 of 9
(5,728 Views)

You're right, I think the disconnection/reconnection I was having were due to loose cables.

0 Kudos
Message 9 of 9
(5,728 Views)