LabVIEW Interface for Arduino Discussions

取消
显示结果 
搜索替代 
您的意思是: 

5 Pin Ultrasonic Sensor LIFA help

已解决!
转到解答

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 项奖励
1 条消息(共 9 条)
10,160 次查看

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.

2 条消息(共 9 条)
7,518 次查看

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 项奖励
3 条消息(共 9 条)
7,518 次查看

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.

4 条消息(共 9 条)
7,518 次查看

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 项奖励
5 条消息(共 9 条)
7,518 次查看
解答
已被主题作者 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.

6 条消息(共 9 条)
7,518 次查看

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 项奖励
7 条消息(共 9 条)
7,518 次查看

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 项奖励
8 条消息(共 9 条)
7,518 次查看

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

0 项奖励
9 条消息(共 9 条)
7,518 次查看