Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Principle of infrared remote controller principle of remote controller
Principle of infrared remote controller principle of remote controller
A remote controller is a device used to remotely control a machine. Modern remote controllers are mainly composed of integrated circuit boards and buttons for generating different information. Let's take a look at the principle of infrared remote control and the schematic diagram of remote control.

Principle of infrared remote controller

Infrared remote control system generally consists of transmitter and receiver. The transmitter consists of command key, command signal generation circuit, modulation circuit, driving circuit and infrared transmitter. When the command key is pressed, the command signal generating circuit generates the required control signal. After the control command signal is modulated by the modulation circuit, the driving circuit finally drives the infrared emitter to send out the infrared remote control command signal.

The receiver consists of an infrared receiving device, a preamplifier circuit, a demodulation circuit, an instruction signal detection circuit, a storage and driving circuit and an execution circuit. When the infrared receiving device receives the infrared command signal from the transmitter, it converts the infrared signal into an electrical signal and sends it to the preamplifier for amplification. After passing through the demodulator, the command signal is detected by the signal detection circuit. Finally, the storage circuit and the drive circuit drive the execution circuit to realize various operations.

Control signals are usually distinguished by some different characteristics. The common characteristics of distinguishing command signals are frequency and code group characteristics, that is, different frequency or coded electrical signals are used to represent different command signals to realize remote control. Therefore, infrared remote control systems are usually classified according to the way and characteristics of generating and distinguishing control command signals, and are often divided into frequency-division infrared remote control and code-division infrared remote control.

1? Transmitting part of infrared remote control system

Infrared remote control transmitter consists of keyboard matrix, remote control ASIC, driving circuit and infrared LED. The structure is shown in figure 1.

When a key is pressed, the system delays for a period of time to prevent interference, and then starts the oscillator. After the key encoder obtains the key code, it obtains the corresponding instruction code (code consisting of 0 and 1) from rom. The remote control is usually powered by a battery. In order to save electricity and improve the anti-interference ability, the command code is modulated by the carrier in the range of 32 ~ 56 kHz and output to the amplifier circuit to drive the infrared emission tube to emit 940nm infrared light. When the transmission ends, the oscillator is also turned off, and the system is in a low-power sleep state. The carrier frequency and modulation frequency will be different in different occasions, but most household appliances are 38kHz, which is obtained by dividing the frequency by 455kHz oscillator 12.

The signal of remote control transmitter consists of a series of binary codes of 0 and 1, and different chips encode 0 and 1 differently. The existing infrared remote control includes two ways: pulse width modulation (PWW) and pulse position modulation (PPM or Manchester code). The representatives of the two coding forms are NEC and Philips RC-5.

2? Receiving part of infrared remote control system

The receiver consists of amplifier, limiter, band-pass filter, demodulator, integrator and comparator. For example, the method of using an earlier infrared receiving diode and a special infrared processing circuit, such as CXA20 106, has complicated circuits and is generally not used now. But in practical application, all the above circuits are integrated in one circuit, which is what we often call an integrated infrared receiver. According to different carrier frequencies, integrated infrared receivers have different models. Because of the interface problem with CPU, most receiving circuits are inverted code output, that is to say, when there is no infrared signal, the output is 1, and when there is signal output, there are only three pins, namely +5V power supply, ground and signal output.

Design of the system

1? Code sending part of single chip microcomputer

①? Keyboard part

The transmitting circuit of infrared remote controller is relatively simple, which consists of a 4×4 rectangular keyboard, a PNP driving transistor, an infrared light emitting diode and two current limiting resistors. Input the receiver to be remotely controlled through the keyboard, that is, input the address to be remotely controlled by the infrared through the keyboard, and the address will be transmitted by the infrared light emitting diode after being coded and modulated.

The matrix keyboard consists of 16 touch keys arranged in four rows and four columns. The I/O port of the single chip microcomputer is connected with the row line as the output end and the column line as the input. When there is no key, all outputs are high, which means there is no key. When a key is pressed, the input line will be pulled, so you can know whether a key is pressed by reading the state of the input line.

The column line of the keyboard is connected to the lower 4 bits of P 1 port, and the row line is connected to the upper 4 bits of P 1 port. The column line P 1.0 ~ P 1.3 is set as the input line, and the row line P1.4 ~ P1.

Detects whether a key is currently pressed. The detection method is to set the output of P 1.4 ~ P 1.7 to 0 and read the status of P 1.0 ~ P 1.3. If P 1.0 ~ P 1.3 are all 1, there is no key closure, otherwise there is a key closure.

Eliminate key jitter. When a key is detected to be pressed, the next detection and judgment will be delayed for a period of time.

If a key is pressed, you should identify which key is turned off. The method is to scan the lines of the keyboard. P 1.4 ~ P 1.7 output according to the following four combinations:111,11. Thus, the row and column values of the close key are obtained, and then the row and column values of the close key are converted into defined values through calculation or table lookup.

In order to ensure that the CPU is only processed once every time it is turned off, it is necessary to remove the jitter when the key is released. The generated key value is placed in the sending database area and stored in 30H, that is, the 8-bit address to be remotely controlled is *** 1 byte, and 3 1H is the same 8-bit address as in 30H. The address code is retransmitted once, mainly to enhance the reliability of the remote controller. If the two address codes are different, it means that the data in this frame is wrong and should be discarded. 32H plays 00H (for programming simplicity), and 33H plays 0FFH, a ***32-bit data. To send data, just go there and read the data, and then call the launch subroutine to send it.

② Carrier part

According to the basic principle of infrared remote control introduced earlier, the coding and modulation mode of infrared remote control is actually very simple, as long as a certain level is generated for a long time. The code can be transmitted by 38kHz carrier modulation. There are many ways to generate carrier, such as CMOS gate RC oscillator or 555 time base circuit.

This design adopts CPU delay, that is, it is completed by timer interrupt, and 38kHz carrier is generated by T0 timing of single chip microcomputer. Set the timer to mode 2, which is an 8-bit counter that automatically restores the initial value. TL0 is used as an 8-bit counter and TH0 is used as an initial value register. When the TL0 count overflows, on the one hand, it sets the overflow flag bit TF0 of 1 to request an interrupt from the CPU, and at the same time, it sends TH0 content to TL0, so that TL0 starts counting again with the initial value of 1 Therefore, T0 works in mode 2, and the timing accuracy is relatively high. According to the calculation, the initial timing value is set to 38KHz, the initial timing value of 12kHz crystal oscillator is 0F3H, and the initial timing value of 1 1.0592kHz crystal oscillator is 0F4H. Set timer interrupt, and only write the inverted P2.0(CPL? P2.0), when the data to be transmitted is 1, when the first 560μs is transmitted at a high level, interrupt the timer first, then start it, let the timer work, and close it after a delay of 560μs, and the second low level 1690μ s does not send a signal, so it can be directly set at a high level of P2.0, Delay 1690μs ... The high level of 560μs in front of data 0 is the same as the high level of data 1, and the low level of 560μs in the back can be directly set to the high level of P2.0, so the delay is 560μs because there is no signal to send.

2? Infrared receiving and decoding circuit

The infrared remote control receiver adopts integrated infrared receiver, which integrates infrared receiving diode, amplification, demodulation, shaping and other circuits, and has only three pins. The signal output end of the infrared receiver is connected to the INT0 end of the single chip microcomputer. When the infrared pulse falls, the single chip microcomputer interrupts the INT0 to generate an interrupt. The circuit is shown in Figure 3.3, in which a PNP transistor is added to amplify the output signal, and R and C form a decoupling circuit to suppress power supply interference.

3? Decoding algorithm of remote control signal

Usually, when the remote controller is pressed without a key, the infrared LED will not send out a signal, and the remote control receiver will output a signal of 1. When this key is pressed, the remote receiver will invert the high level of 0 and 1 code and output the signal 0. Because it is connected with the interrupt pin of the single chip microcomputer, it will cause the single chip microcomputer to interrupt (the single chip microcomputer is preset to interrupt on the falling edge).

Remote control code is sent by 9ms high level and? The low level of 4.5ms indicates the pilot code, the high level and low level of 560μs indicate data "0", the high level of 560μs and the low level of 1690μs indicate data "1", and the pilot code is followed by 4 bytes of data. The received code is the inverse of the transmitted code, so judging the length of the high level in the data is the key point to read the data. Here 882 μ s (560 ~? 1690μs) as a scale. If it is still high after 880μ s, it means that it is data 1. Just write 1 into the register (when the data is 1, it needs to be delayed for a while to lower the level to detect the beginning of the next low level). If the level is low after 882μs, it means data 0, then write 0 into the register and wait for the next low level.

Continue to receive the following data. When 32-bit data is received, it means that a frame of data has been received, and then it is judged whether this reception is valid or not. If the two address codes are the same and equal to the address code of the system, and the sum of the data code and the data inverse code is equal to 0FFH, the received frame of data is valid, and the LED lights up; otherwise, the received data is discarded.

After receiving, initialize the data received this time to prepare for the next remote control reception.

The above is the principle of remote control introduced by Bian Xiao, hoping to help you. For more remote control principles, please continue to pay attention to Tuba rabbit decoration.

Tubatu Online provides you with "every decoration quotation, 1-4 local decoration companies, 3 sets of decoration design schemes" and the decoration pit avoidance strategy for free! Click this link:/Zhu Ye /zxbj-cszy.php? to8to _ from = SEO _ zhidao _ m _ jiare & amp; Wb, you can get it for free ~