Proximity 11 Click Board
Proximity 11 Click Board
Overview
The Proximity 11 Click Board™ offers close-range proximity sensing and is equipped with the RPR-0521RS, very accurate and power-efficient proximity and ambient Light Sensor with an IrLED. It allows accurate proximity detection for a maximum distance of 100mm. The proprietary LED current driving technique eliminates the need for calibration, simplifying the design. A huge dynamic range allows ambient light sensing responses of visible and infrared light, in a variety of light conditions. An extensive interrupt engine allows for firmware optimisation.
The Proximity 11 Click Board™ is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click Board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
With its ability to accommodate to different light conditions especially behind a dark glass, the RPR-0521RS represents an ideal solution for dimming TFT and LCD displays on various devices. Positioned behind a semi-transparent bezel, it can still detect proximity and ambient light amount, regulating the brightness of the screen, accordingly, saving a lot of power that way. The RPR-0521RS IC has a very low-power consumption itself, that can be further optimized. This makes it a perfect choice for a range of applications that rely on the proximity and ambient light sensing (ALS), including PC and laptop monitors, POS displays, embedded displays, proximity-activated short-range security, etc.
How Does The Proximity 11 Click Board™ Work?
The main component of the Proximity 11 Click Board™ is the RPR-0521RS, a digital ambient and proximity sensor, by ROHM Semiconductor. It is an accurate and reliable proximity and ambient light sensor, aimed towards the power saving in applications that use TFT or LCD panels. By offering a huge dynamic range, the RPR-0521RS sensor allows to be placed behind a dark glass or a semi-transparent screen bezel, but also to be exposed to a bright sunlight. A proprietary design of the integrated constant-current LED driver enables plug and play proximity detection from 1, up to 100mm, eliminating the need for a calibration procedure. By integrating micro-optics elements within the casing, RPR-0521RS greatly simplifies the application design.
Proximity of an object is detected using an IR LED, which emits pulses of light towards the object. The amount of the reflected IR light is measured by an integrated IR photodiode. During LED pulse duration time, the amount of the reflected IR light is measured and integrated. The background IR light is also measured and integrated, during LED OFF state. It is then subtracted from the final result, allowing for an accurate measurement with the reduced amount of the background IR noise. After it has been scaled to a 16-bit value, the final result is available on the output registers, in the LOW/HIGH byte format.
Commonly, photosensitive elements are most sensitive to IR light. A human eye does cannot detect IR light. Therefore, the PD element has to filter out IR light so that only the visible part of the light is allowed through. The channel0 is equipped with such PD, making it usable for the ALS sensing. During the ALS measurement, both channels are measured. The datasheet of the RPR-0521RS offers a conversion formula that can be used to obtain results in physical units (lx). These formulas also take the IR measurement from the channel 1 into the consideration, completely reducing its influence on the final result. By adjusting the integration time (also known as oversampling), the flickering effect of a fluorescent light can be completely eliminated.
The extensive interrupt engine allows an optimized firmware to be written. Four registers are used to specify the low and the high threshold for the ALS and proximity measurements. Whenever these thresholds are exceeded, an interrupt status bit will be set in the respective register. The user has the ability to assign an external pin to an interrupt, so the MCU can be alerted whenever an interrupt event occurs. The interrupt is generated whenever the threshold value is exceeded for a programmed number of times (interrupt persistence). This is useful to prevent false and erratic interrupt reporting.
The Click Board™ is designed to work with 3.3V only. When using it with MCUs that use 5V levels for their communication, a proper level translation circuit should be used.
SPECIFICATIONS
Type | Proximity |
Applications | It is a perfect choice for a range of applications that rely on the proximity and ambient light sensing (ALS), including PC and laptop monitors, POS displays, embedded displays, proximity-activated short-range security, etc. |
On-board modules | RPR-0521RS, a digital ambient and proximity sensor, by ROHM Semiconductor |
Key Features | High dynamic range allows using the sensor in both very bright and very dim light conditions. Extensive interrupt engine allows simplified firmware to be written. Proprietary design eliminates the need for calibration. |
Interface | I2C |
Compatibility | mikroBUS |
Click Board™ size | S (28.6 x 25.4 mm) |
Input Voltage | 3.3V |
PINOUT DIAGRAM
This table shows how the pinout on Proximity 11 Click Board™ corresponds to the pinout on the mikroBUS socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
NC | 1 | AN | PWM | 16 | NC | ||
NC | 2 | RST | INT | 15 | INT | Interrupt output | |
NC | 3 | CS | RX | 14 | NC | ||
NC | 4 | SCK | TX | 13 | NC | ||
NC | 5 | MISO | SCL | 12 | SCL | I2C Clock | |
NC | 6 | MOSI | SDA | 11 | SDA | I2C Data | |
Power Supply | 3.3V | 7 | 3.3V | 5V | 10 | NC | |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
PWR | PWR | - | Power LED Indicator |
Software Support
We provide a library for the Proximity 11 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library contains function for returning INT pin state Library contains functions for getting and setting device register content Library contains function for updating data used to calculate ALS Lux value Library contains function for device initialization Library contains function for raw data to Lux conversion Library contains functions for getting PS and ALS values Library contains functions for getting raw PS and ALS data Library contains functions for setting ALS and PS High and Low thresholds Library contains function for setting PS offset value
Key Functions
void proximity11_update(void)
- updates data used to calculate Luxuint8_t proximity11_init(void)
- initializes the devicevoid proximity11_getPsAlsValues( uint16_t * ps_value, float * als_value )
- gets raw ALS and PS data and converts raw ALS data to Lux value
Example Description
The application is composed of three sections :
- System Initialization - Initializes INT pin, I2C and LOG modules
- Application Initialization - Initializes I2C driver and performs device initialization
- Application Task - Gets ALS and PS values and logs those values
void applicationTask( ) { proximity11_getPsAlsValues( &ps_value, &als_value ); WordToStr( ps_value, text ); mikroBUS_logWrite( "PS : ", _LOG_TEXT ); mikroBUS_logWrite( text, _LOG_TEXT ); mikroBUS_logWrite( " [count]", _LOG_LINE ); FloatToStr( als_value, text ); mikroBUS_logWrite( "ALS : ", _LOG_TEXT ); mikroBUS_logWrite( text, _LOG_TEXT ); mikroBUS_logWrite( " [Lx]", _LOG_LINE ); mikroBUS_logWrite( " ", _LOG_LINE ); Delay_ms(500); }
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 a USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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.
MIKROSDK
The Proximity 11 Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click Board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Software Support
We provide a library for the Proximity 11 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library contains function for returning INT pin state Library contains functions for getting and setting device register content Library contains function for updating data used to calculate ALS Lux value Library contains function for device initialization Library contains function for raw data to Lux conversion Library contains functions for getting PS and ALS values Library contains functions for getting raw PS and ALS data Library contains functions for setting ALS and PS High and Low thresholds Library contains function for setting PS offset value
Key Functions
void proximity11_update(void)
- updates data used to calculate Luxuint8_t proximity11_init(void)
- initializes the devicevoid proximity11_getPsAlsValues( uint16_t * ps_value, float * als_value )
- gets raw ALS and PS data and converts raw ALS data to Lux value
Example Description
The application is composed of three sections :
- System Initialization - Initializes INT pin, I2C and LOG modules
- Application Initialization - Initializes I2C driver and performs device initialization
- Application Task - Gets ALS and PS values and logs those values
void applicationTask( ) { proximity11_getPsAlsValues( &ps_value, &als_value ); WordToStr( ps_value, text ); mikroBUS_logWrite( "PS : ", _LOG_TEXT ); mikroBUS_logWrite( text, _LOG_TEXT ); mikroBUS_logWrite( " [count]", _LOG_LINE ); FloatToStr( als_value, text ); mikroBUS_logWrite( "ALS : ", _LOG_TEXT ); mikroBUS_logWrite( text, _LOG_TEXT ); mikroBUS_logWrite( " [Lx]", _LOG_LINE ); mikroBUS_logWrite( " ", _LOG_LINE ); Delay_ms(500); }
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 a USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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.
MIKROSDK
The Proximity 11 Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click Board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.