Design of infrared remote control transmitter and receiver in automobile

Publisher:cloudsousou6Latest update time:2010-04-16 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Infrared remote control is the most widely used communication and remote control method. Infrared remote control has the characteristics of small size, low power consumption, strong function and low cost. Therefore, color TV, video recorder, audio equipment, air conditioner, toy, doorbell and other small devices such as remote control car road sign also use infrared remote control. In order to change the defect that the front road sign indicator light (hereinafter referred to as the car number device) on the current car cannot be changed flexibly, infrared remote control is used in it, so that it can easily achieve the purpose of long-distance and non-contact one-time change of the car number, thus changing the old mode of manual flipping of the car number.

1. Infrared remote control system of car number device

The car number device on the car was originally controlled by a simple LED digital tube, which was inconvenient to use. In order to control it from a distance, an infrared remote control was used. Usually, the infrared remote control system consists of two parts: the transmitter and the receiver. The control operation is performed using a dedicated integrated circuit chip for the encoding/decoding circuit. As shown in Figure 1, the transmitting part includes a keyboard matrix, encoding modulation, and an infrared transmitter. The receiving part includes a photoelectric conversion amplifier, a demodulation, and a decoding circuit. Each infrared transmission is a key value, that is, a hexadecimal data. In order to send a group of data at a time (such as the train number, usually a three-digit decimal number), we can use the software encoding/decoding method of 89C2051. First, enter a group of car numbers at one time, and press the send key to send all of them. At the same time, when receiving, use the continuous receiving method to decode all the data at one time.

2. Remote control transmitter and its coding

There are many dedicated chips for remote control transmitters, but the 89C2051 chip is used in the remote control of car number devices. Use the P1 port to form a matrix scan feedback to obtain the key value, use the internal timer 1 to generate a 38K software timer interrupt, drive P1.0 to generate a 38K square wave, and use it as the modulation base wave of infrared light. The data to be sent is sent directly to the serial port sending end of TXD in serial mode with a baud rate of 1200 and parity check. Then TXD and P1.0 are logically ANDed, and after 40106 shaping, the infrared transmitting tube is driven by a transistor to be directly sent. The schematic diagram is as follows:

3. Infrared remote control receiver and its display

The receiver part is mainly composed of CX20106 and 89C2051, display drivers 4094, 2803, data storage and watchdog 25045. The decoding chip CX20106 is used to filter the 38K carrier to obtain a set of waveforms, that is, the serial port data with a baud rate of 1200 is directly sent to the RXD of 89C2051 for reception. The serial port is read by software, the input buffer is obtained, and a set of data is stored in the non-volatile EEPROM25045 after correct judgment. At the same time, the data is directly sent to 4094 by pulse shifting, and displayed after being driven by 2803. At the same time, the watchdog timing of 25045 is used to ensure that it can return correctly without causing erroneous reception in the case of program out of control. Since the serial port transmission has parity check and start/stop check, the reliability of data can be greatly improved. At the same time, the data group is also added with cumulative sum check, which further improves the reliability. Therefore, in practical applications, even in harsh environments such as open air, direct sunlight, and strong light, it can be guaranteed that data will not be received by mistake and display errors will not be caused. The principle diagram is as follows:

4. Software Programming

The software of the single-chip microcomputer 89C2051 includes three parts: the main program, the serial port interrupt service program and the timer interrupt service program. The corresponding working units and flags are established in the internal RAM area of ​​the 2051 single-chip microcomputer.

(I) Sending program: SEND-BUFO∽SEND-BUF3 is a four-character sending buffer, and SEND-MARK is a request to send mark. When the keyboard scans a sending request, the timer is started, a 38K square wave is output at P1.0, and the serial port is started at the same time, and the data in SEND-BUFO to SEND-BUF3 is sent to SBUF, synthesized and sent. The program flow is as follows:

Sending main program: When initializing, set the timer, watchdog and serial port, clear the display, and then scan the keyboard. If a key is pressed, perform key processing; if it is a send key, set the serial port send flag, start the timer and serial send program, and then return to the display program in the main program to send the display data to the buffer.

Serial port interrupt program: field protection, take the sending data to the sending buffer, start the software timing to generate a 38K square wave, and then judge whether the data has been sent. If it is finished, clear the sending flag. Otherwise, return to continue sending data.

Timing interrupt program: the scene protection backfills the timing length, starts the counting timing, and inverts the designated pin P1.0, turns it into an inverted level, and returns.

(ii) Receiving program: REC-BUFO∽REC-BUF4 is a four-character receiving buffer, and REC-MARK is a sign that the data is received completely. When a serial port interrupt occurs, the data is received in order to REC-BUF0 to REC-BUF3. When the data is full, the cumulative sum is calculated. If correct, set the REC-MARK flag; otherwise, clear the buffer data. If the main program determines that there is a REC-MARK flag, the data will be processed and sent to the external memory 25045 and displayed in the display buffer. At the same time, because the reception is carried out in the car, there are many power supply voltages and other interferences, including possible serial port misjudgments. Therefore, in order to ensure the normal operation of the program, the watchdog circuit in 25045 is started to refresh every 500ms. The program flow is as follows:

Receiving main program: during initialization, set the timer, watchdog, clear display and external memory 25045 to determine whether there is a data reception flag. If data judgment is performed, it is correctly written to the data external memory and sent to the display area for display. Otherwise, return to the display program of the main program and refresh the watchdog.

Serial port interrupt receiving program: After the field protection, determine whether the received data is the head or tail data, and store it in the cache if it is normal data, and add one to the pointer. When a complete set of data is received normally, set the received data flag and return.

The timed interrupt procedure is the same as sending, except that the watchdog is refreshed periodically.

V. Conclusion

The above method realizes the reception and decoding of infrared remote control signals very simply, which greatly saves the resource overhead of hardware implementation. The design of the infrared remote control system has been applied to buses, improving the service quality of the bus system and improving the work efficiency.

References:

1. Li Hua. Practical Interface Technology of MCS-51 Series Single-Chip Microcomputers. Beijing University of Aeronautics and Astronautics Press, 1993
2. Sun Yucai. MCS-51 Series Single-Chip Microcomputers and Their Applications. Southeast University Press, 1991

Reference address:Design of infrared remote control transmitter and receiver in automobile

Previous article:AUTOSAR automotive open system architecture solution for OEMs
Next article:Design of dynamic system for new vehicle simulation driving training system

Latest Automotive Electronics 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号