Design of a vehicle lighting control system based on LIN bus
2026-04-06 04:48:06··#1
CAN bus-based automotive body control has been widely adopted. However, with the increase in onboard bus nodes and the trend of extending electronic technology to mid-to-low-end vehicles, its relatively high implementation cost has become an obstacle. The lower-cost LIN bus has emerged to address this. LIN bus hardware implementation is based on a standard serial communication interface (SCI), and can even be simulated using ordinary I/O ports and timers in sub-nodes. LIN is targeted at low-end systems that do not require the performance, bandwidth, and complexity of CAN, such as communication between sensors and actuators in door control modules, seat adjustments, headlight control, and air conditioning systems. Typically, LIN sub-buses are extensions of existing CAN networks, forming the vehicle's control network together. Of course, due to its lower cost, it can also be used independently in less complex body control networks. Headlight control systems do not have high real-time requirements, but the headlight control module connects to many sensors and actuators, making the LIN bus very suitable for controlling this system. LIN bus-based headlight control systems use the LIN bus to achieve communication between headlight sensors and controllers, offering advantages such as simple hardware circuitry, clear control hierarchy, and low node cost. Structure and Control of Vehicle Lighting Systems Currently, most automotive lighting systems are manually controlled. A potential problem is that at night, when two vehicles meet, the car with weaker headlights may flash theirs at the car with stronger headlights, while the car with stronger headlights may not flash theirs, causing glare and potentially leading to accidents. During the day, when driving through underpasses or tunnels, drivers sometimes forget to turn off their headlights due to the darkness. To address this issue, automatic lighting control systems have emerged, such as the Toyota Crown's automatic lighting system and the BMW 530i's automatic headlight system. These systems achieve fully intelligent control, are highly responsive, and reliable, effectively preventing accidents caused by manual operation of vehicle lights. A typical automotive automatic lighting system consists of three main parts: a photosensor, an electronic controller, and a selector switch. The photosensor is mounted on the dashboard, allowing light to pass through the windshield. The resistance of the photoresistor within the photosensor changes with the intensity of the light. The controller is installed inside the dashboard and controls the operation of each lighting circuit through relays and transistor amplifier circuits. A selector switch is also located on the dashboard, allowing selection of automatic or manual mode control of the lighting system. Based on practical application requirements, the following lighting control strategy is implemented: During the day, all lights should be off; at dusk, due to dim outdoor light, taillights and parking lights should be on; at night, due to even weaker outdoor light, high beams should be on and parking lights should be off; when two vehicles meet, to avoid dazzling oncoming drivers, low beams should be on, while taillights remain on; after passing, low beams should be off and high beams on; in night mode, when turning left, high beams should be off and low beams and left-side lights should be on; after turning left, low beams and left-side lights should be off and high beams on; the control method is similar for right turns. To implement this lighting control strategy, this design adopts the automotive lighting control system network topology shown in Figure 1. This network structure consists of one master node and four slave nodes (representing the left front headlight, right front headlight, left rear headlight, and right rear headlight). The master node receives signals from sensors and the CAN bus, processes them, and sends different message frame headers to control the status of the slave node's headlights in various modes or combinations, including daytime, evening, nighttime, oncoming traffic, left turn, and right turn. Slave nodes 1 and 2 include high beam headlights, low beam headlights, and turn signals; slave nodes 3 and 4 include taillights and parking lights. Furthermore, if a slave node does not respond to a message frame sent by the master node, an error indicator light on the master node illuminates, indicating which slave node has failed. LIN Bus Introduction: The LIN bus is a low-cost serial communication network used to implement distributed electronic system control in automobiles. LIN communication is based on the SCI (UART) data format, uses only a single 12V signal bus, and has a maximum communication rate of 20Kbps. Typically, a LIN network has fewer than 12 nodes and a bus length of no more than 40m. The LIN bus employs a single-master, multi-slave communication mode. The master node has one master transmit task and one slave communication task. Each slave node has only one slave communication task, which is divided into a transmit task and a receive task. Communication on a LIN network is always initiated by the master transmit task. The master node sends a message header, which consists of a synchronization interval field, a synchronization field, and a message identifier field. Correspondingly, after receiving and filtering the message identifier, a slave task is activated and begins the acknowledgment transmission for its current message frame. As an auxiliary bus, the LIN bus can significantly reduce costs in situations where the high performance of the CAN bus is not required. Freescale Semiconductor's LIN development platform (LIN DEMO) system provides complete software and hardware, allowing users to quickly build a LIN control network. The software portion includes standard LIN low-level driver software. This design utilizes the standard LIN low-level driver in the Freescale LIN API to implement a vehicle lighting control system on the MC68HC908GZ60 chip. The Freescale LIN API provides many functions related to LIN bus communication, which can be used to easily implement LIN communication. System Hardware Design The automotive lighting control system requires the lights to respond promptly when the user presses an operation button; simultaneously, the user should receive corresponding fault information when a light malfunctions. This control system does not have very strict real-time requirements and operates on a low-speed automotive communication network. Therefore, using a LIN bus with a maximum transmission rate of 20Kbps for light control is suitable as it meets the control requirements while reducing costs. The MC68HC908GZ60 chip (48 pins) has one ESCI channel, two timer channels, one CAN channel, and 15 AD conversion channels. LIN communication only uses the chip's ESCI interface for connection to the LIN transceiver; one timer channel is used to determine timing in LIN communication; many other functions and channels can be used for other applications. The MC33399, a single-wire physical interface device for the LIN bus, is selected as the LIN transceiver. The LIN network structure is shown in Figure 2. The MC33399 transceiver supports transmission rates of 1–20Kbps and provides normal and sleep modes. The INH pin is connected to the INH pin of the power management chip, controlling the operating mode of the power supply voltage regulator and reducing power consumption during sleep. The EN pin is controlled by the PTE2 pin of the GZ60. When PTE2=1, the MC33399 is enabled and enters the working mode; when PTE2=0, the MC33399 is disabled and enters sleep mode, thereby reducing power consumption. The Tx and Rx pins are connected to the PTE0 and PTE1 pins of the GZ60 respectively, implementing the LIN bus transmission and reception functions through the ESCI module of the ECU. Since a wake-up mode is not used, the Wake pin is grounded through resistor R4. Only the LIN pin of the master node needs to be pulled high through a diode and a 1kΩ resistor. The 30kΩ pull-up resistor required by the slave node is integrated into the MC33399, so the slave node does not need an external pull-up resistor, as shown in Figure 3. Since LIN is a single-wire transmission protocol, the data transmitted on the bus requires a common ground. Therefore, when connecting the nodes, it is necessary to ensure the common ground of the level of each node to enable normal and reliable communication of the bus. The master node in the vehicle lighting control system is also the CANLIN gateway, responsible for transmitting LIN bus data to the CAN bus. One CAN channel of the GZ60 is used to provide the interface with the CAN bus. The CAN bus transceiver used is the Freescale MC33388. This transceiver supports a maximum CAN rate of 125Kbps and has very low power consumption in sleep mode. The hardware circuit of the CAN module is shown in Figure 4. System Software Structure The software structure of the LIN bus-based vehicle lighting control system is shown in Figure 5. After power-on, each node controller initializes the CONFIG, PORT, and ESCI modules. Since the timing of LIN bus communication is defined by the master node, the master node controller also needs to initialize the T1CH0 module. The master node controller monitors the status of each button. When a button is pressed, the master node determines the corresponding vehicle lighting control mode and then sends a message header with the corresponding identifier field (ID∈[10 11 12 13)) to the LIN bus, initiating a LIN bus communication from the master node to the slave node to send data. After waiting for the LIN bus to process the message frame, the master node initiates a LIN bus communication (ID ∈ [14 15 16 17)) to send data from the slave node to the master node. This slave node is the one that received the master node's command in the previous LIN bus communication. If the data received by the master node from the slave node does not match the data it should theoretically receive, the error indicator light on the master node illuminates, and the number of the faulty slave node can be displayed. The cause of the slave node failure may be that the slave node disconnects from the LIN bus, or that the actuator on the slave node malfunctions. Application Results Application results show that the LIN bus effectively meets the data transmission requirements of the automotive lighting control system. Compared with other implementation methods, it has the advantages of simple structure, flexible configuration, and reduced cost, fully meeting the expected performance and price requirements.