NEC Transmission Protocol for Air Conditioners

Yasir Sheikh
BlueEast
Published in
2 min readJun 19, 2018
IR communication for electronic devices

Introduction

The IR communication used in most of the IR controlled devices today uses pulse distance encoding of the message bits known as NEC. Timings of the pulse bursts are controlled to send the data in form of logical 1s and 0s.

  1. Logical 0 is sent by a high pulse of 562.5µs followed by a space of 562.5µs.
  2. Logical 1 is sent by a high pulse of 562.5µs followed by a space of 1687.5µs.

Space is referred to low level of the voltage. NEC uses a standard carrier frequency of 38.22kHz.

NEC Packet

A standard NEC packet consists of the following elements

  1. A pulse of 9ms
  2. A space of 4.5ms
  3. 8-bit (LSB first) address of the receiving device
  4. 8-bit checksum created by logical inversion of the address bits
  5. 8-bit (LSB first) data
  6. 8-bit checksum created by logical inversion of the data bits
  7. A stop pulse of 562.5 µs

Example

Figure 1 is an example of sending 0xAD as data using NEC encoding.

Usage of NEC in Air Conditioner Remote Control:

Every IR command of an Air conditioner remote sends complete information. For example, a command to change set temperature will also send the mode bits, fan speed bits, timer bits (if supported) etc. For complete information, the standard NEC packet does not suffice and hence an extended version is used which might differ for every manufacturer. An IR command for AC may contain the following:

  1. A pulse of 9ms
  2. A space of 4.5ms
  3. n-bit data and address bits with checksum.
  4. A stop pulse of 562.5 µs

Where n varies with the manufacturer and the features supported in the Air Conditioner.

Table 2 shows an example of HEX IR code of an Air Conditioner using NEC encoding

Similarly, different manufacturers use an extension of NEC encoding using the start and end patterns along with the method of transmitting 0s and 1s.

--

--