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.
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.
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.
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:
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.
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
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- I want to use POE to power some gadgets, but I don’t know what power chip to use?
- How to avoid float or double precision errors?
- STM8L152 drives LCD experimental ultra-low power consumption code 7.2UA
- Microchip vs. ZiLog 8-bit MCU litigation: Who will win?
- ZK wireless 4G communication-IO controller transmits data
- Digi-Key KOL video is coming~Take you into the wonderful world of MicroPython
- Not running problem
- 5G and IoT will be the great equalizer
- Some experience and routines of using MSP430FR2000
- Modification method of pointer type meter