The LED guardrail lamp uses a fluorescent tube or LED as a light source, and uses a continuous guardrail as a carrier to form an approximately linear guardrail strip. This article mainly introduces the barrier light solution based on 16-channel constant current LED driver chip. The program is mainly composed of the following parts: (1) The main control circuit based on STC11F02 single-chip microcomputer, its main function is to generate SPI control signal; (2) LED drive circuit with LN0134 as the core, its main function utilizes its 16 Channel constant current to carry LED; (3) power input voltage conversion circuit, supply LED power circuit, which mainly completes functions such as circuit protection, chip power supply, and LED lamp power supply.
Introduction to major chip functions
LN0134 is a 16-channel constant current LED driver chip developed by Nanlin Electronics. The chip has a 16-bit CMOS shift register and an output latch. It can convert the input serial data into a parallel output format to control 16 An output current source that provides a constant and consistent current of 3 to 45 mA at each output to drive the LED. The output current can be adjusted by adjusting the size of the external resistor, so that the brightness of the LED can be easily controlled. The average current of all LEDs can also be adjusted by inputting a PWM signal at the enable (OE). It also supports the SPI communication protocol, making it easy to control the data of the communication, so it is one of the best ICs for driving LEDs.
STC11F02 is embedded with 2K FLASH program memory space and 256B SRAM memory area. The chip has advanced instruction set structure, is compatible with ordinary 8051 instruction set, has hardware multiplication and division instructions, and does not require programmers and emulators. Remote upgrade. This solution utilizes the advantages of its high-speed, low-cost, and streamlined I/O ports to simulate the SPI protocol to implement communication control for other ICs.
Guardrail light design
1) Hardware circuit design and principle
The basic principle of the scheme is: the one-chip computer simulates the SPI protocol, and sends the data to the LN0134 driver chip. The internal hardware circuit of LN0134 realizes the serialization of data, drives 16×3 LEDs, and then controls the LED lights by changing the data. Change, to achieve a combination of different LED lights, such as: water lamps, flashing, jumping, breathing and other effects. The circuit of this solution is completed under the hardware environment PADS. In order to save cost, the generated PCB files are also single-panel.
2) MCU control signal circuit
Figure 1 is a circuit diagram of the MCU control circuit. The control signals generated by the main control chip are: (1) SPI control signals, including: OE, SDIO, SCLK, LE four ports; (2) LED power supply enable signals, including: CONTROL1, CONTROL2 two ports.
MCU control circuit diagram
3) LN0134 application circuit
The LN0134 application circuit is shown in the figure. The LED driver chip receives the SPI signal sent by the single-chip microcomputer. Different SDIO data will get different data from OUT0 to OUT15, thus driving the LED to produce different changes. The LN0134 chip supports multi-chip cascading, connecting the SDI port of the next chip through the SDO end of the data port, and so on. The design of the long-distance guardrail light scheme can be completed by cascading one small unit. Setting the resistance of R30 can change the output current value, thus eliminating the trouble of multi-channel current limiting.
LN0134 application circuit diagram
4) Power supply circuit
The power supply circuit is shown in the figure. This circuit supports an input voltage of 12V to 15V, and the rectifier bridge can avoid the connection of the positive and negative poles. After IC1 can get 5V supply voltage, it provides power for MCU and LN0134 chip; IC2~IC6 can complete the supply of LED lamp group, and CONTROL1 and CONTROL2 port provided by MCU control the off and on of POVER1 and POVER2. .
Power supply circuit diagram
5) Software design
Software design is the meridian of the whole solution, which directly determines the operation quality and efficiency of the whole solution, and at the same time reflects the function and reliability of the solution. The on-chip program of the STC11F02 chip is written in the software development environment Keil uVision2. The program focuses on the analog SPI communication protocol. The timing waveform of the theoretical design is shown in the figure. The software code is realized by C language, and the SPI waveform simulated by the single-chip microcomputer is observed by the oscilloscope as shown in Fig. 5. Among them, Tek1 is SDI; TeK2 is CLK; TeK3 is LE; TeK4 is OE, which meets design requirements.
SPI timing diagram
SPI waveform
First, the SPI simulation program is modularized, mainly for the convenience of calling; the most change in the whole process is the data in the buffer, the data changes, the corresponding display effect will change; continuous data changes produce different lighting, this It also shows the colorful and dazzling features of the guardrail lights.
Summary of this article
The design of the guardrail lamp is a 1-meter-long unit module. The longer guardrail distance needs to cascade these small units to improve the driving ability of the control signal. The 16-channel LN0134 chip is selected to increase the number of LED lamps. According to the performance parameters of the chip, changing the power supply circuit can better expand the application circuit and drive more LED lamps. The STC11F02 chip was chosen to save cost and simplify the main control unit.
Wonke Electric CO.,Ltd. , https://www.wkdq-electric.com