Design of automobile taillight controller based on single chip microcomputer

Publisher:DataExplorerLatest update time:2014-02-14 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  With the continuous progress of modern society, people are increasingly inseparable from cars. However, with the rapid increase in the number of cars, road safety has attracted more and more attention. It is now recognized that it is unrealistic to rely solely on the structural factors of the car itself to ensure driving safety. Therefore, it is necessary to strengthen the main parts of the vehicle that involve safety, conduct regular inspections, and assess their technical conditions according to certain technical standards. Through the data obtained from various test benches with a certain degree of accuracy, the technical conditions of the vehicle safety devices can be scientifically and quantitatively judged and appropriate evaluations can be given. The failure rate of car headlights is relatively high during the driving process of the car. When the headlights fail, they cannot correctly reflect the driving awareness of the car driver and bury the hidden dangers of accidents for safe driving.

  With the widespread application of electronic systems in automotive products, the automation of the control system has been greatly guaranteed. In addition, as the shape of automobiles becomes more streamlined, the taillights of automobiles play a great role in the perfect embodiment of the overall shape of the automobile. The proportion of taillight control systems in automobile finished products has gradually increased.

  Taillights are the best embodiment of a car brand. Different taillight shapes, installation positions on the car, and relative positions of different signal functions are all effective means to make a car unique. At the same time, for the car as a whole, after the taillights are installed, they must be integrated with the car body and have overall coordination when lit or not. Domestic products in the field of car taillight control technology are mainly car taillights with dynamic graphic displays.

  The subject of this paper is the circuit design of the car taillight controller. The car taillight control system is designed based on the AT89S52 chip produced by Intel. In this system, 8 LEDs are used to display the basic working conditions of the car taillights. The research and development of the car taillight control system not only greatly improves the advancement of the car, but more importantly, reduces the possibility of traffic accidents.

  Hardware design and working principle

  The hardware of the system mainly includes the following three modules: logic switch controller, AT89S52 single-chip computer system, LED light array, etc., thus forming three modules: signal recognition circuit, controller and light-emitting circuit. Among them, the single-chip computer system (microcontroller) is the central processing unit. According to the switch control signal executed by the driver detected by the logic switch controller, the corresponding signal is transmitted so that the single-chip computer system receives the instruction, and then the LED light array issues the corresponding instruction. The overall design of the system is shown in Figure 1.

  Design of automobile taillight controller based on single chip microcomputer

  Figure 1 System overall design

  in:

  1) The logic switch controller consists of five switches, namely left turn, right turn, check, night driving, reset, etc.

  2) The single-chip microcomputer system is a 40-pin AT89S52 chip, of which 19 pins are used.

  3) The light arrays from left to right are L4L3L2L1R1R2R3R4, where R1R2R3 represents the three indicator lights on the right, L1L2L3 represents the three indicator lights on the left, and R4L4 represents the long-lasting lights when driving at night.

  The control functions of the automobile taillight control system designed this time include left turn, right turn, brake check, night driving, etc. It is mainly to simulate the actual automobile taillight control circuit, so as to achieve high reliability, good practicality and strong universality. The hardware circuit of the studied scheme is simple and can be widely used in various motor vehicles. The system circuit diagram is shown in Figure 2.

  Design of automobile taillight controller based on single chip microcomputer

  Figure 2 System circuit

  The working principle of the system is: after the left turn switch is triggered, the microcontroller receives the signal and processes it, at which time L1L2L3 lights up in a left cycle; similarly, when the right turn switch is triggered, R1R2R3 lights up in a right cycle; when the check switch is triggered, L3L2L1R1R2R3 flashes at the same time; when the reset switch is triggered, the left turn, right turn and check states are all cleared, that is, L3L2L1R1R2R3 do not work; when the night driving switch is closed, R4L4 lights up for a long time, and the other four states can also be performed. (Note: D1D2D3D7 are L1L2L3L4 respectively, and D4D5D6D8 are R1R2R3Rt4 respectively).

  Software Design

  After analyzing the working principle of the taillight control system in Figure 1 above, the software designed in this paper is mainly composed of modules such as the main program, keyboard scanning subroutine, delay subroutine, etc., and is written in C51 language.

  As shown in Figure 2, the microcontroller uses AT89S52, and its pins P1.0~P1.2 and P1.5~P1.7 and P2.0 and P2.1 are used for LED light output control, and P3.0~P3.4 are used for flashing mode control switches, with a current limiting resistor of 220, a light emitting diode current of about 10 mA, and a 12 MHz crystal oscillator. [page]

  1 Main Program

  The main program mainly completes hardware initialization, subroutine calling and LED display functions. The main program flow chart is shown in Figure 3.

  Design of automobile taillight controller based on single chip microcomputer

  Figure 3 Main program flow

  2Keyboard subroutine

  This part mainly realizes the input of parameters. It includes three parts: keyboard scanning subroutine, pin parameter setting and keyboard debounce subroutine. The working mode is to first determine the key state of P3.4 port, then determine whether a key is pressed by scanning P3.O~P3.3 ports, and then mark the corresponding position 1 of the lower 4 bits of the 20H memory unit to determine the flashing function to be executed. When 20H.0 is 1, the light-emitting tube lights up in a left cycle; when 20H.1 is 1, the light-emitting tube lights up in a right cycle; when 20H.2 is 1, the light-emitting tube flashes at the same time; when 20H.3 is 1, the light-emitting tube of P1 port stops working and scans P3.O~P3.2 ports. When power-on initialization, set 1 to 20H.3 position, the circuit does not work at this time, and the system will enter the scanning key state.

  3 Delay subroutine

  This part mainly realizes the duration of LED flashing. There are two delay subroutines, 10 ms and 1s, which are used for key scanning debounce and LED flashing delay.

  4 flash control program.

  The flash control program is used to control the light-emitting diodes of P1.0~P1.2 and P1.5~P1.7 in P1 port, and P2.0 and P2.1 in P2 port. Among them:

  ① When executing function program 0 (FUN0), the output values ​​of P1.O~P1.2 ports in P1 port change to 100→delay→110→delay→111→delay→00O delay→end and transfer to main program.

  ② When executing function program I (FUNl), the output values ​​of P1.5~P1.7 ports in P1 port change to 001→delay→011→delay→111→delay→000→delay→end and transfer to main program.

  ③ When executing function program 2 (FUN2), the output values ​​of P1.O~P1.2 and P1.5~P1.7 in P1 port change to 111111 → delay → 000000 → end and transfer to the main program.

  5 System Partial Program

  In this system, C51 language programming is used to realize the above control functions. The key program and flashing part program are designed as follows:

  Design of automobile taillight controller based on single chip microcomputer

  Conclusion

  The automobile taillight control system designed in this paper can reduce the hidden dangers of traffic accidents and increase the service life of the taillight circuit. The feasibility of the system design method has been proved through experimental simulation and debugging. The software system is combined with the hardware circuit for debugging, and four common automobile taillight states of left turn, right turn, braking and night driving are realized. The taillight control system has a simple structure, high reliability, easy operation, low cost, and can be widely used in common motor vehicles.

Reference address:Design of automobile taillight controller based on single chip microcomputer

Previous article:Design of vehicle virtual instrument data acquisition system based on CAN bus technology
Next article:Car remote anti-theft system solution based on STM32F103 microcontroller

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号