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
Previous article:AUTOSAR automotive open system architecture solution for OEMs
Next article:Design of dynamic system for new vehicle simulation driving training system
- Popular Resources
- Popular amplifiers
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- How much do you know about intelligent driving domain control: low-end and mid-end models are accelerating their introduction, with integrated driving and parking solutions accounting for the majority
- Foresight Launches Six Advanced Stereo Sensor Suite to Revolutionize Industrial and Automotive 3D Perception
- OPTIMA launches new ORANGETOP QH6 lithium battery to adapt to extreme temperature conditions
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions
- TDK launches second generation 6-axis IMU for automotive safety applications
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- [2022 Digi-Key Innovation Design Competition] Distributed Temperature and Humidity Acquisition System-STM32H745I-DISCO Basic Learning
- Start at 2pm: TI MSP430 development training, online hands-on demo + analysis by frontline experts
- Chip Manufacturing: A Practical Tutorial on Semiconductor Process Technology (Sixth Edition)
- CircuitPython 6.0.0 Beta 2 released
- July 21 Live Replay: Microchip Timberwolf Audio Processor Online Seminar (including video, PPT, QA)
- MSP430 FAQ: FLASH storage
- [RISC-V MCU CH32V103 Review] Driving OLED Display
- Touch IC-Three new ways of human-computer interaction (1)
- Experience in using TI DSP/BIOS and CCS
- Four-layer PCB proofing matters needing attention