MikroElektronika
Proximity 3 click
Proximity 3 click
SKU:MIKROE-2801
Couldn't load pickup availability
Share
Proximity 3 click is an intelligent proximity and light sensing device, which features the VCNL4200 sensor from Vishay - high sensitivity long distance proximity sensor (PS), ambient light sensor (ALS) and 940 nm IRED, all in one small package.
With its smart sensing and light conditioning properties, the Proximity 3 click can be used in a wide range of applications: adjusting the brightness of the TFT screen depending on ambient light, turning off the TFT background light if it is covered, very accurate lux meters, reliable security sensors and so on.
How the Proximity 3 click works
Proximity 3 click uses the VCNL4200 sensor, which combines matched 940 nm IR emitter and a photodiode for proximity measurement and ambient light sensing. VCNL4200 offers programmable measurement by utilizing the advanced signal processing techniques, allowing the sensor to operate in various conditions. Communication with the microcontroller is done via the I2C interface so that the host controller can set the measurement parameters and request results back from the sensor.
Both low and high threshold values for the measured property can also be set via the I2C so that the interrupts can be generated every time the threshold value is exceeded. This allows for the reduced need of the sensor polling, which can result in better power management. With MikroElektronika library functions, setting up the registers is really easy and the tedious task of initializing the sensor is taken care of with a few simple function calls. More information about the sensor's registers and addresses can be found in the VCNL4200 datasheet.
The Filtron™ technology used in the ALS, allows the sensor to match the ambient light spectral sensitivity to human eye response and it's immune to fluorescent light flicker. This ensures the accuracy of the measurements. The maximum detection range is selectable (197 / 393 / 786 / 1573 lux) with highest sensitivity 0.003 lux / step.
The proximity sensor uses advanced ambient and background light cancellation schemes, so it is fairly immune to interferences that might occur in this case. This allows for a quite precise proximity detection. The sensor can work either in 12-bit or 16-bit mode, selectable by I2C command. The click's range is up to 1.5m.
VCNL4200 input voltage is 3V3, while the separate 5V supply rail is used to supply power for the IR emitter pulses, generated by the small external P-channel MOSFET (Q1). This way, the power dissipation of the IRED drive is displaced from the chip, and the high-current IRED drive pulses are isolated from the sensitive integrated circuit sections, connected to the 3V3 rail.
Specifications
Type | Proximity |
Applications | Adjusting the brightness of the TFT screen depending on ambient light, turning off the TFT background light if it is covered, very accurate lux meters, reliable security sensors, etc. |
On-board modules | VCNL4200 sensor - high sensitivity long distance proximity sensor (PS), ambient light sensor (ALS) and 940 nm IRED, intelligent background light cancellation |
Key Features | Proximity distance up to 1.5 m, immunity to the red glow (940 nm IRED) and fluorescent light flickering, selectable maximum detection range (197 / 393 / 786 / 1573) lux with highest sensitivity 0.003 lux/step |
Interface | I2C |
Input Voltage | 3.3V,5V |
Click board size | S (28.6 x 25.4 mm) |
Pinout diagram
This table shows how the pinout on Proximity 3 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Proximity 3 click maximum ratings
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply voltage | 2.5 | 3.3 | 3.6 | V |
Supply voltage for IRED | 3.8 | 5.0 | 5.5 | V |
Operation temperature range | -40 | +85 | °C | |
Supply current | 350 | µA | ||
IRED driving current | 800 | mA | ||
Full ALS counts | 65535 | steps | ||
Full PS counts | 4095/65535 | steps | ||
I2C clock (std mode / fast mode) | 10/10 | 100/400 | kHz | |
Measurement distance | 1.5 | m |
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
PWR | Power LED | - | Power LED indicates that the click is powered on |
Software Support
We provide a demo application for the Proximity 3 click on our LibStock page, developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards with minimal change to the code depending on the microcontroller used.
Library Description
This library contains a set of functions, necessary to work with the Proximity 3 click.
Key functions
uint16_t prox3_readALS()
- Reads value from ALS register
uint16_t prox3_readPS()
- Reads value from PS register
uint16_t prox3_getDistance()
- Calculating distance
uint16_t prox3_getIlluminance()
- Calculating illuminance
Examples Description
This is a simple demonstration of sensor functionality, where the user can read the distance and illuminance data from Proximity 3 click. Distance and illuminance values are sent via UART.
The application is composed of three sections:
- System Initialization - I2C and UART module initialization
- Application Initialization - Sends HAL pointers, and initializes the VCNL4200
- Application Task - Sequential reading of the distance, proximity and ambient light data from the sensor and logging it to UART, every second
void applicationTask() { // DISTANCE READ AND CONVERT VALUE TO STRING resultPS = prox3_getDistance(); IntToStr( resultPS, txt1 ); // WRITES INFORMATION TO UART UART1_Write_Text( "Proximity: ~ " ); UART1_Write_Text( txt1 ); UART1_Write_Text( " cmrn" ); // AMBIENT LIGHT READ AND CONVERT VALUE TO STRING resultALS = prox3_getIlluminance(); IntToStr( resultALS, txt2 ); // WRITES INFORMATION TO UART UART1_Write_Text( "Ambient Light: " ); UART1_Write_Text( txt2 ); UART1_Write_Text( " luxrn" ); Delay_ms(1000); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- UART
- Conversions
Additional notes and information
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.

New Products
-
Sold out
OAK-FFC IMX577 M12
Vendor:POLOLURegular price Rs. 8,499.00Regular priceUnit price / perSold out -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 20A
Vendor:POLOLURegular price Rs. 329.00Regular priceUnit price / perSold out -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 25A
Vendor:POLOLURegular price Rs. 439.00Regular priceUnit price / perSold out -
Pololu I²C Isolator, ISO1640
Vendor:POLOLURegular price Rs. 449.00Regular priceUnit price / per -
3pi+ 32U4 OLED Robot Kit with 30:1 MP Motors (Standard Edition Kit)
Vendor:POLOLURegular price Rs. 15,549.00Regular priceUnit price / per -
Conductivity Calibration K 1.0 Set (4 pouches)
Vendor:Atlas ScientificRegular price Rs. 1,599.00Regular priceUnit price / perSold out -
Analog Discovery 3 Pro Bundle
Vendor:DigilentRegular price Rs. 42,569.00Regular priceUnit price / per -
Lighthouse swarm bundle - Crazyflie 2.1+ (250mAh batteries)
Vendor:BitcrazeRegular price Rs. 474,999.00Regular priceUnit price / perSold out -
Loco Swarm bundle - Crazyflie 2.1+ (250mAh batteries)
Vendor:BitcrazeRegular price Rs. 544,999.00Regular priceUnit price / perSold out -
Kopis X8 Cinelifter 5" Kit - Caged (Frame Kit)
Vendor:HolybroRegular price Rs. 28,199.00Regular priceUnit price / per -
Atlas Scientific i3 InterLink
Vendor:Atlas ScientificRegular price Rs. 6,349.00Regular priceUnit price / per -
Sold out
PoE Injector
Vendor:LuxonisRegular price Rs. 2,099.00Regular priceUnit price / perSold out -
Sold out
1-Port VINT Hub Phidget
Vendor:PhidgetsRegular price Rs. 2,699.00Regular priceUnit price / perSold out -
Holybro 1045 Propeller 2 Pair CW+CCW-Black
Vendor:HolybroRegular price Rs. 1,549.00Regular priceUnit price / per -
ACS37220LEZATR-100B3 Current Sensor Large Carrier -100A to +100A, 3.3V
Vendor:POLOLURegular price Rs. 829.00Regular priceUnit price / per -
CT433-HSWF50MR TMR Current Sensor Compact Carrier -50A to +50A, 3.3V
Vendor:POLOLURegular price Rs. 1,039.00Regular priceUnit price / per -
A5984 Stepper Motor Driver Carrier, Adjustable Current, Blue Edition
Vendor:POLOLURegular price Rs. 409.00Regular priceUnit price / per -
A5984 Stepper Motor Driver Carrier, Fixed 1A@5V / 660mA@3.3V, Blue Edition (Soldered Header Pins)
Vendor:POLOLURegular price Rs. 489.00Regular priceUnit price / per -
A5984 Stepper Motor Driver Carrier, Fixed 500mA@5V / 330mA@3.3V (Soldered Header Pins)
Vendor:POLOLURegular price Rs. 469.00Regular priceUnit price / per -
T Connector Male-Female Pair
Vendor:POLOLURegular price Rs. 169.00Regular priceUnit price / per -
Pololu Reverse Voltage Protector, 4-60V, 10A
Vendor:POLOLURegular price Rs. 159.00Regular priceUnit price / per -
Pololu Reverse Voltage Protector, 4-60V, 12A
Vendor:POLOLURegular price Rs. 199.00Regular priceUnit price / per -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 10A
Vendor:POLOLURegular price Rs. 179.00Regular priceUnit price / perSold out -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 12A
Vendor:POLOLURegular price Rs. 229.00Regular priceUnit price / perSold out -
Pololu Mini Plastic Gearmotor Bracket Pair - Tall
Vendor:POLOLURegular price Rs. 599.00Regular priceUnit price / per