Main Menu

search

You are here

IR Remote Encoding Algorithm

[last updated: 2025-01-17]
IR Remote - home page
-----

      This page is in process ...
  • The IR signal sent out by your IR sender is a series of pulses of a 38 KHz carrier wave (usually 38KHz, but not always).
    The pulses vary in length, very roughly on the order of 500 - 2000 microseconds.
  • Different device manufacturers (Sony, NEC, etc.) use different data protocols ("encoding algorithms") for the signals sent from their IR remotes.
    Main differences between protocols from different manufacturers:
    • total number of data bits used to encode a given key press
    • number and length of pulses to define the "starting sequence"
    • more complicated configuration patterns, eg. how many data sets sent per button press,
      whether inverted data is sent,
      whether bits (1's & 0's) are correlated to simple pulse length or to more complicated patterns,
      presence of "toggle" bits to discriminate between multiple button presses vs. a held-down button
  • Pressing different buttons on your remote will always send out a 38 KHz pulse train.
    The pulse train is composed of some number of pulses of different lengths.
    A given button-press is identified by the unique pattern of pulses and their lengths.
    Measuring the number and lengths of the received pulses is therefore necessary to differentiate between different button-presses.
  • The pulse train that is sent when you press a button on the remote
    often consists of a "start sequence" followed by data.
    The entire pulse train, start + data, may be sent 2 or 3 times, to guarantee accurate reception, depending on the device and manufacturer.
    -------------------------------------------

  • So Far, So Good ...
    • The above is the total of the general information that I'm pretty sure of.
    • If you want to "look at" and deeply investigate the encoding algorithm of a pulse train,
      you have to look at the "raw data" that is put out when you press a button on the remote.
          See "Getting Raw Data" section here.
    • I have found 3 Arduino methods to do that:
        the Adafruit method, which uses clever programming without added libraries,
        using the IRLib2 library,
        and using the IRremote library
    • My problem is, I have not been able to reconcile the two of those methods that both give "raw data."
      That is, the data they output are different from each other.

    -------------------------------------------

  • So where to go from here?
    • One could dig deeper into the protocol and format of the raw data,
      and presumably, hopefully, eventually, come to an understanding and explanation of
      precisely how the signals are encoded.
    • Or, one could just wave their hands at the mystery,
      and proceed to use the libraries to do the heavy lifting,
      and just make a project that works.
    • That's what I'm going to do at this time.
      I may come back to it at some later date, but ... later.

    -------------------------------------------

  • ... proceed to decode the raw data ...
    -------------------------------------------


    -------------------------------------------

eof