Infrared Transceiver basis

Basic understanding

Infrared light:

As long as a temperature above absolute zero (-273.15 ℃) are object emits infrared light, so that it is everywhere. Not visible to the naked eye.

 

wavelength:

Infrared emission control common wavelength 850nm and 940nm have two common

 

frequency:

At a fixed frequency transmitter to emit infrared light, generally 37.91KHZ more common, and in some places since then said to 38KHz. Meanwhile, the receiving side can recognize the frequency signal at the frequency as long as the transmitting side and the receiving side is not more than plus or minus 1KHZ, normal communication is possible; if ultra 2KHZ differ, there will be failure or a short distance and so on.

 

Infrared emission control:

Issued ordinary diode (LED) met, but which are not visible light emitted

 

An infrared receiver

There may be two structures, the principles of the diode D1 in FIG. 1 nonconducting default, if the diode receives the infrared signal would greatly reduce the resistance, to achieve conduction.

 Infrared receiver 2

   The module has three pins, greatly enhanced than the previous. Its internal circuit includes an infrared monitor diode, an amplifier, limiter, bandpass filter, an integrator circuit, a comparator and the like. Through the internal circuit, the reduction of the transmission signal waveform ends, the microcontroller can be used directly. It is also known as integrated infrared receiver. That is, it outputs the digital signal conforms to the requirements of the digital circuit, use can be directly used. So, although only one more appearance on the pin, but the actual increase many, many internal functions, which greatly simplifies the task of circuit designers. Further, the internal amplification gain such a receiver comparatively large, it is easy to cause interference, it is generally recommended that the power supply manufacturer plus feet above 4.7uf capacitor filter.

   Commonly used models IRM3638, HS0038 and VS1838 and so on. The interface circuit as shown in FIG.

        

Infrared protocol

1. The infrared light carrier need to achieve this by interaction of data carriers, data protocol must exist

2. ultimately transfer protocol instruction completion is 0 or 1

3. Common are: ITT agreement, NEC agreement, Nokia NRC agreement, Sharp agreements

 

NEC protocol transmitting end:

Internal generally use the remote control as a shock crystal 455Khz source, which modulation frequency 37.91Khz, the duty ratio of the oscillation signal by one third of the frequency division circuit portion. Idle remote control is no output transmitter. When a key is pressed, it sends a series of signals drive the infrared transmitter transmitting an infrared signal in the following format: some boot code, two bytes of user code (defined by the manufacturer), a byte of key data, a byte key anti-code data, with a final stop bit (without regard to basic programming).

 

NEC protocol the receiving end:

Output high when idle, when receiving the infrared 37.91KHZ prepare a low signal receiving end, when no infrared light, has returned to a high level. Therefore, all of the transmitter signals takes inverse signal was received in the receiving end.

Analysis and receiving an infrared signal output terminal:

     Pin high in the idle state

     When one bit is represented by 0, to output a low level of 0.56ms, and then outputs a high level to a 0.565ms;

     When one bit is represented by 1, a first 0.56ms outputs a low level, and outputs a high level of 1.690ms.

Programming guide

 If there is an infrared signal to output / high-low Analyzing

 

Programming ideas receiving end:

Calculating a time interval through two falling edges, based upon the received signal 1 or 0

 

Send programming ideas:

The sender sends the high level actually composed of high and low 38Khz

38KHZ interrupt timer is set, the interrupt is to be sent if the level has been counted in the transmitting side negated (connect infrared lamps), to achieve high transmission (receiving side is recognized as low level) data, if the transmission power is low Ping the delay does not operate.

 


 Reference Video: https://www.bilibili.com/video/av73032905

Guess you like

Origin www.cnblogs.com/dongxiaodong/p/11801896.html