Our dual-channel LED driver empowers SCL applications with independent control over two lighting channels, enabling dynamic color tuning and personalized lighting experiences
A
A
Hardware Overview
How does it work?
Light Temp Click is based on the AL1782, a dual-channel PWM dimmable linear LED driver by Diodes Incorporated. It is a constant-current driver, which can sink up to 1500mA combined or up to 750mA per channel. It has two low-side current sinks, which allow LED strips or LED bulbs to be connected in the common-anode topology for increased effectiveness and power optimization. Note that the constant current on this Click board™ is 750mA per channel. The AL1782 IC can be operated with a PWM signal in the frequency range from 1kHz to 40kHz. Applying the PWM signal with a duty cycle of less than 4ms makes it possible to tune the light intensity of the connected LED light element. A LOW pulse width of more than 4ms will set the device into the low-power mode (suspend). The lowest light intensity that can be reached by applying the PWM frequency of 1kHz is 0.1%, while 40kHz allows the lowest brightness level of 4% of the full light intensity. A High PWM frequency allows for less visible flickering but simultaneously limits the lowest light intensity level. PWM1 and PWM2 pins of the AL1782 are routed to the mikroBUS™ PWM and CS pins and are labeled as PW1 and PW2. Adaptive Thermal Management (ATM) scheme is one of the key features of the AL1782. It can be used to optimize the power consumption by
adjusting the voltage of the external power supply unit (PSU): the excessive voltage applied to the connected LED will be dissipated as heat within the AL1782. Therefore, the voltage level of the external PSU should be kept above the forward voltage of the connected LED plus minimum voltage headroom (VF + VLED_REG). The ATM injects current through the LEDPG pin of the AL1782. This current is converted to a voltage level, and it is sampled by the MCP3221, a low-power 12-bit A/D converter with an I2C interface, by Microchip. It has its I2C pins routed to the respective mikroBUS™ I2C pins, allowing the host MCU to read the LEDPG voltage and adjust the PSU voltage. Please note that if an external PSU with no external regulation is used, its voltage should stay within the mentioned range (VF of the connected LED element + VLEDx_REG as per AL1782 datasheet). However, the voltage should always stay below 30V. The AL1782 IC also integrates many protection features for increased reliability: undervoltage, open or short circuit at the output, and thermal protection. If any of these protections become activated, a fault event will be reported on a dedicated pin labeled FAULTB. This pin is routed to the mikroBUS™ INT pin and is asserted to a LOW logic level when a fault event occurs. Deep Dimming Capability helps with
power efficiency. Subjective perception of the light intensity differs from the measured light. For example, the light intensity of 10% (with respect to the applied duty cycle) is perceived as 32% of the full light intensity. Deep Dimming Capability helps with energy saving, providing an optimal light output. Deep Dimming down to 0.1% is possible with the AL1782 IC since it can be operated with a pulse width as low as one µS while still providing good linearity. Light Temp click is designed to use an external PSU and an MCU. The full potential of the Light Temp click is achieved when combined with a dedicated light temperature and color sensing Click board™ such as Spectral click. By receiving information about the ambient light color temperature and white balance from the Spectral click, the MCU can generate a PWM signal concerning the required CCT tuning and send it to the Light Temp click to regulate the ambient lighting color. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Features overview
Development board
EasyPIC v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports many high pin count 8-bit PIC microcontrollers from Microchip, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, EasyPIC v8 provides a fluid and immersive working experience, allowing access anywhere and under any
circumstances at any time. Each part of the EasyPIC v8 development board contains the components necessary for the most efficient operation of the same board. In addition to the advanced integrated CODEGRIP programmer/debugger module, which offers many valuable programming/debugging options and seamless integration with the Mikroe software environment, the board also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.
Communication options such as USB-UART, USB DEVICE, and CAN are also included, including the well-established mikroBUS™ standard, two display options (graphical and character-based LCD), and several different DIP sockets. These sockets cover a wide range of 8-bit PIC MCUs, from the smallest PIC MCU devices with only eight up to forty pins. EasyPIC v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC
MCU Memory (KB)
128
Silicon Vendor
Microchip
Pin count
40
RAM (Bytes)
8192
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output via UART Mode
1. Once the code example is loaded, pressing the "FLASH" button initiates the build process, and programs it on the created setup.
2. After the programming is completed, click on the Tools icon in the upper-right panel, and select the UART Terminal.
3. After opening the UART Terminal tab, first check the baud rate setting in the Options menu (default is 115200). If this parameter is correct, activate the terminal by clicking the "CONNECT" button.
4. Now terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
Software Support
Library Description
This library contains API for Light Temp Click driver.
Key functions:
lighttemp_get_interrupt_state
- Get INT pin statelighttemp_get_pg_voltage
- Get voltagelighttemp_cs_set_state
- Start PW2 module.
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* @file
* @brief LightTemp Click example
*
* # Description
* This application controls light intensity of LEDs.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initialization driver init and pwm init for all LED's
*
* ## Application Task
* This is an example that demonstrates the use of the Light Temp Click board.
* This example shows the automatic control of the LED light intensity,
* the first intensity of light is rising and then the intensity of light is falling.
* Results are being sent to the Usart Terminal where you can track their changes.
*
* ## NOTE
* In order to control LED2 via PWM, the PWM module should be available at CS pin.
*
* @author Nikola Peric
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "lighttemp.h"
// ------------------------------------------------------------------ VARIABLES
static lighttemp_t lighttemp;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
lighttemp_cfg_t cfg;
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
Delay_ms( 100 );
// Click initialization.
lighttemp_cfg_setup( &cfg );
LIGHTTEMP_MAP_MIKROBUS( cfg, MIKROBUS_1 );
lighttemp_init( &lighttemp, &cfg );
lighttemp_led1_set_duty_cycle ( &lighttemp, 0.0 );
lighttemp_led2_set_duty_cycle ( &lighttemp, 0.0 );
log_info( &logger, "---- Application Task ----" );
Delay_ms( 500 );
}
void application_task ( void )
{
static int8_t duty_cnt = 1;
static int8_t duty_inc = 1;
float duty = duty_cnt / 10.0;
lighttemp_led1_set_duty_cycle ( &lighttemp, duty );
lighttemp_led2_set_duty_cycle ( &lighttemp, duty );
lighttemp_led1_pwm_start( &lighttemp );
lighttemp_led2_pwm_start( &lighttemp );
log_printf( &logger, "Duty: %d%%\r\n", ( uint16_t )( duty_cnt * 10 ) );
Delay_ms( 500 );
if ( 10 == duty_cnt )
{
duty_inc = -1;
}
else if ( 0 == duty_cnt )
{
duty_inc = 1;
}
duty_cnt += duty_inc;
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END