How does it work?
Light Click is based on the PD15-22C/TR8, a high-speed, high-sensitive PIN photodiode from Everlight Electronics, effectively measuring ambient light intensity. This Click board™ is composed of a spectrometric photodiode to a visible and infrared emitting diode with a spectral range from 400 to 1100nm, an amplifier circuit, and an ADC to process the output signal in analog or digital form. The PD15-22C/TR8 has a fast response time with excellent responsivity close to the human eyes’ response.
It has stable performance over a wide temperature and voltage range and high photosensitivity (940nm peak sensitivity) across various light sources suitable to sense the amount of the present ambient light.
As mentioned, the output of the PD15-22C/TR8, in addition to the signal amplification by the operational amplifier LM358, can be converted to a digital value using MCP3201, a successive approximation A/D converter with a 12-bit resolution from Microchip using a 3-wire SPI compatible interface and a reference voltage set by MAX6106. Apart from the digital way of signal processing, the output of the PD15-22C/TR8 can be sent directly to an analog pin of the mikroBUS™ socket labeled as AN. Selection can be performed by onboard SMD jumper labeled as OUTPUT, placing it to an appropriate position marked as AN or ADC.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the I/O Level jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Optical
Applications
Can be used for obtaining ambient light data in applications such as automatic, residential, and commercial lighting management
On-board modules
PD15-22C/TR8 – PIN photodiode from Everlight Electronics
Key Features
Low power consumption, high speed, fast response time, high photosensitivity, spectrally matched to a visible and infrared emitting diode, ability to process the output signal in analog or digital form, and more
Interface
Analog,SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Light Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
JP1 | I/0 Level | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | OUTPUT | Right | Output Voltage A/D Selection AN/ADC: Left position AN, Right position ADC |
Light Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Spectral Range | 400 | – | 1100 | nm |
Peak Wavelength | – | 940 | – | nm |
ADC Resolution | – | 12 | – | bit |
Software Support
We provide a library for the Light Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Light Click driver.
Key functions
-
Generic write data function.
-
Generic read data function.
-
Function calculate percent.
Example Description
This application return the ambient light intensity.
void application_task ( void )
{
uint16_t light_value;
uint8_t light_percent;
uint8_t percent_old = 1;
light_value = light_read_data( &light );
light_percent = light_calculate_percent( &light, light_value );
if ( percent_old != light_percent )
{
log_printf( &logger, " Light Intensity : %d rn", light_percent );
log_printf( &logger, " Light Value : %drn", light_value );
percent_old = light_percent;
Delay_100ms();
}
Delay_ms( 1000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Light
Additional notes and informations
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. UART terminal is available in all MikroElektronika compilers.
mikroSDK
This 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.
For more information about mikroSDK, visit the official page.