arduinochecksuminfrared

Samsung IR codes checksum


I had a long time decoding IR codes with optimum's Ken Shirriff Arduino Library. I modified the code a bit so that I was able to dump a Samsung air conditioner (MH026FB) 56-bit signals.

The results of my work is located in Google Docs document Samsung MH026FB AirCon IR Codes Dump.

It is a spreasheet with all dumped values and the interpretation of results. AFAIK, air conditioner unit sends out two or three "bursts" of 56 bit data, depending on command. I was able to decode bits properly, figuring out where air conditioner temperature, fan, function and other options are located.

The problem I have is related to the checksum. In all those 7-byte codes, the second one is computed somehow from the latter 5 bytes, for example:

BF B2 0F FF FF FF F0   (lead-in code)
7F B8 8A 71 F6 4F F0   (auto mode - 25 degrees)
7F B2 80 71 7A 4F F0   (auto mode - 26 degrees)
7F B4 80 71 FA 7D F0   (heat mode - 26 degrees - fan auto)

Since I re-create the IR codes at runtime, I need to be able to compute checksum for these codes.

I tried with many standard checksum algorithms, none of them gave meaningful results. The checksum seems to be related to number of zeroes in the rest of code (bytes from 3 to 7), but I really can't figure it how.

Is there a solution to this problem?


Solution

  • Ken Shirriff sorted this out. Algorithm is as follow:

    1. Count the number of 1 bits in all the bytes except #2 (checksum)
    2. Compute count mod 15. If the value is 0, use 15 instead.
    3. Take the value from 2, flip the 4 bits, and reverse the 4 bits.
    4. The checksum is Bn where n is the value from the previous step.

    Congraturations to him for his smartness and sharpness.