introduction

As a new type of light source, LED (Light Emitting Diode) has the advantages of high efficiency, energy saving, green environmental protection and long service life, which represents the development direction of future lighting technology. This paper designs a multi-function white LED table lamp system with AT89S51 single chip as the core. It adopts PT4115 high-power LED constant current driving scheme to realize PWM dimming control of LED table lamp. It also has clock calendar, sound and light alarm clock, temperature detection, LCD display and many other functions. While achieving high efficiency and energy saving, it provides great convenience for home use.

1 system hardware circuit design

The multi-function LED desk lamp system uses 20 5mm high-bright white LED lamp beads as the light source, and the AT89S51 single-chip microcomputer is the main control chip. The LED constant current drive system, clock system, temperature measurement system, liquid crystal display system, buzzer system and buttons System composition. The system block diagram is shown in Figure 1.

The system can realize the 10-level PWM dimming control of the LED desk lamp; the LCD screen displays the clock, calendar and ambient temperature information in real time; the alarm function uses the sound and light alarm mode, that is, once the alarm time is reached, the LED desk lamp automatically lights up and emits a bee. The alarm is sounded to wake up the user; the user can set the clock calendar and alarm parameters, adjust the brightness of the LED, and release the alarm by the button system.

Multifunctional LED table lamp design

Figure 1 System block diagram

1.1 MCU main control system

The main control system of this design is realized by ATMEL's high-performance AT89S51 chip. Its P0 port is connected with 10K pull-up resistor, and P0.0~P0.7 is used as the data interface of DS12C887 and the data interface of LCD 1602. P2.0~P2.3 ​​are connected to the chip select terminal CS of the DS12C887 chip, the address strobe input terminal AS, the data selection terminal DS and the read/write input terminal R/W, and P3.2 is connected to the alarm interrupt request output terminal IRQ. P2.5~P2.7 are connected to the enable terminal EN of the liquid crystal 1602, the data/command selection terminal RS, and the read/write selection terminal RW.P2.4 as the buzzer control terminal. P3.0 is the signal input for the DS18B20. P3.1, P3.4, P3.5, P3.6 and P3.7 are used as S2~S6 button systems. P1.1 is used as the output of the PWM signal and connected to the DIM terminal of the PT4115 chip for PWM dimming control. The system crystal oscillator circuit consists of a 12MHZ crystal oscillator and two 30PF capacitors; the reset circuit consists of an S1 button, a 10K resistor and a 10uF electrolytic capacitor. The main control system circuit is shown in Figure 2.

Multifunctional LED table lamp design

Figure 2 MCU main control system circuit diagram

1.2 Constant current drive system

The design L ED light source is connected in parallel with each other, consisting of 20 5mm high brightness and low power LED lamp beads; each LED lamp has a voltage drop of about 3.1V and an operating current of about 20mA. The positive volt-ampere characteristics of the white LED It can be seen that when the voltage at the LED terminal exceeds its forward voltage, a small voltage fluctuation will cause a drastic change in the operating current, thereby affecting the normal use of the LED. The solid LED should be driven by a constant current. Therefore, the LED of this design is driven by high-performance PT4115 constant current chip. PT4115 is a continuous inductor current conduction mode buck constant current source chip, which can directly convert DC voltage into stable constant current output; it adopts 6~30V Wide voltage input, output current up to 1.2A, conversion efficiency up to 97%, output current accuracy of ± 5%. The chip contains jitter characteristics inside, greatly improving EMI, while having over temperature, over voltage, over current, LED open circuit protection and other functions. The chip is suitable for the driving circuit of the green lighting LED lamp, and has the advantage that the application circuit is very simple. The LED constant current drive circuit is shown in Figure 3.

Multifunctional LED table lamp design

Figure 3 LED constant current drive system circuit diagram

Analog or PWM dimming is facilitated by the DIM terminal on the PT4115 chip. Since analog dimming directly changes the current flowing through the LED to achieve brightness adjustment, in addition to the brightness will change, it will also affect the quality of white light, that is, the white light emitted by different currents has color shift. Therefore, this design uses PWM dimming scheme. The basic principle of PWM dimming is to keep the LED forward conduction current constant, and to control the ratio of the time when the current is turned on and off, that is, change the duty cycle of the input pulse signal to make the LED Produce light and dark changes; and use the visual residual effect of the human eye, when the LED light and dark change frequency is greater than 120Hz, the human eye will not feel the flicker, and see the average brightness of the LED. The advantage of PWM dimming is that the current of the LED forward conduction is constant, and the chromaticity of the LED does not change like analog dimming.

The current value of the PT4115 constant current drive output is calculated as:

IOUT = (0.1 × D) / Rs (D is the square wave signal duty cycle, and Rs is the current limiting resistor.

The LED light source of this design adopts 20 low-power white LED lamp bead parallel mode, and each LED lamp bead rated current is 20mA, then the maximum current IOUT of PT4115 constant current drive output should be 400mA, so Rs selects 0.25 Ω resistor.

L1 is the ballast inductor and selects 68μH to stabilize the current through the LED. D1 is a freewheeling diode. When the internal MOS transistor of the chip is off, it provides a discharge circuit for the current stored in the inductor L1. Because of the high frequency operation, D1 selects the Schottky diode SS24 with a small forward voltage drop and fast recovery. .

The PWM pulse signal is generated by the microcontroller P1.1, and its high and low levels determine the on/off state of the LED. Set the timer T0 overflow interrupt to 1/2500 seconds (ie 400μ S), every 10 pulses as a period, that is, the frequency is 250HZ. Thus, in every 1/250 second square wave period, by changing the square wave The duty cycle is output to achieve a 10-level brightness adjustment of the LED, ie the LED brightness level is determined by the number of high-level pulses per cycle. When the number of high-level pulses is 1, the duty ratio is 1/10, the brightness is the lowest, and the dimming principle is shown in Figure 4. When the high-level pulse is 10, the duty ratio is 1, and the LED brightness is the highest. .

Multifunctional LED table lamp design

Figure 4 PWM dimming schematic

1.3 Clock System

The clock system uses the high-performance DS12C887 clock chip. The chip is rich in functions and simple to use. It is a high-precision real-time clock chip; it can automatically generate time information such as century, year, month, day, hour, minute and second. Compensation and alarm (timing) function, and internal lithium battery, when the external power is off, the clock can still be maintained accurately, its internal time information can be maintained for 10 years; after the external system is powered off, the user does not need to reset the time .

The DS12C887 clock chip has two bus modes of operation, Motorola and Intel modes. This design uses Intel mode, that is, the first pin of the chip is connected to GND. At the same time, the clock system is set to 24-hour mode, and the register storage mode is selected as binary format. P0.0~P0.7 is connected to its address data multiplexing port AD0~AD7.P2.0~P2.3 ​​respectively connected to chip chip terminal CS, address strobe input terminal AS, read/write input terminal R/W and data Select DS.

P3.2 Connect the interrupt request output IRQ to handle the alarm interrupt. The clock interface circuit is shown in Figure 5.

Multifunctional LED table lamp design

Figure 5 clock system circuit diagram

1.4 Liquid crystal display system

The display system uses a 1602 character LCD. The liquid crystal can display two lines, each line displays 16 characters; and the volume is small, the energy consumption is low, and the operation is simple; the display requirements of the numbers, English letters and special symbols required for the design are suitable. The first line of the year, month, day and week is displayed by the MCU control 1602 liquid crystal display, and the second line of hours, minutes, seconds and ambient temperature are displayed.

The system 1602 liquid crystal adopts parallel operation mode. P0.0~P0.7 is connected to its data port DB0~DB7 by means of 10K pull-up resistor. P0 port is also connected to the data address port of DS12C887. Because the chip select signals are different, Operating the corresponding chip when selected will not cause an operation conflict. P2.5~P2.6 are connected to the enable terminal E of the 1602 liquid crystal, the read/write selection terminal RW, and the data/command selection terminal RS. The third pin is the liquid crystal display contrast adjustment terminal, which is grounded through a 10K sliding varistor for Adjust the display brightness of the LCD. The 15th pin backlight positive BLA is grounded through a 10 ohm resistor, and the 16th pin backlight negative BLK is grounded. The liquid crystal interface circuit is shown in Figure 6.

Multifunctional LED table lamp design

Figure 6 LCD system circuit diagram

1.5 Temperature detection system

The temperature detection system uses DALLAS's "one-line bus" interface digital temperature sensor DS18B20, which has the advantages of miniaturization, low power consumption, high performance, etc. It can directly convert temperature into serial digital signal processing, and the temperature range is -55. ~125 ° C, the highest resolution can reach 0.0625 ° C. The DS18B20 has three pin power supply positive VCC, power supply negative GND and signal input and output port DQ.R3 is a 4.7K pull-up resistor, which is used to ensure that the microcontroller and the DS18B20 communicate with each other at high and low levels and are accurately recognized by the MCU and DS18B20. The P3.0 port of the MCU is connected to the DQ port through R3 to realize the temperature data acquisition and processing, and is displayed in real time through the LCD screen. The temperature detection circuit is shown in Figure 7.

Multifunctional LED table lamp design

Figure 7 temperature detection circuit diagram

1.6 beep system

The buzzer system is used to generate an alarm sound and a button tone. The PNP transistor 9012 is controlled by the MCU P2.4 port to realize the buzzer sound control; the delay function is used to realize the long and short sound control of the buzzer alarm sound, the long sound 'drip' is used for the alarm ringtone, and the short sound 'drip' is used. At the button prompt tone. The buzzer system circuit is shown in Figure 8.

Multifunctional LED table lamp design

Figure 8 buzzer system circuit

Shareconn development Co.,Ltd assemble high quality RF extension cables, such as BNC cables, SMA cables, MCX cables, Farkra cables, SMB cables and so on.

RF Cable Assembly 

Accommodates a wide range of medium to miniature sized RG coaxial cables in a rugged . Medium size design.Provides customer flexibility in their design and manufacturing with a durable connector. Available in many styles: Plugs (Straight and Right Angle) and Jacks (Panel Mount , Bulkhead Mount ). Meets many customer application demands. 

RF Extension Cable Assembly

RF Extension Cable Assembly,RF Extension Coaxial Cable,RF Coaxial Cable,RF Aerial Cable Extension

Shareconn Development CO.,LTD , http://www.share-conn.com

Posted on