Electronic – How to make/duplicate a NEC Infrared Transmission Protocol

infrared

what i am trying to achieve to be able to duplicate/recreate the infrared signal of my remote control using my arduino.

The arduino has a already a library for this, unfortunately it doesn't seem to support the board that i am going to use the arduino mkr1000. The library has a recieve that makes me able to see the data, but the function for transmitting it back is not working.

So this makes me resort to creating a function for sending myself. I know that the remote i am using uses and NEC infrared transmission protocol. So i looked at its specs.

according to it:

  • a 9ms leading pulse burst (16 times the pulse burst length used for a logical data bit)
  • a 4.5ms space
  • the 8-bit address for the receiving device
  • the 8-bit logical inverse of the address
  • the 8-bit command
  • the 8-bit logical inverse of the command
  • a final 562.5µs pulse burst to signify the end of message transmission.

What i dont understand is, what is this address and command.

unfortunaly i do not have an oscilloscope inorder to probe my remote to confirm some hypothesis. What i have though is the output of the serial monitor the arduino upon recieving the signal.

Encoding  : NEC
Code      : 2FD807F (32 bits)
Timing[67]: 
    +9200, -4500     + 600, - 550     + 600, - 550     + 600, - 550
    + 600, - 550     + 550, - 600     + 550, - 550     + 600, -1700
    + 600, - 550     + 600, -1700     + 550, -1700     + 600, -1700
    + 600, -1700     + 550, -1700     + 600, -1700     + 550, - 600
    + 550, -1700     + 600, -1700     + 550, - 550     + 600, - 550
    + 600, - 550     + 600, - 550     + 600, - 550     + 550, - 600
    + 550, - 550     + 600, - 550     + 600, -1700     + 600, -1700
    + 550, -1700     + 600, -1700     + 600, -1700     + 550, -1700
    + 600, -1700     + 600

unsigned int  rawData[67] = {9200,4500, 600,550, 600,550, 600,550, 600,550, 550,600, 550,550, 600,1700, 600,550, 600,1700, 550,1700, 600,1700, 600,1700, 550,1700, 600,1700, 550,600, 550,1700, 600,1700, 550,550, 600,550, 600,550, 600,550, 600,550, 550,600, 550,550, 600,550, 600,1700, 600,1700, 550,1700, 600,1700, 600,1700, 550,1700, 600,1700, 600};  // NEC 2FD807F
unsigned int  data = 0x2FD807F;

From the output can we point out which is the address and which is the command? so that i will be able to create a code for it

Best Answer

In the sample capture you have the data right there => 0x02FD807F. The address is 0x02. The logical inverse of the address is the 0xFD. The command is the 0x80. And the logical inverse of the command is the 0x7F value.