Close

The VCNL4200 Proximity Sensor

A project log for Mailbox Sensor

I'm tired of walking the whole way to my mailbox to see if there is mail in it, so technology comes to the rescue

Kevin KesslerKevin Kessler 07/24/2019 at 01:420 Comments

The VCNL4200 Proximity Sensor is an IR LED and IR receiver in a single, very hobbyist unfriendly, package. It also contains an ambient light sensor, which I do not use in this project. The package requires 2 power supplies; a 3.3v one for the controller, and a 5V power supply to drive the LED. An external MOSFET and current sensing resistor are required for the device to control the current through the IR LED, and this current, along with the duration and number of pulses per sense, is configured through I2C.

I configure the device to run the sense on command (as opposed to the default continuous mode), and is configured for the max 800mA current for the shortest interval and 2 pulses. I haven't tried to optimize these setting for current yet, but they seem to be a good compromise of current usage and consistent detection of paper in the mailbox. This application note on using the VCNL4200 is very good, and would be required reading if you wis to use this device.

The schematic and PCB layout are in a github repository.

Discussions