Home > Arduino, Code > Apple Remote Control for Buffalo II DAC

Apple Remote Control for Buffalo II DAC

November 26, 2010 Leave a comment Go to comments

I have programmed for the Apple Aluminum Remote Control to control the volume in the Buffalo II DAC. I think this is the nicest remote control available for the application. It can be purchased at any Apple Store for $20 or so.

You can find the code here: Code for Buffalo II vB05

Note: for the latest code, check the “CODE” tab. The Apple remote code is part of the code that controls the DAC

For the manner I used to read the signal pulses from the remote, it required a modification to the Arduino pulseIn library. I defined a replacement pulseIn function with an additional time out parameter. This is explained in the code and also in the Arduino forums. It is further explained here.


You can probably use any IR receiver you can find. I had scavenged some IR receivers from old electronics and they work but are too sensitive to ambient light, so I get a lot of spurious signals. The code will only accept valid sequences, so spurious signals will be ignored. However it is not a good idea to have the processor continually process spurious signals.

38 Mhz, AGC4 type

If you are buying one, get one that is designed for remote control and with a frequency of 38 KHz because the NEC protocol that is used by the Apple Remote is designed for 38 KHz operation. Further, the “AGC4” type is best for the NEC protocol. According to Vishay documentation, “AGC4 is optimized for most common remote control standard applications in very noisy environments (including dimmed LCD backlightings)”.

It is also worthwhile to note that the pin assignment for IR receivers is not standardized so you need to know the exact pin assignment of the receiver. If you need a recommendation, the Vishay TSOP32438 [datasheet] is a good device. The TSOP32838 will also work. The only difference is that it is “not designed for noisy environments”. If you do a search in Digikey or Mouser and confine the results to 38 MHz you will find many candidates.

Below is the connection diagram for the IR receiver


I like this picture I scraped from Soomal

  1. Branko
    December 3, 2010 at 13:41

    i am following your great projects for some time now recently i started to build a buffalo II dac and would like to add some kind of control. For the Remote control how do you add (and what kind off) a IR receiver to the arduino?
    thx a lot


  2. Hifiduino
    December 3, 2010 at 19:52

    You can check my previous OPUS implementation: http://hifiduino.blogspot.com/2009/04/adding-remote-control.html but I will add a new diagram for the current implementation later. Thanks for following. If you can suggest any improvements, let me know…

  3. David Quayle
    July 26, 2012 at 23:39


    I have been trying to use the apple remote to control some relays, what appears to be my major hurdle is getting the software to recognise the apple remote codes, I have used Ken Shirriff libraries & code to retrieve the codes and tried them I have also tried using all of the codes on your site but to no avail. I can get the relays to switch using any recieved signal but as you can images thats not going to be a winner for my DIY stereo setup.

    I feel like maybe I’m missing a Library or something, can you help please.


  4. David Quayle
    September 16, 2012 at 09:56


    I have noticed in your code you use the following line “digitalWrite(REMOTEPIN, HIGH); // Enable pull-up resistor.”

    I am using the same remote & IR receiver but different code, the problem I have is the remote doesn’t always respond & I’m wondering if I should be “enabling the pull-up resistor?” with the same line of code.

    Am I correct in saying the pullup resistor is internal to the Arduino/Mega?

    • BlogGeanDo
      September 16, 2012 at 14:16

      Yes, give it a try. Nothing bad would happen. The pull up resistors are built into the microprocessors in the Arduino boards. If I remember correctly, the output of the IR sensor is either high or low (never undefined), so perhaps that is not your problem. In my implementation, the remote always work. In fact it works “too fast” (so, by default I ignore the repeat pulses except for volume)

  5. David Quayle
    September 17, 2012 at 22:04

    “Enabling the Pull Up resistor” seems to have cured the issue, thanks.
    I have an analog input reading the values (5v to 0v) from a pot to get my volume readings, it is giving weird readings at high & low levels, should the analog input be made “HIGH” as well or is this only a digital Input thing.

  6. chryses
    December 15, 2012 at 01:53

    Slowing working my way to a Hifiduino Buffalo IIISE. While waiting for other parts to arrive, I stuck the Vishay TSOP34838 into a breadboard and fiddled around with it a bit. Looks as though I’m getting a massive amount of noise from my plasma TV (I’m ashamed to say that it took my forever to realize that the TV was the source of the noise). By ensuring the first and last 8 bits of the command match up with the expected Apple remote codes I’m able to suppress most of the errors, but I’m wondering if anyone has recommendations for another IR receiver that might be a better match for an environment with a plasma TV.

    • BlgGear
      December 15, 2012 at 16:38

      Very interesting find. According to specs, that IR receiver is supposed to “best matched” to the NEC-type protocol of the Apple Remote. Some IR receivers are encased in metal. Perhaps build a metal shield around it and only have a hole in the front?. I would also be interested in hearing if there are other noise resistant IR receivers

  7. sdo
    June 13, 2014 at 03:23

    It appears the diagram on the page does not match the recommended Vishay TSOP32438, which has a different pin out as per the datasheet ( 1 – Out, 2 Vs, 3 – Gnd).

    • David Quayle
      June 13, 2014 at 07:00

      yer they drive me crazy always changing the pin layout between the different receivers

  1. December 22, 2010 at 07:03
  2. May 11, 2011 at 05:04

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s