Apple Remote

Update (11/11/12): Based on more accurate information on the protocol codes, I’ve update the information in this page

I’ve been using the Apple Aluminum Remote for my Arduino based HiFi projects. In my opinion, this is the perfect remote control for such projects because of its simplicity and good design, in addition to be reasonably priced at about US$20.

PROGRAMMING

  • Remote codes description [link]
  • NEC-based remote protocol [link]
  • Control for Arduino/Buffalo II DAC [link]

ERGONOMICS

It is from Apple. Here are the things I like the most:

  • Aluminum Unibody construction: feels solid
  • Textured finish: good grip
  • Perfect dimensions and weight: feels good in your hands
  • Intuitive key layout:  instant recognition by feel/ touch alone
  • One finger operation: all keys within reach of, and operated by the thumb and without having to move the position of the remote in your hand
  • Double-bevel design: tap down one side, the other raises to allow easy grab

The more I use the remote, the more I appreciate its design an simplicity. There is never a need to go hunting for a specific key. You know exactly where the keys are. In comparison, the typical remote controls have keys in seemingly random order and no two remotes have the same layout. Most often I have to read the labels in order to figure out the keys even after using the remote for a long while.

CONSTRUCTION

iSupply had this to say about the remote

“The Apple TV’s remote control represents more incredible mechanical engineering from Apple,” Rassweiler said. “The remote appears to machined from a solid piece of aluminum. Because of this, the electronics of the device must be slid in through small holes on the side, similar to putting a ship in a bottle. It’s a clever and a detail-oriented piece of design that makes the remote very pricey and very unique to Apple.”

You can see the disassembly of the remote here: [link] and a movie of disassembling here: [link]

There is a more recent teardown review here [link]

appleremote10

MODELS

There are currently two models of the Aluminum remote: they are exactly the same except one has a raised circular touch key as you can see in the photo below. I am not sure which one is the “updated” version, but I would guess, it is the one with the raised doughnut-shaped key.

There is also the old plastic model that shares the same protocol.

CODE & PROTOCOL

Some history on the development of the code:

At first, I assumed that different models had different code. And this is what I said:

The code I’ve developed here assumes the codes for the retail model. It is easy to modify the code to work with the codes of the bundled model or even to accept both sets of codes. I have documented the codes for both models in the remote code description post [link] and are also summarized here.

Reading the full 8-bit value from the codes from different remotes, I obtained the following table:

Key Retail AL Remote Bundled AL Remote Bundled White Remote
Up EE 87 0B 59 EE 87 0A 68  EE 87 0A 15
Down EE 87 0D 59 EE 87 0C 68  EE 87 0C 15
Left EE 87 08 59 EE 87 09 68  EE 87 09 15
Right EE 87 07 59 EE 87 06 68  EE 87 06 15
Center EE 87 5D 59 followed by
EE 87 04 59
EE 87 5C 68 followed by
EE 87 05 68
 EE 87 05 15
Menu EE 87 02 59 EE 87 03 68  EE 87 03 15
Play EE 87 5E 59 followed by
EE 87 04 59
EE 87 5F 68 followed by
EE 87 05 68
 N/A

AL remote came with the Apple TV2 and the white plastic remote came with an iMac

Later, a reader alerted me that all remotes emit the same command codes. If you look at the command byte and discard the last bit (least significant bit), then the command codes in 7 bit are all the same for all the remotes. The last bit,t he parity, is na XOR sum of the button and ID bits. See the table below. The new hex values without the last bit are in parenthesis. Notice that they are the same for all the remotes I have tested.

Key Command Byte (Aluminum Remote 1) Command Byte (Aluminum Remote 2) Command Byte (Plastic Remote)
Up 00001011 (0x05)
00001010 (0x05)
00001010 (0x05)
Down 00001101 (0x06)
00001100 (0x06)
00001100 (0x06)
Left 00001000 (0x04)
00001001 (0x04)
00001001 (0x04)
Right 00000111 (0x03)
00000110 (0x03)
00000110 (0x03)
Center 01011101 followed by
00000100 (0x2E) –
01011100 followed by
00000101 (0x2E) – (0x02)
00000101 (0x02)
Menu 00000010 (0x01)
00000011 (0x01)
00000011 (0x01)
Play 01011110 followed by
00000100 (0x2F) – (0x02)
01011111 followed by
00000101 (0x2F) – (0x02)
N/A

As of 11/11/12, the code has been updated to only interpret 7 bits for the command code. This way, there is no need to make any modifications and the code is compatible with all versions of the Apple remote.

8, 7 or 6 BITS?

The reader that alerted me that the command code is 7-bit, also said that it might be 6-bit. If we compare the values for 8-bit, 7-bit and 6-bit we can figure the following:

  • 8-bit: Remotes will have different command code values
  • 7-bit: Remotes will have the same command code values
  • 6-bit: Remotes will not be able to distinguish between some buttons

Parity A means last bit is one value, whereas parity B means the last bit has the other value. With 7 bit and 6 bit, there is no parity bit to evaluate.

RemoteCodes

Clearly the correct interpretation of the command code is 7-bit

  1. July 9, 2011 at 04:51

    The “bundled” remote is actually a revision of the remote. I bought a remote yesterday at Best Buy and it has the rounded D-pad.

  2. BlogGeanDo
    July 9, 2011 at 15:37

    Hello, thanks for sharing. Perhaps it was kind of hard to detect the “flat” doughnut pad for some people…

  3. Nis Sarup
    July 16, 2011 at 10:41

    I’ve started dabbling with my Apple Remote and a Leaflabs Maple.
    After inverting the order of bits I get some the same codes as you.

    The remote I use is a aluminium remote bought 25/5 – 11. It does not have the raised circular key. Yet the “up” command is 0A.

  4. BlogGeanDo
    July 17, 2011 at 21:23

    Hello, thanks for sharing. That is good to know. It seems then that there are (at least) two sets of codes and could apply to any of the remotes…

  5. Nis Sarup
    September 11, 2011 at 19:24

    I’ve gotten a bit further with my Maple code.
    I also found a white Apple Remote behind the couch and found that the Menu-button sends out the same commands as the Retail AL Remote, only the center button is “04”, in stead of the double command.

  6. November 20, 2011 at 21:38

    Interesting… my new Apple remote was not working with the code, so I read the IR codes from the remote via my Arduino. Here is what I got:

    Up: 77 E1 50 7C
    Down: 77 E1 30 7C
    Left: 77 E1 90 7C
    Right: 77 E1 60 7C
    Center: 77 E1 3A 7C followed by 77 E1 A0 7C
    Menu: 77 E1 C0 7C
    Play: 77 E1 FA 7C followed by 77 E1 A0 7C

    I’ll modify the code to use this new information.
    According to the case, my remote is model A1294. Purchased Summer 2011.

    • BlogGeanDo
      January 22, 2012 at 22:35

      Further tests by Justin showed the following results:

      Up: EE 87 0A 3E
      Down: EE 87 0C 3E
      Left: EE 87 09 3E
      Right: EE 87 06 3E
      Center: EE 87 5C 3E followed by EE 87 05 3E
      Menu: EE 87 03 3E
      Play: EE 87 5F 3E followed by EE 87 05 3E

      Which matches one of the set of codes listed in the table above…

      So “everything is fine and normal”…

      The first two codes: EE 87 is the manufacturer code (Apple). I would not expect these to change…

      • DejanM
        April 5, 2013 at 05:37

        I have the same codes as Justin. Can you please show me how do you get these codes from what Justin has ?

    • July 14, 2012 at 06:08

      Just for reference and to link to what I previously wrote, these codes, starting with the “custom code” 77 E1 are LSB. Same as EE 87 (MSB) below.

    • BlgGear
      April 5, 2013 at 14:28

      With the latest code, using 7 bits, the codes from all the remotes are the same. See text.

    • August 26, 2020 at 23:31

      If anyone is finding this literally 9 years ago, these codes work with the “tasmota-ir” ESP8266 firmware. Enjoy! And thanks @justintect!

    • August 26, 2020 at 23:31

      *9 years later

  7. BlogGeanDo
    November 21, 2011 at 19:25

    That is one odd set of codes. Thanks for sharing…

  8. dsdjoy
    February 21, 2012 at 21:55

    Used your Apple Remote code for Arduino with some small adjustments in a plain Atmega C-language project (no Arduino) to control my preamp. Works like a charm, thanks !

  9. Bruno
    May 18, 2012 at 00:06

    There is currently only ONE model of Apple remote. You should look at those codes again.

    The codes from all Apple remotes ever made are identical. The small exception is that the silver remote sends TWO codes for the Select and Play/Pause button.

    The big “aha” missing from this discussion comes from the assumption that Apple codes are NEC format. They’re not. The next assumption is that the button codes are 8 bits. They’re not. 🙂

    Apple’s IR format is custom and only “based” on NEC. They have taken the premise and re-used all the command bits in a custom fashion.

    7 bits for the button code
    1 PARITY bit
    8 bits for ID

    The parity is a XOR sum of the button and ID bits, and since it flips around between 1 and 0 depending on the other bits, of course you’ll think the codes are different between two remotes with two different IDs.

    • BlogGeanDo
      May 18, 2012 at 05:29

      Bruno, thanks a lot!. If one discards the LSB, then they are exactly the same… So the first two bytes are the manufacturer code?

      I shall adjust my code.

  10. Bruno
    May 18, 2012 at 00:10

    Oh, press and hold MENU + PLAY/PAUSE on any Apple remote to change (roll) its ID.

  11. May 18, 2012 at 14:54

    Yes, the first two bytes are what is normally referred to as the manufacturer code in NEC terminology.

    There may actually be a slight correction to what I posted yesterday. While it’s safe to assume that the button codes are 7 bits for decoding purposes, they may actually be only 6 bits. It’s been a long time (6+ years) since I analyzed the signals, so I forgot to mention that the Apple remote also identifies a low battery condition. This may be a single bit, but I’d have to look through all my notes and likely continue testing to be sure. The battery voltage has to drop below a threshold to trigger this behavior, so there’s significant setup in prepping for this. 🙂

  12. BlogGeanDo
    May 19, 2012 at 02:12

    Hi Bruno, thanks again for sharing this information. After you indicated 7 bits, it becomes so obvious, but without that bit of info, it is not so obvious, especially if one thinks it is NEC protocol

  13. Corpius
    June 28, 2012 at 20:22

    Hi,

    I got the first 7 bits of the third byte by using a slightly different code than the original code. It is very easy to adapt.
    Instead of this code:

    ic3 |= mask;
    mask <0)c3 |= mask;
    if (i>0)mask <<=1;

    When using this the codes from the remote for 'up', 'down', 'left, 'right', 'center', 'menu' and 'play' are respectively 5, 6, 4, 3, 46, 1 and 47.
    They correspond with the HEX values you discribed

  14. Corpius
    June 28, 2012 at 20:27

    uhmm tho code got mixed up somehow. I’ll try to post it again.
    Instead of this code:

    c3 |= mask;
    mask <0)c3 |= mask;
    if (i<0)mask <<=1;

  15. Corpius
    June 28, 2012 at 20:39

    strange, it does not seem to work. I’ll post it on the TPA forum. Look here:

    http://www.twistedpearaudio.com/forum/yaf_postsm15482_Arduino-for-controlling-the-Sabre-DAC.aspx#post15482

    Sorry for polluting your blog 😦

  16. Anonymous
    July 15, 2012 at 09:09

    Hi there, does sb know if there is a chance to program a universal remote controller with a 4 digit code of Apple Remote for Macbook? Unfortunately my universal remote does not have learning function. Would apprieciate your help.

  17. Anonymous
    November 18, 2012 at 09:33

    Hi,
    I can’t find anywhere answer for this 😦
    Can we use Apple remote (with your code) for navigation through Buffalo menu or this code supports Apple remote only for volume control?
    Thanks.

    • BlgGear
      November 19, 2012 at 00:57

      The code recognizes all the codes (buttons) from the remote, but only responds to three codes (up, down and center). The reason is that for setting all the parameters, it doesn’t make much sense because you can’t see the display at a distance. However, changing the input selection makes sense as Corpius is doing in his code

  18. November 18, 2012 at 10:02

    Anonymous :
    Hi,
    I can’t find anywhere answer for this
    Can we use Apple remote (with your code) for navigation through Buffalo menu or this code supports Apple remote only for volume control?
    Thanks.

    The original code does not support full control. It can however be added quite easily when you have some experience in coding. I`m currently busy re-writing the code in a way that gives me full control. Look here: http://www.youtube.com/watch?v=7rmGwdtKHyo and here: http://www.diyaudio.com/forums/digital-line-level/221559-es9018-i2c-controller.html
    There is also no code for selecting inputs for the Buffao III. For some example code look here: http://ce-designs.net/index.php/manuals/7-buffalo3-arduino-input-selection

  19. November 24, 2012 at 20:29

    Hi.

    Do you know if it’s possible to use the Apple remote to control the volume of an integrated amplifier that doesn’t natively support remote control?

    I have a Yaqin MC-10t.

    Thanks very much!

    • BlgGear
      November 25, 2012 at 08:40

      I depends how you plan to add the remote control. If you are planning on changing the potentiometer with a motorized one, then you will to study how Arduino can control a motorized potentiometer.

  20. Daniel S
    January 23, 2013 at 12:43

    What kind of IR receiver should I use with this? Thanks.

  21. Daniel S
    March 7, 2013 at 12:11

    I can’t seem to find any information about the repeat codes. I have gotten this to work with the PIC MCU I am working with but not the repeat codes. Any help is appreciated.

    • BlgGear
      March 7, 2013 at 19:19

      There is no code, just pulse distance. Look at the code.

  22. DejanM
    April 5, 2013 at 14:38

    BigGear, I read the text but I still do not understand how you get for example from 30H for down to 06H ? If I simply remove the eight bit or if I shift it right or left it doesn’t work …

    • BlgGear
      April 5, 2013 at 15:31

      I don’t see 30H in the codes. But yes, you simply remove the 8th (rightmost) bit, and the remaining 7 bits are the same for all Apple remotes.

  23. DejanM
    April 5, 2013 at 15:49

    You mentioned it: 30 Hex for down arrow button. Justin mentioned it, too. I have that, too. And then by removing 8-th bit you cann’t get 06H … or I am missining something important ….

  24. Daniel S
    April 5, 2013 at 15:56

    You are reading the bits in the wrong order. LSB instead of MSB, or MSB instead of LSB
    I think.

  25. DejanM
    April 5, 2013 at 16:04

    LSB comes first. So 30H means binary: 0000 0011. Is that correct ?

    • BlgGear
      April 5, 2013 at 16:35

      That would be 03h. If you discard the LSB, then you will have 01h

  26. DejanM
    April 5, 2013 at 16:54

    Exactly. Than 30H is: 0011 0000. When we remove 8th bit than remains: 001 1000 which is 18H. This is also not 06H. So how do you come to these numbers in case when you have codes that Justin posted here ?

  27. November 14, 2013 at 10:15

    WOW just what I was searching for. Came here by searching for apple blossom dollhouse interior

  28. cu6apum
    November 14, 2013 at 21:08

    Well, didn’t look good for me. (NO CRITICISM! You’re doing a nice job). Double while cycle sometimes makes the loop wait too much, and not react to other events.
    I’ve redone the same with IRremote lib, and the code looks really short and nice. In addition I can handle two-sequence buttons, and choose which keys can repeat, and which ones cannot.
    Highly recommend.

    • BlgGear
      November 17, 2013 at 00:46

      Thanks for your comment. Good to know that the double while loop may be time critical in some applications. Here it is not…
      I’ll review the code and see if it can be optimized…
      My code can also define which keys can repeat and which cannot. Two sequence buttons can also be handled in the case statements.
      The code with the IRremote library may be nice and short, but you still need the install the library 🙂

  29. October 9, 2014 at 23:31

    why the page manipulate my post? here again:

    its easy to clean the Apple Remote code from the Apple ID and parity with this code…

     mask = (unsigned long)mask << 17;    // Der Tastencode wird herausgefiltert...
    mask = (unsigned long)mask >> 25;    // Der Tastencode wird herausgefiltert...

    mask is the Apple Remote code in a unsigned long variable!

    • BlgGear
      October 10, 2014 at 19:46

      Thanks for your contribution…

  30. John Gilmour
    January 30, 2015 at 16:31

    Is it possible to reprogram the Apple remote so we can control other devices?

    • BlgGear
      January 30, 2015 at 17:32

      Not possible

      • October 28, 2018 at 03:49

        It is possible, I have my silver apple remote and Lampizator DAC setup so that I can change channels and volume.

  31. jaredr
    March 31, 2016 at 13:43

    Is there an IR code for the “Home” button on the Gen4/Siri remote?

  32. gus
    July 13, 2016 at 14:02

    For the Mac that does not have anymore the built-in infrared receiver, you can use the SmartGUS. Very useful to be back again to make presentation and control iTunes or VLC.

  33. Hayo
    July 31, 2016 at 19:45

    I can’t seem to get the apple remote working with the buffalo II and code version B11f.

    I’m using the TSOP32438, pin 1 connected to arduino digital 3, pin 2 to arduino 5v and pin 3 to arduino GND. With my DMM I measure +5V between pin 2 and pin 3 and there is continuity between the arduino and pin 1.

    Also checked if the remote is putting out signal. Any idea what might be wrong? Dead IR receiver perhaps?

    • Hayo
      July 31, 2016 at 19:56

      Did some more testing, IR receiver seems to be working. When measuring between pin 2 (+5v) and pin 1, I see an output on my DMM when I press the remote.

    • Hayo
      August 1, 2016 at 12:34

      Now it is working occasionally, but it does the same thing for all the buttons (turning volume down). Any possible explanation for this?

  34. gus
    August 1, 2016 at 13:08

    Can you try to put a pull-up between pin 1 and +5V. I already had a IR receiver that needed that.

    • Hayo
      August 1, 2016 at 13:27

      It is already enabled in the code.

      pinMode(REMOTEPIN, INPUT); // Pin for IR sensor
      digitalWrite(REMOTEPIN, HIGH); // Enable pull-up resistor

  35. gus
    August 1, 2016 at 13:36

    I don’t no anything about Arduino. Is this sure than writing a 1 in a input port will turn on the internal pull-up ?

    • Hayo
      August 1, 2016 at 14:07

      Yes, I’m pretty sure

      • Fredrik Aandal
        August 22, 2016 at 19:36

        Did you fin a fix for your problem? Im having the same struggle now. It works now and then at volume down.

  36. Fredrik Aandal
    August 22, 2016 at 12:04

    I’m a Arduono newbie but have got everything else but the remote to function.

    The receiver respons when I press buttons on my Apple alu remote, but nothing happens at the Arduino side.

    I have double and triple checked my connections.

    • Hayo
      August 22, 2016 at 20:42

      I haven’t found a solution yet. Someone on diyaudio did find a solution for the ES9018K2M, but that code is a bit different than the ES9018 code.

      http://www.diyaudio.com/forums/digital-line-level/295201-es9018k2m-arduino-ir-remote-issue.html

      • Fredrik Aandal
        August 23, 2016 at 05:28

        Thank you. I will look into it.

      • Hayo
        August 23, 2016 at 09:40

        What DAC are you using?

      • Fredrik Aandal
        August 24, 2016 at 19:51

        Buffalo III 🙂

      • Fredrik Aandal
        August 27, 2016 at 15:33

        Success! Thank you for pointing me in the right direction! 🙂

      • Hayo
        August 27, 2016 at 15:34

        Great! Could you please let me know what you did?

      • Fredrik Aandal
        August 27, 2016 at 17:14

        I downloaded the modified sketch “k2m” in your link to diy forum.

        Then I used a serial monitor sketch to find the correct ir code for my remote and pasted it into the volume up and down case in k2m and it worked right away.

        So there is obviously some bug, or probably just my lack of knowledge that makes the B11f code not to work.

        At the moment I must figure out how to implement the correct changes to B11f code.

        The k2m sketch has some configuration that makes it not work with my setup. I2S 6ch in and 6ch out of Buffalo III. B11f work perfect “out of the box” except IR.

      • Fredrik Aandal
        August 27, 2016 at 17:24
      • Fredrik Aandal
        August 28, 2016 at 17:52

        Found the bug in B11f!

        Timing must be increased from 15k to 20k.

        Insert this line:
        while((duration=pulseIn(REMOTEPIN, HIGH, 20000)) < 2000 && duration!=0)

        I hope owner of the code will implement the edit.

      • Hayo
        August 29, 2016 at 13:23

        Wow, thanks a lot! That worked indeed, great find!

  37. Fredrik Aandal
    August 22, 2016 at 18:07

    I now also tested with serial monitor and IR responds with hex 77E150C1 for volume up. SO for some reason hifiduino dont read it correct. Any help please?

  38. September 14, 2016 at 15:11

    Solar industry

  39. September 14, 2016 at 15:24

    buy phentermine

  40. September 14, 2016 at 17:06

    Maryland cable services

  41. September 14, 2016 at 17:16

    gaver til ham

  42. September 14, 2016 at 17:22

    szklarska poreba domek

  43. September 14, 2016 at 18:27

    Facebook ads cost

  44. September 14, 2016 at 19:09

    lexmark toner cartridge

  45. Anonymous
    September 14, 2016 at 21:27

    These goddamn fucking useless bots – all they do is put stupid brand names somewhere on the web so they can claim they posted something somewhere and get money – well annoying all of us. It would be great if you could figure out fthe idiots that hired these people

  46. September 17, 2016 at 07:26

    Hiya! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly? My blog looks weird when browsing from my iphone 4. I’m trying to find a theme or plugin that might be able to fix this problem. If you have any suggestions, please share. Cheers!

  47. December 4, 2016 at 13:29

    Hello.
    I used the code, but I can not when I hold down the button to raise the volume, only works pulse, what can I change?

  48. Derek
    December 12, 2016 at 23:00

    Try raising the 20000 referenced in Fredrik’s post above to 35000.

    This is the timeout for the ‘pulseIn’ command and, for some reason, the new IDE (1.6.13) does not work for me on the original 1.5msec timeout (15000). On raising it to 3.5msec (35000) the repeat function works when the buttons are held down. Timing issues I guess.

    Curiously, if you install the old 1.0.6 IDE, the original 15000 timeout works fine.

  49. gm rimaan
    September 6, 2017 at 08:58

    You make,china tv remoot?

  50. October 21, 2018 at 07:33

    It’s best to participate in a contest for the most effective blogs on the web. I’ll suggest this site!

  51. WAP
    September 16, 2022 at 05:44

    Hi there. I am trying to use the Google Tv Remote to control my stereo amplifier. It is built and designed locally in South Africa. It has a PIC16F627A chip that is paired with an apple aluminum remote to control the amplifier. I am looking for the code that the PIC16F627A chip uses to pair with the apple remote. If i can find out what OTHER amplifiers use that same code i can select it in the setup of the Google TV remote settings. I hope this makes sense.

  1. June 6, 2011 at 01:42
  2. October 21, 2011 at 00:37
  3. May 18, 2012 at 06:54
  4. November 12, 2012 at 06:29
  5. June 14, 2019 at 09:22

Leave a reply to DejanM Cancel reply