SparkFun Infrared Proximity Breakout - VCNL4000

In physical computing it's sometimes nice to know how physically close you are to an object. In other words, you may need to know your 'proximity' to an object, that's where the VCNL4000 does its magic. Okay, it's not actually magic, it's a combination ambient light sensor and IR proximity sensor.

The VCNL4000 can detect its proximity to an object using IR within a range of about 20cm. Proximity data as well as ambient light level data can be collected over an I2C interface. This breakout board gives you access to the I2C pins, the Vcc pin, GND and the IR+ pin (power supply for the built-in IR emitter). Simply give the board a clean 3.3V power source and give the IR emitter anywhere from 2.5-5V and you'll be able to tell how far you are from an object up to 20cm.

  • Voltage Rating: 3.3V
  • IR Emitter Vin: 2.5-5V
  • I/O pins are 5V compliant
  • Range: Up to 20cm
  • Built-in Ambient Light Sensor

SparkFun Infrared Proximity Breakout - VCNL4000 Product Help and Resources

Core Skill: Soldering

This skill defines how difficult the soldering is on a particular product. It might be a couple simple solder joints, or require special reflow tools.

1 Soldering

Skill Level: Noob - Some basic soldering is required, but it is limited to a just a few pins, basic through-hole soldering, and couple (if any) polarized components. A basic soldering iron is all you should need.
See all skill levels


Core Skill: Programming

If a board needs code or communicates somehow, you're going to need to know how to program or interface with it. The programming skill is all about communication and code.

3 Programming

Skill Level: Competent - The toolchain for programming is a bit more complex and will examples may not be explicitly provided for you. You will be required to have a fundamental knowledge of programming and be required to provide your own code. You may need to modify existing libraries or code to work with your specific hardware. Sensor and hardware interfaces will be SPI or I2C.
See all skill levels


Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

1 Electrical Prototyping

Skill Level: Noob - You don't need to reference a datasheet, but you will need to know basic power requirements.
See all skill levels


Comments

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • tedspark / about 13 years ago / 2

    According to the datasheet you can't set the I2C address:

    "The VCNL4000 has a fix slave address for the host programming and accessing selection. The predefined 7 bit I2C bus address is set to 0010 011 = 13h."

    This means there is no way to have more then one on your I2C bus, correct? You might want to post that in the "Features" section before someone orders a bunch of them to create a sensor array. Would be nice if the board had a I2C to analog out so you could have more then one. Also, people will be lucky to get much more then 10 cm range.

    • The arduino UNO rev. 3 now has a additional sets of SCL / SDA pins.. would this enable usage of 2 of these at the same time? Or is it still as noted here by Tedspark? I need to run two of these to provide correction numbers for referencing position on an adjustable-pivot CNC backgauge that's not calibrating correctly. I need to measure each end with a precision of approx 1/64" (~.4mm), at a distance of about 2" (50.8 mm) or 4" (76mm) , so that I can plug the numbers into the system as an offset adjustment each time the machine is started up. I'm really hoping that my solution won't require the use of two arduinos. Has anyone tried using two of them on a rev.3 to see if they'll work?

      • Zizou / about 11 years ago / 1

        I have the same problem. I need to run 4 of them on the same Arduino ! How can I do that ?

    • The answer to this quandary is the 24LC256 chip. Each chip is an I2C 256k EEPROM, and supports having multiple chips on the same line. So you can have 1 VCNL4000 tied to a 24LC256, and multiple 24LC256 on the same I2C bus. The 24LC256 supports chaining of up to 8 chips...so 8 I2C devices on the same bus.

      • stevenvh17 / about 10 years ago * / 1

        What you're saying is that you can have up to eight 24LC256 devices on an I2C bus. This is correct, but how does it solve OP's problem, which is having several VCNL4000 devices on a bus? Answer: it doesn't!

        • Member #576510 / about 10 years ago / 1

          I am using 2 vcnl4000, i decide to use an 74HC4066AP, it is a high speed bilateral switch, with this devices you can enable from arduino only one vcnl4000 every time (for example every 10ms), regardless that both has the same addres. If you need to use it, I can send you my design by email. My email is: morellana2209@gmail.com I already with 3 vcnl4000 and my program works perfect.

  • Member #496446 / about 9 years ago / 1

    On using multiple boards, couldn't you use a mux and cycle thru each board then?

  • Wayne4 / about 11 years ago / 1

    I am using Microchip PIC MCU to communicate with this sensor. My code does not have a big difference with the example code. However, I cannot get a data ready when I try to read proximity. Does anyone else have the same problem?

    • nanogear / about 10 years ago / 1

      Do you configured the speed parameter according to datasheet?

  • anorton / about 11 years ago / 1

    The size of this sensor/breakout is important to my application (I'm trying to detect a 3/4-inch wall, so I need the sensor to be pretty close to the ground.) As such, I'd like to know the size (length/width) of this breakout board... :) Specifically, I'd like to know if it is larger than this sensor from Adafruit. Thanks!

    • Forss Fägerström / about 11 years ago / 1

      Don't know about this board, but if you want the sensor to be really low, check out BV4241. A bit more expensive, but has a 3V3 regulator. The board measures 16x26mm, and the sensor's holes are less than 5mm from the board edge.

  • Does this include an IR led, or does that need to be added?

    • Kamiquasi / about 12 years ago / 1

      There's an IR LED inside the monolithic VCNL4000 package. There is a separate power source option (the IR+ pin on the breakout) so that you can turn the IR LED off when you don't need it (though you could set the receiver to standby just as well).

  • AdrianFreed / about 13 years ago / 1

    Can you please put a regulator on the next rev. of this board like adafruit's breakout for the same sensor?

    • Hi Adrian - There's a ton of different types of applications out there and we like to provide the most basic breakout possible. A 3.3V regulator tends to hide the necessary requirements to get a given technology to work. In the case that you may be hooking this sensor up to a 5V micro, you'll need 3.3Vs power as well as translation circuitry. In the case you want to attach the breakout to a 3.3V micro, we want to give you direct access.

      • AdrianFreed / about 13 years ago / 1

        Hi Nate: Basic is good. Adafruit is basic too: it does 3.3v like yours and level translation and 5v and it is the same price:

        "This sensor is easy to use with any microcontroller that has i2c capability. It is 5 volt compliant so you can use it with 3.3V or 5V logic with no risk of damage. There is an onboard 3.3V ultra low dropout regulator so you can power it with 3.3 to 5.0V. However, if you can give it 5.0V that is ideal since the VIN voltage powers the IR LED and the higher the voltage you can give it, the more powerful it is."

  • According to the datasheet, at 200mA LED output, the proximity is given at about 18,000 counts for 4mm and 40,000 counts for 2mm. It's logarithmic, and because I'm too lazy right now to check, the linear resolution would be 2mm / (22,000 counts) = 0.0001mm / count which seems very very absurd: if you moved the reflecting surface the thickness of a human hair, it would change by 825 counts.

Customer Reviews

4 out of 5

Based on 1 ratings:

Currently viewing all customer reviews.