A new method of self-learning and restoration of infrared remote control signals based on single chip microcomputer

Publisher:平静宁静Latest update time:2012-02-23 Source: 21IC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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

Reference address:A new method of self-learning and restoration of infrared remote control signals based on single chip microcomputer

Previous article:Countdown digital timer that never needs battery replacement
Next article:Serial Communication between PC and MCU under Windows CE.NET 4.2

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号