1 Overview
With the continuous development and improvement of the distance education system, multimedia teaching methods have been widely used in schools of all levels and types. In recent years, in the process of developing and researching multimedia teaching systems, we often encounter a variety of infrared remote control devices used in teaching, such as digital projectors, DVDs, VCDs, video recorders, televisions, etc. Since various devices have their own remote controls, and different devices follow different infrared remote control procedures, these devices must be operated using multiple remote controls, which brings a lot of inconvenience to users. We solved this problem by centrally controlling each device as shown in Figure (1). The method of centrally controlling each device is to first identify and store (self-learning) the infrared remote control signals of each device, and then restore them when needed. In Figure (1), the PC or centralized controller sends the device number and control command number to the infrared remote control signal self-learning and restoration circuit, and then the self-learning and restoration circuit restores the corresponding infrared remote control signal and sends it out to control the specified infrared remote control device action.
Figure (1) Schematic diagram of centralized control of multiple infrared remote control devices
2 Self-learning and restoration of infrared remote control signals
2.1 Principle of infrared remote control signal encoding and transmission
Usually, an infrared remote control modulates the remote control signal (binary pulse code) on a 38KHz carrier wave, and after buffering and amplification, sends it to the infrared light-emitting diode, converts it into an infrared signal and transmits it. There are many forms of binary pulse codes, among which the most commonly used are PWM code (pulse width modulation code) and PPM code (pulse position modulation code). The former uses a wide pulse to represent 1 and a narrow pulse to represent 0, as shown in Figure (2). The latter has the same pulse width, but different code bit widths. The wide code bit represents 1 and the narrow code bit represents 0. As shown in Figure (3).
Figure (2) PWM code
Figure (3) PPM code
The remote control coded pulse signal (taking PPM code as an example) is usually composed of the guide code, system code, system inverse code, function code, function inverse code and other signals, as shown in Figure (4). The guide code is also called the start code, which is composed of a high level with a width of 9ms and a low level with a width of 4.5ms (different remote control systems have certain differences in the width of the high and low levels), and is used to mark the beginning of the remote control coded pulse signal. The system code is also called the identification code, which is used to indicate the type of remote control system to distinguish other remote control systems and prevent malfunctions of each remote control system. The function code is also called the instruction code, which represents the corresponding control function. The microcontroller in the receiver can perform various functional operations according to the value of the function code. The system inverse code and the function inverse code are the inverse codes of the system code and the function code respectively. The addition of the inverse code is to be able to check whether errors occur during the transmission process at the receiving end. In order to improve the anti-interference performance and reduce power consumption, the above remote control coded pulse is subjected to pulse amplitude modulation (PAM) on the carrier signal with a frequency of 38KHz (period of 26.3us), and then sent to the infrared light-emitting tube after buffer amplification to transmit the remote control signal.
Figure (4) Composition of remote control coded pulse signal [page]
2.2 Hardware implementation of infrared remote control signal self-learning and restoration
According to the remote control signal encoding and transmission process, the remote control signal recognition, that is, the decoding process, should be to remove the 38KHz carrier signal and identify the 0 and 1 in the binary pulse code. The hardware circuit for remote control signal recognition, storage, and restoration is shown in Figure (5). It consists of the MCS-51 series single-chip microcomputer AT89C51, an integrated infrared receiver, a memory, a restoration modulation, and an infrared light-emitting tube drive circuit.
The integrated infrared receiver uses SIEMENS SFH 506-38, which is responsible for demodulating the infrared remote control signal. The infrared pulse signal modulated at 38kHz is demodulated and inverted before being input to the INT0 (P3.2) pin of AT89C51, and the single-chip microcomputer measures the high and low level widths.
The E2PROM chip 24C32 with I2C bus interface is used as the memory in the figure, and its capacity is 4KB.
Figure (5) Schematic diagram of infrared remote control signal self-learning and restoration
It is used to save the high level and low level width data of the identified remote control signal. Usually, the binary pulse code length of the remote control signal is 32 bits, each bit consists of a high level and a low level. The signal width data to be saved is 64, plus the 2 data of the boot code, a total of 66 data, each data is represented by one byte, and a remote control signal command requires 66 bytes to save. Considering that different remote control systems have certain differences, some remote control signal commands are longer, so the storage space should be appropriately reserved. In practical applications, the capacity and model of the E2PROM chip can be determined according to the specific conditions such as the number of infrared remote control devices and the number of remote control commands for each device.
The restoration and transmission of the remote control signal is achieved by outputting a binary pulse code (the duration of the high level and the low level is a set of width data saved during identification) through the P0 port (P0.1 in the figure) and the 38KHz modulated pulse, that is, the P0 port outputs a high level to allow the 38KHz modulated pulse to pass, and the P0 port outputs a low level to shut down the 38KHz modulated pulse. The modulated signal is driven through the infrared light-emitting tube to transmit the infrared remote control signal to control the infrared remote control device. The LED light-emitting tube in the figure is used to indicate the infrared remote control signal, and is also used to indicate the various states in self-learning.
Port P2 is connected to a group of buttons. The number of buttons is the same as the number of infrared remote control devices that need to be centrally controlled. They are used to control the microcontroller to enter or exit the self-learning state. The button number is the device number.
The single-chip microcomputer is connected to the host computer PC or centralized controller through the serial port to receive control commands. The host computer or centralized controller communicates with the single-chip microcomputer through the RS-485 bus, thereby realizing remote control of the infrared remote control device.
2.3 Software Design
After the microcontroller is powered on and reset, its internal timer and serial port are initialized first, and serial port interrupts are allowed. Then the P2 port is monitored. When it enters the self-learning state (one pin of the P2 port is input at a low level and maintained for more than 1S), the timer timing and software counting method are used to measure the high and low level widths of the input pulse on the INT0 pin. The INT0 pin is usually at a high level. When receiving an infrared remote control signal, due to the reverse action of the integrated infrared receiving head, the INT0 pin jumps down to a low level, which is the guide code. The measured high and low level widths are saved in the memory, and the width of the low level measured each time is compared with the low level width of the guide code. If they are equal, it means that a remote control command code recognition and storage (self-learning) is completed. Monitor the pin of the P2 port again. If it is at a low level and maintained for more than 1S, exit the self-learning state. Otherwise, further self-learn the next infrared remote control command code.
The serial port interrupt service program mainly looks up a table based on the received device number and command number to obtain a set of pre-stored high and low level width data, and then restores the infrared remote control signal at port P0 to control the infrared remote control device to act according to the specified command, that is, the restoration of the infrared remote control signal.
3 Conclusion
We have used the above-mentioned self-learning and restoration method of infrared remote control signals to successfully achieve self-learning and restoration of remote control signals for Shinco VCD, DVD, Jinzheng DVD, Panasonic series video recorders, as well as various models of digital projectors and color TVs, thereby realizing remote control of infrared remote-controlled devices in the multimedia distance learning system.
[References]
1. Single-chip microcomputer application system design. Edited by He Limin. Beijing University of Aeronautics and Astronautics Press, 1996
2. Intelligent infrared remote control. Long Meng. Electronic Technology, 1998 (9) 23-24
Previous article:Countdown digital timer that never needs battery replacement
Next article:Serial Communication between PC and MCU under Windows CE.NET 4.2
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- Please advise, where can I modify the USB device instance path generated by STM32?
- Msp430f149 microcontroller controls stepper motor C language program
- dsp reports an error after importing a new project!
- [NXP Rapid IoT Review] Adding Bluetooth Capabilities with NXP Rapid IoT
- On the saturation problem of operational amplifier circuit
- sdram_datasheet.pdf
- CC2640R2F hardware RF from design to production
- The book on switching power supplies states that because the capacitor is charged in each cycle, the current decline slope continues to increase. How do you understand this?
- [TI recommended course] #In-depth study of light load high efficiency and low noise power supply reference design for wearable devices and the Internet of Things (TIDA-01566)#
- Channel explanation in wireless communication