Design and Implementation of LED Dimming System with Intelligent Sensor Module
Design and Implementation of LED Dimming System with Intelligent Sensor Module
Journal of Information and Communication Convergence Engineering. 2013. Dec, 11(4): 247-252
Copyright ©2013, The Korean Institute of Information and Commucation Engineering
This is an Open Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License ( which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.
  • Received : April 22, 2013
  • Accepted : July 24, 2013
  • Published : December 31, 2013
Export by style
Cited by
About the Authors
Young Seek Cho
Center for Advanced Electric Applications, Wonkwang University, Iksan 570-749, Korea
Jaerock Kwon
Department of Electrical and Computer Engineering, Kettering University, Flint, MI 48504, USA
Hwan-Yong Kim
Department of Electronic Engineering, Wonkwang University, Iksan 570-749, Korea

An intelligent light emitting diode (LED) dimming system is designed and implemented for energy-saving lighting systems. An LED light bulb is powered by an LED driver controlled by a microcontroller using pulse width modulation (PWM) signals. By changing the duty cycle of the PWM signals, the LED driver generates a driving current of up to 1,000 mA. The current consumption by the LED light bulb exhibits a very linear characteristic that indicates that the level of LED dimming can be finely tuned. Multiple sensors—lighting intensity and ultrasonic range sensors—are combined with the LED dimming system to realize an automatically controllable LED lighting system. The light intensity sensor is capable of sensing ambient light. The ultrasonic range sensor can detect objects from 0.15 to 5.6 m at a resolution of 0.0254 m. The collected information by the light intensity and ultrasonic range sensors is processed by the microcontroller that in turn automatically controls the brightness of the LED light bulb. The algorithm of the software for the LED dimming system is also described.
The light emitting diode (LED) is considered a nextgeneration light source since not only is it energy efficient but it also has the long life required for the illumination of homes and offices. The US Department of Energy expects that $15 billion in energy costs per year can be saved if LEDs are used as a light source [1] . For the general purpose of illumination, white LEDs are usually required. Highpower white LEDs required for this purpose could be manufactured after the development of gallium nitridebased LEDs.
Since traditional light sources, such as incandescent light bulbs and florescent lights are being replaced by LEDs, research activities have been focused on the design of LED light fixtures [2] for efficient light emission or enhancement of the lifetime of LED light by designing an optimal heat sink [3 , 4] .
Recently, the research focus has shifted to the design of an intelligent LED lighting system because of the fact that the LED is easily combined with other electronics, such as microcontrollers, a variety of sensors, and wired and/or wireless communication devices to implement intelligent lighting systems. In order to design smart LED lighting systems, the authors surveyed and suggested the choice of power and control hardware in [5] . In [6] , an ambient light sensor is integrated on a LED driver chip. A dimming system to control an LED street lamp through ZigBee and
Lager Image
A block diagram of the proposed light emitting diode (LED)dimming system with multiple sensors controlled by a microcontroller.PWM: pulse width modulation.
general packet radio service (GPRS) is proposed [7] . If the LED lighting system is combined with a wireless sensor network and uses the location estimation method proposed in [8] , the LED lighting system will become more intelligent than ever before.
In this study, an intelligent LED dimming system, as shown in Fig. 1 , is designed and implemented using an LED driver circuit and multiple sensors—light intensity and ultrasonic range sensors—and is controlled by a microcontroller.
For the development of an intelligent LED dimming system controlled by a microcontroller, certain hardware and software design techniques are required.
- A. Hardware Design
As shown in Fig. 1 , a microcontroller, an LED driver, and a variety of sensors are required to implement the proposed LED dimming system. Basically, the brightness of LEDs can be adjusted by controlling the forward current through the LEDs. There are two possible ways to dim LEDs: analog dimming and digital dimming. Analog dimming is achieved by adjusting the forward current linearly through the LEDs using a data converter, such as an analog-to-digital converter (ADC) or a digital-to-analog converter. On the other hand, digital dimming is commonly used because of its easy implementation and the improved LED driver efficiency. A simple, widely used method of digital dimming is dimming with a pulse width modulation (PWM) signal. The forward current through the LEDs can be adjusted by changing the duty cycle of the PWM signal; this results in controlling the brightness of the LEDs. Many microcontrollers available on the market today are capable of generating PWM signals.
Lager Image
Photographs of (a) Stellaris microcontroller development board,(b) Supertex LED driver board, (c) ultrasonic range sensor and lightintensity sensor, and (d) LED light bulb (inset shows the LED chips insidethe light diffuser). Note that these photographs are not to scale. LED: lightemitting diode.
LED dimming without manual control can be realized by integrating sensors into the LED dimming system. In this work, two different sensors—a light intensity sensor and ultrasonic range sensor—are used. The light intensity sensor monitors the ambient light intensity around the LED lighting.
The ultrasonic range sensor provides sonar range information for the microcontroller to control the brightness of the LED light bulb.
In this work, a Stellaris microcontroller, LM3S9D96 [9] manufactured by Texas Instruments, is used for implementing the LED dimming system. A 32-bit microcontroller is used in this work since more intelligent functions, for example, wired light control (that is, digital addressable lighting interface [DALI]), wireless light control (ZigBee or Bluetooth), and visual light communication, can be implemented in a future work. For the LED driver, a Supertex LED driver, HV9910B [10] , is used for
Major components and their manufacturers
Lager Image
Major components and their manufacturers
Lager Image
Overall design architecture of the control software. ADC: analogto-digital converter, PWM: pulse width modulation.
generating power for a 7-W 2-chip LED light bulb. The Stellaris microcontroller is connected to the LED driver and controls the output current of the LED driver by changing the duty cycle of the PWM signals.
For the light intensity sensor, a CdS photoconductive cell, GL5528 [11] manufactured by LIDA Optical & Electronic Co., Ltd., is used. For the ultrasonic range sensor, a highperformance sonar range finder, MB1010 [12] manufactured by MaxBotix Inc., is used. It provides sonar range information from 6 inches (0.15 m) to 254 inches (6.45 m) at a resolution of 1 inch (0.0254 m). A 7-W 2-chip LED light bulb is fabricated using two LED chips, a heat sink, and a light diffuser in the lab at Wonkwang University. Each LED chip consumes 832 mA at 8.6 V when the duty cycle of the PWM signal is 100%. Photographs of the microcontroller, LED driver, sensors, and LED light bulb are shown in Fig. 2 (a), (b), (c), and (d), respectively. The major components and their manufacturers are listed in Table 1 .
The various PWM signals generated by the microcontroller and the current consumption of the LED light bulb with respect to the duty cycle of the PWM signal will be discussed in the next section.
- B. Software Design
The software implementation for controlling the LED dimming system is as follows: ADC interrupts are used for converting the analog input from the light intensity sensor and the ultrasonic range sensor into a digital value. Timer1 in the microcontroller is used for generating PWM signals. The output of the light intensity sensor and the ultrasonic range sensor is read periodically. In this system, a polling method is used for the sake of simplicity. Fig. 3 shows the overall control structure.
Lager Image
Two main software modules: (a) interrupt service routine forreading the ultrasonic range sensor and (b) controller routine that adjuststhe duty cycle of the pulse width modulation (PWM) signals. ADC: analogto-digital converter.
- 1) Control of ultrasonic range sensor
For reading the ultrasonic range sensor and calculating the distance from the raw sensor value, the following algorithm is implemented in the actual code:
  • (1) Initialize the ADC interrupt.
  • ① Enable the ADC.
  • ② Enable GPIO port B.
  • ③ Configure Pin 4 of GPIO port B.
  • ④ Configure the ADC sample sequence to read a voltage from the pin.
  • ⑤ Enable the ADC sample sequence interrupt.
  • (2) Implementation of an ADC interrupt handler.
  • ① Clear the ADC sample sequence interrupt.
  • ② Read a raw ADC value.
  • ③ Convert the raw value to millivolts using the equation Or× VCC× 1,000/Rmax, where Ordenotes the raw output value; VCC, the input voltage; and Rmax, the maximum resolution value.
  • ④ Update current millivolt value that will be used for changing the PWM duty cycle to change the brightness of the LED light bulb on the basis of the measured distance. See “3) Control of duty cycle of PWM signals” for more details.
The distance from an output voltage of the ultrasonic sensor can be calculated as follows: V CC is 3.3 V in the Stellaris board. The voltage resolution of the sensor is 512, which means V CC can be evenly divided by 512. The unit millivolt (mV) for an inch can be calculated by dividing 3,300 mV by 512 (= 6.45 mV). Therefore, the output voltage of the ultrasonic range sensor can be used for measuring the distance by dividing the raw voltage by the unit voltage. For example, if the output voltage of the ultrasonic range sensor is 500 mV, the distance will be 500 mV/6.45 = 77.52 inches.
The light intensity sensor can be controlled by a similar algorithm for the ultrasonic range sensor.
- 2) Generation of PWM signals
As mentioned previously, Timer1 in the microcontroller is used for generating PWM signals. The following algorithm is implemented in the actual code:
  • (1) Initialize the board.
  • ① Set the clock to run directly from the external crystal/oscillator. A 16-MHz crystal is used.
  • ② Enable the Timer1 peripheral.
  • ③ Enable GPIO port E.
  • (2) Configure the timer.
  • ① Configure the GPIO pin muxing for the Timer/ CCP function.
  • ② Configure the CCP setting for CCP3. Pin 4 of GPIO port E is used.
  • ③ Configure Timer1 as a 16-bit periodic timer.
  • ④ Set the Timer1 value to 50,000.
- 3) Control of duty cycle of PWM signals
The following algorithm is implemented in the actual code to control the duty cycle of the PWM signals.
  • (1) Disable Timer1.
  • (2) Read current timer load value Lt that was set to 50,000 in this algorithm.
  • (3) Acquire distance information from the ultra-sonic range sensor. See “1) Control of ultrasonic range sensor” for more details about acquiring distance information from the ultrasonic range sensor.
  • (4) Acquire the on-duty percentageóonfromdcur/dmaxwheredmaxdenotes the maximum distance to measure anddcurrepresents the current distance information.
  • (5) Set the timer with Lt× (1 -óon).
  • (6) Enable the timer.
Fig. 4 (a) and (b) show the overall procedures of these two software modules.
- A. Setup of LED Dimming System
In this work, the Stellaris microcontroller development board from TI is used for simplifying the hardware development process. To the microcontroller development board, the ultrasonic range sensor and the light intensity sensor are connected through analog interface ports of the microcontroller.
Lager Image
Experimental setup for the light emitting diode (LED) dimmingsystem. The inset shown in the upper left of the photograph is the top viewof the experimental setup.
Lager Image
The pulse width modulation (PWM) signals generated by themicrocontroller at the three different positive duty cycles: (a) 1/16 = 6.25%,(b) 8/16 = 50%, and (c) 15/16 = 93.75%.
Lager Image
Current consumption by the 2-chip light emitting diode (LED) lightbulb and the input voltage at the 2-chip LED light bulb with respect to theduty cycle of the pulse width modulation signals.
Lager Image
Duty cycle of the pulse width modulation signals with respect tothe distance measured by the ultrasonic range sensor.
An LED driver board generating stable power for the 2- chip LED light bulb is connected to the microcontroller development board that provides PWM signals. The LED dimming system described above is shown in Fig. 5 . For the sake of convenience, the top view of the LED dimming system is shown in the inset of Fig. 5 .
- B. Performance of LED Dimming
The various PWM signals from the microcontroller are shown in Fig. 6 . PWM signals with the positive duty cycles of 6.25%, 50%, and 93.75% are shown in Fig. 6 (a), (b), and (c), respectively. The frequency of the PWM signals is set at 320 Hz, since the minimum output frequency is known to be 300 Hz for flicker-free LED dimming. As expected, the PWM signal at the very low duty cycle is a very narrow pulse as shown in Fig. 6 (a). On the other hand, at the very high duty cycle shown in Fig. 6 (c), the PWM signal is almost flat at the 3.3 V level. At the 50% duty cycle, the PWM signal is just a rectangular waveform. In this work, the LED dimming is implemented at a resolution of 8 bits(that is, 256 levels). In order to quantify the LED dimming level with respect to the duty cycle of the PWM signal, the current consumption by the 2-chip LED light bulb is measured and shown in Fig. 7 . The voltage at the input of the LED light bulb is also measured. It is clearly shown that the LED dimming level is controlled linearly by the duty cycle of the PWM signals. This linear characteristic is essentially the performance of the LED dimming system, since it allows the fine dimming range controlled by the microcontroller through PWM signals.
- C. Control of Multiple Sensors by Software
As an example of the software algorithm, Fig. 8 shows the duty cycle of the PWM signals generated by the microcontroller with respect to the measured distance from the LED light bulb by the ultrasonic range sensor. In the driver software, there is a look-up table for the duty cycle versus the distance from the LED light bulb. When the ultrasonic range sensor detects an object, the microcontroller calculates the distance between the LED light bulb and the object and generates a PWM signal according to the look-up table. As shown in Fig. 8 , the generated duty cycle is almost the same as the duty cycle in the look-up table in the driver software.
At a distance of more than 5.6 m, the microcontroller generates a duty cycle of 98% because of the limitation of the ultrasonic range sensor. Although the manufacturer specifies that the maximum detectable distance is 6.45 m, the actual distance measured by the sensor in the experiment is 5.6 m. This produces the difference between the generated duty cycle and the duty cycle in the look-up table as shown in Fig. 8 .
Using a microcontroller with multiple sensors—light intensity sensors and ultrasonic range sensors—in this work, we have designed and implemented an intelligent LED dimming system. Further, a 256-level LED dimming system is realized by controlling the duty cycle of PWM signals from the microcontroller. When the LED dimming function is combined with the multiple sensors that provide the distance information from any objects and the ambient light intensity around the LED light bulb, the brightness of the LED is automatically controlled. The proposed intelligent LED dimming system can work together with a wired and/or wireless network interface to realize ubiquitous LED lighting systems.
This research was supported by Basic Science Research Program through the National Research Foundation of Koreafunded by the Ministry of Education, Science and Technology(No. 2012R1A1A2040719).
US Department of Energy 2006 “Energy savings potential of solid statelighting in general illumination applications (final report)” US Department of Energy Washington, DC
Kini S. G. 2011 “Design and development of energy efficient retrofitLED fixture for solar powered home lighting system” in Proceeding of the Annual IEEE India Conference Hyderabad, India
Seo B. S. , Lee K. J. , Yang J. K. , Cho Y. S. , Park D. H. 2012 “Development and characterization of optimum heat sink for 30 Wchip on board LED downlight” Transactions on Electrical and Electronic Materials 13 (6) 292 - 296    DOI : 10.4313/TEEM.2012.13.6.292
Liu D. , Yang D. G. , Ren R. , Hou F. , Huang C. 2011 “Reliabilitystudy on high power LED with chip on board” in Proceeding of Technology & High Density Packaging Shanghai, China 1004 - 1007
Suzdalenko A. , Galkin I. 2010 “Choice of power and controlhardware for smart LED luminary” Tallinn, Estonia in Proceeding of the 12th IEEE Biennial Baltic Electronics Conference 331 - 334
Wu J. F. , Wei C. L. , Hsieh Y. T. , Fang C. L. , Tsai H. H. , Juang Y. Z. 2011 “Integrated ambient light sensor on a LED driver chip” in Proceeding of the IEEE International Conference on Power Electronics and Drive Systems Singapore 944 - 947
Lian L. , Li L. 2012 “Wireless dimming system for LED street lampbased on ZigBee and GPRS” in Proceeding of the 3rd IEEE International Conference on System Science, Engineering Design and Manufacturing Informatization Chengdu, China 100 - 102
Oh C. H. 2012 “Location estimation enhancement using space-timesignal processing in wireless sensor networks: non-coherentdetection” Journal of Information and Communication Convergence Engineering 10 (3) 269 - 275    DOI : 10.6109/jicce.2012.10.3.269
Texas Instruments Stellaris LM3S9D96 microcontroller datasheet [Internet]. Available:
Supertex Inc. Universal high brightness LED driver: HV9910Bdatasheet [Internet]. Available:
LIDA Optical and Electronic Co. Ltd. CdS photoconductive cells:GL5528 [Internet]. Available:
MaxBotix Inc. LV-MaxSonar-EZ1 high performance sonar rangefinder [Internet]. Available: