Design of Automobile Lighting System Based on Microcontroller and LED

Design of Automobile Lighting System Based on Microcontroller and LED

Abstract: A single-chip microcomputer PIC18F448 is used as the control center, multiple LEDs are driven by the high-power LED driver XLT604 to achieve lighting, and the duty cycle of the PWM pulse is adjusted in real time according to the ambient temperature and the bright signal, and the brightness of the LED is dynamically adjusted by the PWM pulse.

Compared with traditional halogen low-voltage lighting, LED lighting has many advantages: (1) the light source is more concentrated, and the brightness obtained by 1 W lighting is equivalent to the brightness of a dozen-watt halogen lamp, so it is very energy-saving; (2) the life of LED lamp is more than halogen The lamp is long, generally up to tens of thousands or even 100,000 hours; (3) The structure of the LED is simple and the seismic performance is good; (4) No hot start time is required, and the response speed of the lamp is fast; (5) The working voltage is between 6 and 12 V between. Based on these advantages, high-brightness LED lighting technology has increasingly become the development trend of automotive lighting, and can bring good cost performance.

Because the automotive lighting system requires simple control, energy saving, environmental protection, high efficiency and safety [1], this system mainly uses the high-power LED driver XLT604 to drive the LED to emit light, and uses an 8-bit microcontroller PIC18F448 to output PWM pulses with different duty cycles for dynamic control Its luminous intensity, and use the digital temperature sensor DS18B20 to test the temperature of the system, and at the same time real-time control of the system's heat. In addition, the system also uses a photoresistor sensor to adaptively adjust the brightness of the lighting system.

1 System hardware design

The system hardware mainly includes LED drive and dimming, brightness detection, temperature detection and other functional modules with a single-chip microcomputer as the control center. Among them, the brightness detection and temperature detection modules are relatively simple. The system mainly designs LED drivers and dimming modules.

1.1 System overall structure design

The main function of the automotive lighting system is to adjust the brightness of the LED adaptively according to the ambient temperature and brightness. This system uses PIC18F448 single-chip microcomputer as the LED control center, uses one of the 10-bit A / D conversion channels to receive the brightness signal, the RB port receives the temperature detection signal, and outputs PWM pulses with different duty cycles to XLT604 through the CCP module according to the brightness and temperature The PWM pin of the LED driver adjusts the output luminous flux of the LED in real time, that is, adjusts the brightness of the LED. The overall structure of the system is shown in Figure 1.

1.2 LED driver and dimming

In automotive lighting systems, the LED drive circuit must be able to obtain operating power from the automotive power bus. In application, in order to obtain the illumination light source with the required brightness, a single high-power LED or a structure in which multiple LEDs are connected in series, parallel, or series-parallel connection can be used. Since the nominal value provided by the automotive power bus is 12 V, the system selects a high-power LED driver chip XLT604 with an input voltage of 7 to 450 V. XLT604 is a PWM high-efficiency LED drive control chip designed by BICMOS process. It can drive an external MOSFET at a fixed frequency of 300 kHz, and its frequency can be determined by external resistance programming; the external high-brightness LED string can be controlled by a constant current method to maintain a constant high Brightness and enhance the reliability of LED, its constant current value can be determined by external sampling resistance, and its variation range is from a few mA to 1 A. The LEDs driven by XLT604 can linearly adjust their brightness through external control voltage, and can also adjust the brightness of LED strings through external low-frequency PWM. In automotive lighting systems, generally only the output flux range is 150 ~ 800 lm. The system uses Cree's XLamp XP-E LED, which can achieve a luminous efficiency of 100 lm / W, and adopts the structure of 3 LEDs in series [2]. The LED drive and dimming circuit are shown in Figure 2.


1.2.1 LED drive control

In Fig. 2, XLT604 adopts DC-DC step-down drive, the external input voltage is 12 V, and the LED string voltage is 9 V. When the GATE terminal outputs a high level, the energy stored in the inductor or part of the energy is directly transferred to the LED string. The system works by limiting the peak current of the power tube; when the power MOSFET is turned off, the energy stored in the inductor is converted to the LED drive Current. The external current sampling resistor R2 is connected in series with the source of the power tube. When the voltage value of R2 exceeds the set value, the power tube is turned off [2].

1.2.2 LED dimming

XLT604 has two dimming methods: linear adjustment and PWM adjustment. Linear adjustment can dynamically control the brightness of the LED, but it will reduce the efficiency of the LED and cause the color shift of the white LED to the yellow spectrum. The advantages of PWM adjustment technology are obvious. When the PWM pulse is an effective high level or low level, the LED input current is maximum or 0, respectively, and its on-time is controlled by the duty cycle of the PWM pin input pulse [3]. Because the LED always works under the same current condition, by applying a PWM signal to control the LED brightness, the dynamic adjustment of the LED brightness can be achieved without changing the color, so this system uses PWM dimming. The PWM signal is obtained from the PWM signal output by the single-chip PIC18F448 to the PWM terminal of XLT604. PIC18F448 changes the duty cycle of the PWM pulse signal according to the temperature measured by the temperature detection module and the luminous flux signal measured by the photosensitive sensor to adjust the brightness of the LED, so as to achieve the purpose of energy saving. The brightness of the LED lamp is proportional to the high-level time length of the PWM signal. It can be dimmed in the range of 0 to 100% through the PWM adjustment method, but it cannot tune out the current higher than the set value. The PWM dimming accuracy is limited only by the narrowest pulse width output by the GATE terminal [4].

1.3 System main control circuit design

PIC18F448 microcontroller is the main control center of the system. It contains 4 timers, 4 I / O ports, 8-channel 10-bit A / D converter, 2 PWM pulse outputs, SPI bus interface, etc. System design requirements [1]. The main control circuit of the system is shown in Figure 3. Among them, the AN0 pin of the RA port of the PIC18F448 receives the light detection signal from the photosensitive sensor, the RB4 port receives the DS18B20 temperature detection signal, and the system outputs PWM pulses with different duty cycles to the PWM pin of the XLT604 driver according to these 2 variables Thereby adjusting the output luminous flux of the LED.


The luminous flux detection is implemented by a photoresistor, and a voltage of 5 V is added to both ends of it. When the ambient light intensity changes, the resistance of the photoresistor changes, causing the output voltage to change between 0 and 5 V. The temperature detection uses a single bus digital temperature sensor DS18B20, which has the advantages of simple structure, small size, low power consumption, and the user can set the upper and lower warning temperature limits by himself. The temperature measurement range is -55 ℃ ~ + 125 ℃, which can be well satisfied Requirements for system temperature measurement. The system uses a single bus to transmit the temperature signal, which can greatly save the limited port resources of the single-chip microcomputer, simplify the network structure of the temperature measurement network, and enhance the expansion ability of the system. Because the single bus communication has a unique power and signal composite function, only one port line is used, each chip is uniquely encoded and supports network addressing and other characteristics.

2 System software design

The software part of this system is relatively simple, the main program flow chart of the system is shown in Figure 4.

After the system is powered on, it first initializes the PIC18F448, reads its luminous flux detection signal and temperature signal, and then adjusts the duty cycle of the output PWM pulse and sends it to the PWM pin of LXT604. Dynamically adjusting the duty cycle of the PWM output pulse according to the luminous flux and temperature signal value is the key content in the system software design. Operating the internal register of the PIC18F448 can adjust the duty cycle of the output PWM pulse. The implementation steps are as follows: (1) Initialize the lower 4 bits of the CCP1 module control register CCP1CON to 11XX, and clear the TRISC.2 bit to make the CCP1 module work in In the PWM pulse output mode, PWN pulses with a resolution of up to 10 bits can be output; (2) write the 8-bit period register PR2 of the timer TMR2 to set the period of the PWM output pulse; (3) write the control register T2CON of the timer TMR2, Enable timer TMR2 and initialize the prescaler value of TMR2; (4) CCP1 module contains two 8-bit registers CCPR1H (high byte) and CCPR1L (low byte), by writing to CCP1CON controller CCPR1L 4, 5 bits can get the high level time of the PWM pulse, which can be written at any time, but only when the increment count value of the timer TMR2 is equal to the value of the period register PR2, the data is really written into the CCPR1H register. PWM pulse period = [(PR2) +1] × 4 × Tosc × (TMR2 prescaler value), PWM high level time = (CCPR1L: CCP1CON [5: 4]) × Tosc × (TMR2 prescaler value ), PWM output duty ratio = (CCPR1L: CCP1CON [5: 4]) / (PR2 + 1) × 4.

This system uses a single-chip microcomputer as the control center and high-power LED lighting design scheme, with good flexibility and scalability. Using light sensor and temperature sensor to measure the light intensity and temperature of the surrounding environment respectively, and dynamically adjust the LED brightness based on this information, which can save energy well. The lighting system is used as the rear light of the car. Because the LED lights quickly, it can prompt the driver behind the car to know the running status of the vehicle in front and reduce the occurrence of rear-end collision accidents. High-brightness LED has been widely used in automotive lighting systems

Featuring Level VI energy efficiency and meet IEC/EN/UL 62368 safety standards, the external universal Power Adapter accepts universal input voltage 100VAC to 240VAC and provides 3 Years warranty. These 40 W to 60 W series power adapters use ABS+PC flame retardant material housing, all materials conform to the international environment protection standard. Protections for over voltage, over current and short circuit are also included.

40 ~ 60 Watt KS series Desktop Adapters

External Power Adapter,Ac to Dc Adapter,Christmas Tree Adapter,Switching Adapter

Shenzhenshi Zhenhuan Electronic Co Ltd , https://www.szzhpower.com

This entry was posted in on