Design of a Microcontroller-Based Automotive Electronic Ignition System
2026-04-06 05:15:56··#1
Design of a Microcontroller-Based Automotive Electronic Ignition System With the continuous development of the automotive industry, the energy crisis and the pollution of the atmospheric environment caused by vehicle exhaust are becoming increasingly serious. Precise control of engine ignition timing can effectively alleviate this situation while improving the overall performance of the vehicle. Compared with traditional mechanically adjustable ignition timing control systems, microcontroller-based electronic control systems have advantages such as good timeliness, high accuracy, and flexible control. Therefore, starting from the control strategy of the engine ignition control system, a new type of electronic ignition control device that can improve the accuracy of engine ignition control is designed. 1 System Working Principle Engine ignition timing is achieved by controlling the ignition advance angle (i.e., the angle through which the crankshaft rotates from the piston position to top dead center at ignition). Factors affecting spark plug ignition timing mainly include engine speed, load, engine coolant temperature, and engine knock. The entire ignition system hardware circuit mainly consists of sensors and signal conditioning circuits, A/D converters, electronic control units, ignition circuits, power supplies, and spark plugs. The system principle block diagram is shown in Figure 1. The output signals of each sensor are conditioned by the corresponding conditioning circuit and converted by the A/D converter before being sent to the microcontroller. The microcontroller processes the input signals according to a certain control strategy and algorithm, and outputs a control signal at an appropriate time based on the calculation result. After the control signal passes through the drive circuit, it controls the ignition control circuit to work, and finally realizes engine ignition through the spark plug. 2 System Hardware Design 2.1 Sensors and their conditioning circuits mainly include speed sensors, coolant temperature sensors, knock sensors, and throttle opening sensors and their corresponding conditioning circuits. 2.1.1 Speed sensor and its conditioning circuit adopts a photoelectric speed sensor, which measures the engine speed and crankshaft angle position. The sensor output signal is shaped and amplified by the conditioning circuit and then sent to the microcontroller's external counter T0 (P3.4) pin. The microcontroller counts it within a certain time to measure its speed and crankshaft position. 2.1.2 Coolant temperature sensor and its conditioning circuit adopts the integrated temperature sensor MAX6611 to measure the engine coolant temperature. The microcontroller adjusts the ignition advance angle based on the water temperature signal: increasing the ignition advance angle when the water temperature is low and decreasing it when the water temperature is high. The sensor output signal is connected to channel 0 of the ADC0809 after being conditioned by a diode bidirectional limiting and RC filter circuit. 2.1.3 Knock Sensor and its Conditioning Circuit: A piezoelectric accelerometer mounted on the engine block is used to measure the engine knock signal, and the ignition advance angle is adjusted accordingly based on whether knock occurs. The sensor output signal is connected to channel 1 of the ADC0809 after being conditioned by a two-stage filter circuit. 2.1.4 Throttle Opening Sensor Conditioning Circuit: The engine load is measured by a linear output analog throttle sensor (TPS). The sensor output signal is connected to channel 2 of the ADC0809 after being conditioned by a bidirectional limiting and filtering circuit. 2.2 Electronic Control Unit and A/D Conversion Circuit Design: This system uses the AT89C2051 microcontroller as the controller. The A/D converter uses ADC0809 to perform analog-to-digital conversion on the front-end input signals. The signals requiring A/D conversion in the system include water temperature, throttle opening, and knock signals. The interface circuit between the microcontroller and the A/D converter is shown in Figure 2. The conversion channels are selected by ADDA, ADDB, and ADDC: channel 0 inputs the temperature signal, channel 1 inputs the knock signal, and channel 2 inputs the throttle opening signal. The converted signals are input to the microcontroller through port P1. P3.4 (T0) of the AT89C2051 counts the crankshaft speed signal to determine the speed and crankshaft position. The ignition control signal is output through P3.5. 2.3 Ignition Control Circuit Design The function of the ignition circuit is to generate the high voltage required for spark plug ignition. Its input is the ignition control signal from the microcontroller's P3.5 pin, and its output is connected to the spark plug. The circuit is shown in Figure 3. When the microcontroller's P3.5 outputs a high level, both T1 and T2 are cut off, and the 12V voltage charges C7 through R4 and L1. When the microcontroller's P3.5 outputs a low level (issuing an ignition control signal), T1 and T2 conduct, and the voltage across C7 immediately changes to a low level (i.e., C7 discharges rapidly), causing a sudden change in the current flowing through L1, generating an ignition high voltage across L2. D1 protects T2. 2.4 Power Supply Circuit Design Automotive systems generally only provide 12V DC voltage, while most chips require 5V. This system uses the integrated chip W78L05 to design a 12V to 5V DC-DC conversion circuit. 3 System Software Design The system software mainly consists of a main program and delay subroutines, a subroutine for calculating the basic ignition advance angle, a T0 interrupt service subroutine, an A/D conversion subroutine, an ignition advance angle correction subroutine, and an ignition subroutine. The source code for this system is written in assembly language. 3.1 After the main program system is powered on, it first performs system initialization (including initialization of the microcontroller, ADC0809, and counter T0), then acquires the speed signal to determine the basic ignition advance angle, then performs A/D conversion to acquire water temperature, knock, and throttle opening signals, processes the acquired signals, and finally waits for the ignition timing and sends an ignition control signal to achieve system ignition. 3.2 Subroutine for calculating the basic ignition advance angle The basic ignition advance angle of this system is determined by the speed signal and is determined by a lookup table method. First, two data tables are established: one is the speed table v (v[0], v[1], v[2], ..., v, v[i+1], ...) and the other is the basic ignition advance angle table. The number of elements in the two tables is equal and they are both sorted in ascending order. The basic ignition advance corresponding to Vi is the i-th element in the basic ignition advance angle table. In order to reduce the number of searches, a binary search method is used to search the speed table. 3.3 Subroutine for Water Temperature Correction of Ignition Advance Angle The water temperature performs dual corrections for the ignition advance angle: warm-up correction and overheat correction. When the water tank temperature is too low, the ignition advance angle should be increased, i.e., warm-up correction. When the engine water tank temperature is too high, the ignition advance angle should be decreased, i.e., overheat correction. In this design, the water temperature correction for ignition advance angle also uses a lookup table method, establishing two correction tables: an overheat correction table (ascending order) and a warm-up correction table (descending order). Based on experience, the maximum correction for the water temperature to the ignition advance angle is 5°, using a direct lookup method. First, determine the water temperature T for zero correction of the ignition advance angle. If the measured water temperature t is greater than T, look up the overheat correction table for overheat correction; otherwise, look up the warm-up correction table for warm-up correction. 3.4 Subroutine for Knock Signal Correction of Ignition Advance Angle The system corrects the ignition advance angle to keep the engine close to the knock critical state, i.e., in a "critical control" mode, so that the engine is close to the knock zone but does not enter the knock zone, at which point the thermal efficiency of in-cylinder combustion is highest. When a knock signal is detected, the ignition advance angle increases by 2°; when no knock signal is detected, the ignition advance angle decreases by 2°. Let F be the knock signal corresponding to the critical state. When the measured knock signal f is greater than F, the ignition advance angle decreases by 2°; otherwise, the ignition advance angle increases by 2°. Furthermore, the throttle opening correction subroutine for the ignition advance angle uses a direct lookup table method. 4. Conclusion This ignition system has advantages such as high timeliness and high control accuracy, achieving optimized control of the ignition advance angle. The system has been successfully debugged. Editor: He Shiping