Infrared remote control communication principle _ infrared remote control protocol _ infrared communication contrast wireless communication advantages

Infrared communication, as its name implies, transmits data using infrared light. Back in the early stages of computer technology development, data was transferred via cables. These cable-based methods were cumbersome and required specific interfaces, which made things inconvenient. Later on, wireless data transfer technologies like infrared, Bluetooth, and 802.11 emerged. During the initial development of infrared communication, there were multiple standards, and devices adhering to different standards couldn't communicate with each other. To enable interoperability among various infrared devices, in 1993, over 20 major manufacturers established the Infrared Data Association (IrDA) to standardize infrared communication. This led to the widely-used IrDA infrared data communication protocol and specifications. What makes infrared communication advantageous compared to other wireless communication methods? Infrared communication uses infrared rays as carriers to transmit data information. As a form of wireless communication, compared to radio communication, it offers a high cost-performance ratio, simple implementation, resistance to electromagnetic interference, high-speed applications, flexible spatial access, and economical usage. Infrared local area network communication and military infrared fuses have been widely adopted in mobile computing and mobile communication devices. In situations where data exchange is needed but not overly large, and where real-time requirements aren’t very high, infrared communication can be utilized to provide the convenience of cordless communication while avoiding issues associated with high-frequency circuits. Examples include household appliance remote controls, remote keyboards and mice for computers, and portable data collection devices like water meter registers and tax collectors for data exchange. Currently, wireless data communication using infrared is highly feasible in terms of miniaturization, lightweight design, and security. It has found applications in wireless multi-channel indoor voice systems, cordless phones, and communication between keyboards and terminals. These applications operate within a bandwidth much lower than that required for WLANs. Let's now delve into the principle of remote infrared communication. In practical communication scenarios, transmitted signals typically have a broad spectrum, distributing a significant portion of their energy in a relatively low-frequency range, thus being referred to as baseband signals. These signals are unsuitable for direct transmission through channels. To facilitate transmission, enhance interference resistance, and efficiently utilize bandwidth, signals are usually modulated into a frequency range suitable for the channel and noise characteristics. This process is known as signal modulation. On the receiving end of a communication system, the received signal is demodulated to recover the original baseband signal. Understanding the basics of this communication principle is straightforward. Infrared communication in remote controls typically employs a carrier frequency of around 38KHz. Let’s explore the principle behind this. First, consider the sending mechanism. Modulation involves controlling parameters such as amplitude, phase, or frequency of a high-frequency signal using the signal to be transmitted, essentially loading one signal onto another. For instance, when an infrared remote control signal needs to be transmitted, it is first modulated by a 38KHz carrier, as illustrated in Figure 1. The original signal is either a data '0' bit or a data '1' bit we wish to send, while the 38KHz carrier is a square wave signal with a frequency of 38KHz. The modulated signal is the waveform we ultimately emit. We use the original signal to control the 38KHz carrier. When the signal is a data '0', the 38KHz carrier is transmitted without interruption. When the signal is a data '1', no carrier signal is transmitted. From a circuit perspective, how do we implement this function? As shown in Figure 2. For the 38KHz carrier, we can obtain 37.91KHz by dividing a 455K crystal oscillator by 12, generate it using the NE555 timer circuit, or produce it using the PWM of a microcontroller. When the signal output pin outputs a high level, Q2 turns off, and regardless of how the 38KHz carrier signal controls Q1, the vertical branch on the right will not turn on, meaning the infrared diode L1 will not send any information. When the signal output is low, the 38KHz carrier is released through Q1, producing a 38KHz carrier signal on L1. It should be noted that the duty cycle of most home appliance remote controllers is 1/3 of the 38KHz carrier, though some have a duty cycle of 1/2, albeit less common. For normal communication, the receiver must first process the signal through a series of circuits including monitoring, amplification, filtering, demodulation, etc., before outputting the baseband signal. However, the integrated receiving head HS0038B of infrared communication has combined all these circuits into one unit. We only need to connect this circuit to directly output the baseband signal we desire, as shown in Figure 3. Since the internal amplifier of the infrared receiving head has a very high gain, it is prone to interference. Therefore, a filter capacitor must be added to the power supply pin of the receiving head. The official manual recommends a value of 4.7uF, but a 10uF capacitor is also required. Additionally, a 100 ohm resistor should be placed in series between the supply pin and the power supply to further reduce interference. The circuit shown in Figure 3 is used to receive the waveform emitted by the circuit in Figure 16-5. When HS0038 detects a 38KHz infrared signal, it outputs a low level on the OUT pin. When there is no 38KHz signal, the OUT pin outputs a high level. By connecting the OUT pin to the IO port of the microcontroller and through programming, we can retrieve the data sent by the infrared communication. Consider this: is the data output from the OUT pin restored to baseband signal data? Furthermore, when we receive this baseband signal data, how do we determine what data has been received? What protocol should we follow? Communication protocols like UART, I2C, and SPI that we previously studied are for baseband communication, whereas the infrared 38KHz modulates and demodulates the baseband signal, making the signal more suitable for transmission. Since our infrared modulation signal is half-duplex and allows only one source in the space, our infrared baseband signal isn't suitable for I2C or SPI communication protocols. We mentioned that UART is 2-line, but during communication, technically only one line is needed, so infrared can communicate via UART. Naturally, this communication isn't unrestricted. For instance, in the data sheet for HS0038B, if the HS0038B is to recognize the 38KHz infrared signal, the 38KHz carrier must be greater than 10 cycles, which limits our infrared communication. The bit rate of the baseband signal must not exceed 3800. If the signal output from the serial port is directly modulated by 38KHz, the baud rate cannot be higher than 3800. Common infrared remote control protocols include: I. NEC Protocol Features: An 8-bit address and an 8-bit command length for improved reliability. Each transmission includes two passes: an address (user code) and a command (key value). The modulation of the signal is achieved by the time intervals between bursts. The 38KHz carrier has a period of 1.12ms per bit or 2.25ms. Modulation: Note: For the signal received by the infrared receiver, the high-pulse part represents a logic '1'. That is, logic '1' is 0.56ms high level + 1.69ms low level, and logic '0' is 0.56ms high level + 0.56ms low level. Protocol: The figure above shows a typical NEC protocol transmission format. The start bit (boot code) is 9ms high + 4.5ms low. Valid data includes address + address inverse code + command + command inverse code. The purpose of the inverse is to calibrate the previous address and command. If reliability isn't a concern, you can remove the inverted data or extend the address and command to 16 bits. The address data transmitted in the above figure is 10011010. It should be noted that the low-order address is sent first, followed by the high-order address. Thus, the address of the waveform is 01011001=0X59. Similarly, the command is 00010110=0X16. When a button is pressed, as shown in the figure below, it is sent once every 110ms, but the command is sent only once. The repeat is 9ms high + 2.25ms low + 0.56ms high + low. Extended Protocol: The extension protocol simply changes the address to 16 bits, leaving everything else unchanged. Measured Waveform: The waveform below is the waveform obtained from the infrared receiver: (the modulated pulse signal is converted to high and low levels) Since the infrared receiving head reverses the waveform when receiving the signal (or when transmitting), the reverse function of the oscilloscope can be turned on while reading the data, allowing for the valid data to be read. The following example is the waveform captured by the known NEC type remote control: The remote control ID is Address=0xDD20; one of the key values is Command=0x0E The last bit is a logical '1'. II. Philips RC5 Protocol Features: A 5-bit address and a 6-bit command length (7-bit extension protocol) Bidirectional encoding or Manchester encoding (i.e., level changes represent logic 0 and 1) 36KHz carrier The period per bit is 1.778ms (64 cycles of 36 kHz) Modulation: Protocol: A piece of data consists of 14 bits with a period length of 25ms. The first two bits are the start bit S, usually a logic one. In RC5 extended mode, the second bit S2 expands the 6-bit command code to the 7-bit code (as the MSB), which can be expanded from 64 key values to 128 key values. The third bit is the control bit C. It flips after each key press, enabling differentiation between repeated presses without releasing the button and releases. When a button is pressed, the data is sent repeatedly every 114ms, and the third bit does not flip, meaning the signals sent repeatedly are completely identical. Measured Waveform: When the same button is pressed twice in succession, only the third bit flips, with the other bits remaining unchanged. The value of the segment data can be read from the above waveform as 101 01010 010111. Since the protocol is the RC5 extension protocol, that is, the second bit is the seventh bit of the command, the address is 01010=0X0A, and the command is 0010111=0X17. (The actual remote controller manufacturer gives a command of 57, which may be the seventh bit of the command after inverting the second bit). III. Sony SIRC Protocol Features: There are three modes of 12, 15, and 20 digits (12-bit mode described below) 5-bit address and 7-bit command length Pulse width coding 40KHz carrier The period of each bit is 1.2ms or 1.8ms Modulation: Protocol: The start bit is 2.4ms high level + 0.6ms low level; When a button is pressed, the data is sent repeatedly every 45ms. Measured Waveform: From the above waveform, the value of the segment data can be read as 1001000 10000 cmd:0001001 addr: 00001. IV. Others 1. ITT 2. JVC 3. Nokia NRC17 4. RCA 5. Sharp 6. X-Sat

ZGAR PROJECT-D Detacheable Cartridge

Zgar International (M) SDN BHD , https://www.zgarvape.com