Design Of LED Lantern Controller Based On Single Chip Microcomputer!
- Nov 26, 2018 -

1、Introduction

With the continuous improvement and beautification of people's living environment, colored neon lights can be seen on many occasions. Led lanterns have been widely used because of their rich lighting color, low cost and simple control, and it has become a fashion to decorate streets and urban buildings with colored lights. But at present, most of the design of the LED lantern controller with the full hardware circuit to achieve, the circuit structure is complex, single function, so once the production of finished products can only be shiny according to the fixed mode, can not be based on different occasions, different time period needs to adjust the lighting time, mode, flashing frequency and other dynamic parameters. The structure of this kind of lantern controller often has some disadvantages, such as too much chip, complicated circuit and large power loss. In addition, from the functional effect, the lighting mode is less and the style is monotonous, lack of user maneuverability, affect the lighting effect.

Therefore, it is necessary to improve the existing lantern controller. In this paper, a color lamp control scheme based on AT89C51 single chip microcomputer is proposed to realize the control of LED lanterns. This scheme takes the AT89C51 single chip microcomputer as the main control core, and the keyboard, display, drive and other modules to form the core main control module. In the main control module with 8 keys and 5-bit seven-segment code LED display, according to user needs can write a number of lighting mode, the use of its internal timer T0 to achieve a basic unit time of 5 ms Timing interrupt, according to the different needs of a variety of lighting time, at different times to output light or lamp control signal, Then drive a variety of colors of light to light or extinguish. The new LED color lamp and its controller is a Shanghai company commissioned to develop products, product practical application effect is good, lighting mode is many, users can adjust the lighting frequency and lighting time according to different occasions and time. Compared with ordinary led lanterns, it has the advantages of small volume, low price and low energy consumption.


2、System Features

The new led lanterns are divided into 2 parts, namely, the Lantern Controller (master module) and the Tube LED Board module (controlled module). Color lamp controller can be directly connected with the City v AC City, after switching power supply transformation, output DC operating voltage, on the one hand for the Tube LED module to provide a V working power supply, on the other hand, the main control module single-chip microcomputer system (color lamp Controller) to provide 5 V working power supply.

The whole system works by the software program control operation, according to the need, the user can work in the LED color lamp through the main control module on the key to set the lighting time and light flashing frequency. After power on the system after initialization, query whether there is a function of switching keys pressed: There is, into the user set mode state; none, then go to the default default working state. In the user-set mode state, the user can specify which modes to call according to their hobbies and the needs of different occasions, and can change the time Ti and frequency fi parameters of each mode, if the user wants to enter the default state mode, simply click the function toggle key to jump into the default mode, the program will automatically call the lighting mode in order In the default working state, the LED lantern controller according to the program set a number of bright lights pattern program Model_i order call down, from the first model_1 mode to work, from Model_1 to model_2 ... To mod el_n for a bright light cycle, and then back to the Model_1 cycle to continue to work, the same if you want to enter the user set mode state, just press the function toggle key can be. The entire n light mode time can be regarded as a large period t, where each pattern of working mode Model_i (i=1,2,...,n) time is small period ti, for each mode to write a separate working subroutine Model_i, which sets the LED tri-color lamp (red, green, Blue) Light Moment (red_on,green_on,blue_on) and extinguishing moment (Red_off,green_off,blu E_off), as well as mode working time TI and the mode led blinking frequency fi. The first 2 bits of the 5-bit seven-segment code display (L1,L2) show the serial number of the current operating mode model_i; the latter 3 bits (L3,L4,L5) seven yards show the working status of the tri-color led, and if the color light is lit, the corresponding seven code display bit is "1", and then the display bit is "extinguished" when extinguished,


It plays a good real-time monitoring effect on the working state of the system. Therefore, after the LED lights on the work, users can easily through the main control module on the display to know the current working mode of LED Lanterns model_i, working time ti, frequency fi and other real-time parameters. If the actual application needs to be based on different occasions and time to change the shiny effect of lanterns, users can use the main control module on the key to set the LED different flashing frequency fi and lighting time ti, in order to meet the actual needs. In addition, if the user is interested in a pattern that requires careful viewing of the lighting mode, you can select any of the model_i modes through the keyboard so that the system loops and repeats the work in this pattern mode


3、Hardware design

The new LED lantern system includes 2 most, that is, LED Lantern controller (89c51 main control module) and led lantern tube (tube LED Board module).

The former is the main control module, with keys, display and other functions, and the use of 89C51 p port output control signal, the latter is a controlled module, welded with three-color LED lights and signal-driven chip, the module placed in the LED transparent lamp tube. The main control module circuit is shown in Figure 1. The main design components of the main control module are 89c51,5 seven-segment code LED display, 8 keys, 2 voltage regulator (providing a v,5 V voltage), 1 signal Output drive module chip (MC4049) and so on.

Through the software design, the single-chip computer P0 Port as a three-color LED drive signal output port and shift clock clock signal, P3 port for the key input port, P2 port, P1 port and 5-bit seven-segment code led connected as the output of the display. The LED Board module circuit in the tube is shown in Figure 2. Tube LED Board Module Design main devices have LED lights (red, green, blue), shift trigger module chip CD4076 and so on. According to the actual application of color lamp length needs, can be different quantities of the Tube LED module to achieve a cascade, composed of a complete led lantern. Considering the power loss, the interface between the LED board modules is connected with the signal forward drive module Chip MC4049. Each LED board module evenly distributes 3 kinds of color LED lights, in the actual production of PCB using red, green, blue 3 color Mutual welding method, on the circuit board of the LED luminescent pipe in order L1 (red), L2 (green), L3 (blue), L4 (red), L5 (green), L6 (blue) ... Weld evenly into a straight line on the plate in turn. In order to get more pattern mode effect, you can make the red and green 2 kinds of lights in front of the rear drive light flashing, blue lights from the back of the drive light flashing, so that has a good dynamic visual effect.


4、Software Design

The biggest feature of the new LED lantern controller is that all bright light modes are controlled by software. The software in the system can be divided into main program and interrupt service subroutine. After power-on in the default state in order to call the Model_i pattern Lighting mode flow as the main program, with a unit time of 5 Ms T0 timed for the interrupt service subroutine. On the basis of this 5 Ms T0 timing, the various modes of working time TI can be determined as needed, as well as the moment to determine the lighting and extinguishing of various color LED lights in various lighting modes mode l_i: Red_on,red_off,green_on,green_off,blue_ On,blue_off and lock (Shift flip pulse) and so on. The entire system software consists of the main program (main), each mode subroutine (model_i), 5 ms Interrupt Service subroutine (T0 Interrupt), keyboard scanning processing subroutine (Key board), display subroutine and other programs. Using T0 Timer as the basic unit of timing, according to the mode needs to calculate the occurrence time of each control signal, according to different modes Mo Del_i can set different working time TI and pulse Flip frequency fi through the P0 port output, so that the driving moment of the various L ED lamp and shift trigger flip moment in step,


Make led lanterns work according to the design mode. In addition to the T0 timing interrupt, most of the time of the program is in processing the keys of the query and LED display delay. 8 keys are: 4 parameter keys (FI increase, subtraction button, ti increase, minus button), 3 mode change keys (mode flip up, mode flip down, mode to keep keep), 1 function toggle keys. In each T0 timed interrupt service subroutine, it is necessary to add 1 or clear to each time register and mode register, to prepare for the program query, and whether the query has been interrupted 6 times (ms), if the MS is arrived, the parameter key is queried once,

Whether there is time Ti frequency fi increase or decrease key press and the corresponding subroutine processing. The main program in addition to calling a variety of child-mode subroutine (Model_i), calling LED Display sub-program (display) and Delay subroutine (Delay), but also keep the query whether there is a function of cutting key press and whether there is a mode change button press, once there is a function toggle key and Mode change key press, will go into the appropriate keystroke processing. The main program flow is shown in Figure 3. Lighting Mode subroutine Model_i can write several (n kinds), as long as the control of a variety of lights trigger and off the moment can be combined into various lighting effects.


5、Conclusion

Compared with most of the LED lights on the market, this kind of lantern has better lighting decoration effect, higher cost performance, compared with ordinary full-hardware led lanterns have better economic benefits. The control signal output from the main control module is applied to control the work of the L Ed Board module in the lamp, which makes the product performance stable, and the installation is easy to operate. Because the control program is stored in the 89C51 microcontroller Flash flash memory EPROM, if the user needs to change the system's lighting mode model_i, do not need to change the system hardware circuit, just modify the program can be, is a very promising lantern controller.


Previous: No Information

Next: Low-voltage lamp use place

Remark:

.

SUBMIT

.