From Thursday, May 23rd (05:00 PM CDT) through Friday, April 24th (1:30 AM CDT), 2024, 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: 

Does anyone experienced VCNL4000 proximity/light sensor with arduino interface?

Dear all,

I am using arduino uno for my project with xbee sheild and motor drive and couple of force sensors. I will also integrate VCNL4000 proximity/light sensor to my board and to software. I could not find any information for this setup. Is there anybody who have experience with this sensor before?

The datasheet of the sensor is attached.

Best regards,

Have a nice day.

0 Kudos
Message 1 of 16
(7,742 Views)

I can write the basic communication VIs (Read and Write to registers) for you but I don't know much about it beyond that.

EDIT:  Ok, I wrote some basic VIs for you.  Let me know if they work or don't work.

--Attachment Removed--  See below.

0 Kudos
Message 2 of 16
(3,265 Views)

Thank you for your help,

I am still waiting for the sensor arrival(It is taking longer than usual). I want to read proximity for example in milimeter. If it works between 5-15mm it will be fine for my application. But I still couldn't figure it out how to read the data. When I try to add indicator for "read VI" you sent me. It doesn't let me connect it.

I quite a new Labview user. If I am asking very basic things please forgive.

0 Kudos
Message 3 of 16
(3,265 Views)

You mean that it gives you a broken wire?  That is because the output of the VI is a U8 array.  You need to interpret the bytes from there.  The VIs that I wrote a very basic and do not interpret or format data into a usable form.  I will look again and see what I can gather from the datasheet.

0 Kudos
Message 4 of 16
(3,265 Views)

I've added a couple functions for executing a reading and then reading the value from the sensor (based on a Arduino sketch).  I haven't documented them all that well but the title and context help should prove enough information.

Message 5 of 16
(3,265 Views)

Dear NathanB.,

I recieved my sensors today. But I couldn't figure out how to connect them to my board yet. I found some arduino sketch online but it seems like they only use analog pins.

Can you tell me how can I connect this sensor to digital pins using my arduino uno?

I don't have any analog pin left in my setup. And  I don't want to change my board to mega because it's too big for me.

Thanks a lot.

0 Kudos
Message 6 of 16
(3,265 Views)

It uses I2C communication.  I2C communication requires A4 and A5 on the Uno.

0 Kudos
Message 7 of 16
(3,265 Views)

Is it possible to use more than one in one Arduino Uno?

0 Kudos
Message 8 of 16
(3,265 Views)

salender wrote:

Is it possible to use more than one in one Arduino Uno?

More than one what?  If you are talking about the sensors, you can use multiple I2C devices on the two I2C pins as long as they have different device addressess.

0 Kudos
Message 9 of 16
(3,265 Views)

I meant If I could I use two VCNL4000 sensors in a single Arduino? Also I couldn't figure it out yet how to use these sensor. Is there anything special to do when using I2C pins?

Thanks a lot.

0 Kudos
Message 10 of 16
(3,265 Views)