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]
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.
Clearly the correct interpretation of the command code is 7-bit
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.
Hello, thanks for sharing. Perhaps it was kind of hard to detect the “flat” doughnut pad for some people…
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.
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…
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.
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.
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…
I have the same codes as Justin. Can you please show me how do you get these codes from what Justin has ?
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.
With the latest code, using 7 bits, the codes from all the remotes are the same. See text.
If anyone is finding this literally 9 years ago, these codes work with the “tasmota-ir” ESP8266 firmware. Enjoy! And thanks @justintect!
*9 years later
That is one odd set of codes. Thanks for sharing…
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 !
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.
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.
Oh, press and hold MENU + PLAY/PAUSE on any Apple remote to change (roll) its ID.
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. 🙂
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
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
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;
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 😦
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.
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 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
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
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!
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.
What kind of IR receiver should I use with this? Thanks.
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.
There is no code, just pulse distance. Look at the code.
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 …
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.
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 ….
You are reading the bits in the wrong order. LSB instead of MSB, or MSB instead of LSB
I think.
LSB comes first. So 30H means binary: 0000 0011. Is that correct ?
That would be 03h. If you discard the LSB, then you will have 01h
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 ?
WOW just what I was searching for. Came here by searching for apple blossom dollhouse interior
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.
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 🙂
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 is the Apple Remote code in a unsigned long variable!
Thanks for your contribution…
Is it possible to reprogram the Apple remote so we can control other devices?
Not possible
It is possible, I have my silver apple remote and Lampizator DAC setup so that I can change channels and volume.
Is there an IR code for the “Home” button on the Gen4/Siri remote?
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.
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?
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.
Now it is working occasionally, but it does the same thing for all the buttons (turning volume down). Any possible explanation for this?
Can you try to put a pull-up between pin 1 and +5V. I already had a IR receiver that needed that.
It is already enabled in the code.
pinMode(REMOTEPIN, INPUT); // Pin for IR sensor
digitalWrite(REMOTEPIN, HIGH); // Enable pull-up resistor
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 ?
Yes, I’m pretty sure
Did you fin a fix for your problem? Im having the same struggle now. It works now and then at volume down.
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.
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
Thank you. I will look into it.
What DAC are you using?
Buffalo III 🙂
Success! Thank you for pointing me in the right direction! 🙂
Great! Could you please let me know what you did?
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.
Link serial monitor: https://arduino-info.wikispaces.com/IR-RemoteControl
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.
Wow, thanks a lot! That worked indeed, great find!
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?
Solar industry
buy phentermine
Maryland cable services
gaver til ham
szklarska poreba domek
Facebook ads cost
lexmark toner cartridge
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
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!
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?
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.
You make,china tv remoot?
It’s best to participate in a contest for the most effective blogs on the web. I’ll suggest this site!
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.