Give away medical masks when you place an order. learn more

Microcontrollers in Commercial Lighting Applications



Microcontrollers are at the heart of any control system, and for commercial lighting, they have two key roles to play in reducing the power consumption.

Adding a network node to a lighting system allows the lighting system to be controlled from a central point, integrating with enterprise software to switch the power on and off. However, the increasing integration of microcontrollers, particularly with pulse width modulation blocks, allows them to control the lighting systems directly to provide more efficient control and lower costs.

Reducing the cost of the energy supply to commercial facilities is a key cost-of-ownership requirement. As energy costs rise, the cost of lighting for a commercial office environment is a substantial sum. Being able to switch off the lighting when there is no-one in the room, and switch on and off automatically depending on the occupancy of the building gives the facilities manager significantly more scope to reduce operating costs.

This is part of a move to “daylight harvesting”, where natural light is combined with the artificial lighting system to make the environment as effective as possible to work in and also to reduce costs. This needs a more complex design, with different types of lighting systems in different places to produce different types of light. For example, halogen spot lights in darker areas away from natural light from windows gain functionality to be switched on later in the day rather than using more diffuse fluorescent lighting that is constantly on.

All of these systems should also be connected to a central control to optimize the use of the lighting throughout the day and into the evening. These control systems need to be as simple to use as possible, ideally with intelligence built into the network node to reduce the overall complexity for the user.

The choice of microcontroller for the network node depends on the wireless protocols used. In the commercial environment, there is considerable advantage to being able to use the existing 2.4 GHz Wi-Fi network to link the lighting control nodes. The power consumption of the node is not a huge issue, as power is available alongside the lights, and the advantage of having a consistent, homogenous network that can be integrated with the existing enterprise systems is key. Otherwise a separate network infrastructure is needed, and that can be more expensive to run as a standalone operation. This can be the case with simpler ZigBee systems, although this technology is being used by more building automation systems and may be a viable option if it is already installed.

Handing the interface to the lights themselves is another area where microcontrollers become important. Rather than designing a separate pulse width modulation circuit, this functionality is increasingly integrated into the microcontroller. This provides more flexibility to optimize the control algorithm to operate the lighting at the maximum efficiency which minimizes the power consumption when the light is on.

The move to LED lighting in commercial environments is also changing the way the lighting control systems are designed and different drive electronics are now required. This, too, is integrated into the latest generation of microcontrollers with LED drivers, alongside the PWM and timers, to provide a flexible platform for handling the wide range of lighting systems found in offices. Some microcontrollers at the high end are also integrating LCD and touchscreen controllers to also provide local control via a touchpad and screen.

Researchers are looking at different types of commercial lighting, from LEDs to full panels emulating the sky, and these also require complex control circuitry. A team at the Fraunhofer Institute for Industrial Engineering IAO in Stuttgart has developed an array of 34,560 LEDs spanning an area of 34 square meters that emulates the sky.

The luminous ceiling consists of 50 cm by 50 cm tiles, each with 288 LEDs. A diffuser film is then attached approximately 30 cm beneath the LEDs to make sure the individual points of light are not perceived to create homogenous lighting that illuminates the whole room. At full power, the “sky” lights up with an intensity of more than 3,000 lux, but 500 to 1,000 lux is sufficient to create a comfortable level of lighting.

Figure 1: The ‘sky’ ceiling lighting system developed by researchers at the Fraunhofer Institute in Germany.

The main focus in developing the virtual sky was to simulate natural lighting conditions on a cloudy day. To achieve this goal, the researchers carefully examined natural light to find out how – and how quickly – the light spectrum changes when clouds move across the sky. The LEDs allow the team to simulate these dynamic changes in lighting in a way that is not directly obvious to the naked eye. Otherwise, the lighting might distract people from their work.

The results of a preliminary study indicate that users find this dynamic lighting to be extremely pleasant. The study involved ten volunteers who carried out their daily work over the course of four days under these lighting conditions with a lighting surface of 30 cm by 60 cm. Throughout the first day, the lighting remained static. On the second day, it fluctuated gently, and on the third day the fluctuations were rapid. On the fourth day, the participants could choose which type of lighting they wanted, and 80 percent opted for the fast, dynamic lighting.

Developments such as these need ever more complex controllers. Operating in the commercial environment means that the temperature and package requirements are less demanding than industrial designs, allowing a wider range of microcontrollers to be considered.

The LM3S1P51 Stellaris processor from Texas Instruments is optimized for lighting control with pulse width modulation (PWM) peripherals alongside the 32-bit ARM Cortex-M3 processor core. The Cortex-M3 processor is built on a high-performance processor core with a 3-stage pipeline Harvard architecture, making it ideal for embedded applications. The processor has an efficient instruction set and extensively optimized design, providing high-end processing hardware including a range of single-cycle and SIMD multiplication and multiply-with-accumulate capabilities, saturating arithmetic and dedicated hardware division.

Figure 2: The Stellaris LM3S1P51 core from Texas Instruments with lighting control PWM block.

For cost-sensitive commercial designs, the Cortex-M3 processor implements tightly coupled system components that reduce processor area while significantly improving interrupt handling and system debug capabilities. The Cortex-M3 processor implements a version of the Thumb instruction set based on Thumb-2 technology, ensuring high code density and reduced program memory requirements, giving the performance of 32-bit architectures with the high code density of 8-bit and 16-bit microcontrollers.

The Cortex-M3 processor closely integrates a nested interrupt controller (NVIC) with a non-maskable interrupt (NMI) and eight interrupt priority levels. The tight integration of the processor core and NVIC provides fast execution of interrupt service routines (ISRs), dramatically reducing interrupt latency and allowing for real time control of a lighting system.

The hardware stacking of registers and the ability to suspend load-multiple and store-multiple operations further reduce interrupt latency. Interrupt handlers do not require any assembler stubs, removing code overhead from the ISRs. Tail-chaining optimization also significantly reduces the overhead when switching from one ISR to another. To optimize low-power designs, the NVIC integrates with the sleep modes, including Deep-sleep mode, which enables the entire device to be rapidly powered down.

The LM3S1P51 microcontroller provides motion control functions integrated into the device, including six advanced PWM outputs for lighting control applications, four fault inputs to promote low-latency shutdown, and two Quadrature Encoder Inputs (QEI).

Pulse width modulation (PWM) is a powerful technique for digitally encoding analog signal levels. High-resolution counters are used to generate a square wave, and the duty cycle of the square wave is modulated to encode an analog signal. The LM3S1P51 PWM module consists of three PWM generator blocks and a control block. Each PWM generator block contains one timer (16-bit down or up/down counter), two comparators, a PWM signal generator, a dead-band generator, and an interrupt/ADC-trigger selector.

Each PWM generator block produces two PWM signals that can either be independent signals or a single pair of complementary signals with dead-band delays inserted and includes four fault-condition handling inputs to quickly provide low-latency shutdown and prevent damage to the ballast. There is also a 16-bit counter and two PWM comparators that can be synchronized to produce output signals when they match, as well as a PWM signal generator where the output signal is constructed based on actions taken as a result of the counter and PWM comparator output signals.

STMicroelectronics also has a family that incorporates the ARM Cortex-M3 core for commercial lighting applications. The STM32F100xx operates at 24 MHz and integrates high-speed embedded memories (Flash memory up to 128 Kbytes and SRAM up to 8 Kbytes), and an extensive range of peripherals and I/Os connected to two APB buses. All the devices offer standard communication interfaces (up to two I2C lines, two SPIs, one HDMI CEC, and up to three USARTs), one 12-bit ADC, two 12-bit DACs, up to six general-purpose 16-bit timers, and an advanced-control PWM timer.

The advanced-control timer (TIM1) can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs with programmable inserted dead times and can also be seen as a complete general-purpose timer. The four independent channels can be used for input capture, output compare, PWM generation in edge or center-aligned modes, and in a one-pulse output mode. When configured as the 16-bit PWM generator, it has full modulation capability from 0 to 100%.

If there is a need for a low power controller, perhaps using a battery source, then Energy Micro has aimed its EFM32G222F128 Gecko 32-bit controller at such applications. Low power becomes an issue if a wide array of controllers is implemented, for example with the large number of tiles in the “sky-like” ceiling.



Figure 3: Energy Micro’s Gecko ARM Cortex-M3 processor with PWM capability.

The EFM32G222F128 uses the 32 -bit ARM Cortex-M3 CPU running at up to 32 -MHz with a Memory Protection Unit, Wake-up Interrupt Controller, and flexible Energy Management System to switch off peripherals that are not in use to save power. It includes three 16 bit Timer/Counters and three 3 channel Compare/Capture/PWM channels as well as three 8 -bit Pulse Counters.

These devices provide all of the additional circuitry for controlling a lighting system, from the inputs from a temperature sensor to brown out control to the range of inputs from other sensors that may be used in a daylight-harvesting scheme in a commercial lighting system.

At the higher end, the ARM M4 core adds digital signal processing for additional algorithm handling and some processors, such as the Kinetis K30 family from Freescale Semiconductor, and an LCD interface to control an LCD screen as part of a local control system. The MK30DN512ZVLL10 provides up to 100 MHz performance with up to 512 KB of program flash memory and up to 128 KB RAM alongside a 16-channel DMA controller, supporting up to 64 request sources. It supports two 16 -bit SAR ADCs, each with an integrated programmable gain amplifier for linking to external sensors as well as a 12-bit DAC. The device also integrates three analog comparators (CMP) containing a 6-bit DAC and programmable reference input that, along with a programmable delay block and an eight-channel PWM timer, can be used for controlling lighting systems. It also includes a touch sensor and LCD driver for managing a local control panel from the single device.



Figure 4: The Freescale K30 provides PWM alongside LCD and touch controller.

But there are more options than just 32bit processors.

Atmel’s AT90PWM1-16SU is a high performance, low power 8-bit microcontroller that uses the company’s Advanced RISC Architecture (AVR). This has 131 instructions, most executing in a single clock cycle, with flash memory and peripherals specifically targeted to lighting control.

Two 12-bit, High Speed PSCs (Power Stage Controllers) with 4-bit resolution enhancement provide the waveform generation for the lamp ballasts of a fluorescent light. A non-overlapping inverted PWM output has flexible dead-time and variable PWM duty cycle and frequency to allow the most efficient control signal to be generated. There is also an 8-bit general purpose timer/counter with separate prescaler and capture mode, as well as a 16-bit version to simplify the design of the controller.

The controller can also be used to combine the direct control of the lights with the human interface through a capacitive touch interface, reducing the bill of materials and the cost of the control node. However, this is used more frequently in standalone units controlled directly by the user rather than a wide area network, and so less useful for a daylight harvesting system.

Alongside the microcontroller handling the communications there are many opportunities to provide additional value in the control and implementation of a daylight harvesting system for commercial lighting. With the integration of pulse width modulation blocks, analog-to-digital converters for linking to sensors, and high speed interfaces to displays and network nodes, designers can provide a cost effective implementation with a minimal bill of materials. Providing this control for the lighting system allows commercial building operators to significantly reduce the power consumption and running costs of the facility.

Supplier