Tutorials with Arduino: Arduino controlled by Apple Remote (updated)

Controlling Leds by the Apple Remote (video updated using the Iphone Photostudio for Arduino Stand)

The idea originated because i´m learning a lot on Led driven home applications for lighting, and the first project i´m doing is led lighting for the kitchen (indirect). The commercial systems are very expensive, specially with dimmers and remote controls, so why not Arduino System?

The programming i thought would be very difficult for the IR remote, but it was very simple and fast thanks to this library:  IRremote that you can download from this link.

Part List:

  • 3 x LED
  • 3 x resistencias 220 ohm
  • 1 x IR receiver transistor
  • 1 x placa Arduino UNO
  • 1 x Apple Remote (funciona con cualquier control IR, sólo que me gusta el apple personalmente).
  • 1 x breadboard


The conexions are made following the attached schematics; in this case i used digital input 11 to receive the info from de IR receiver, and the 4, and 5 as digital outputs for the LEDS and the 9 as analog output for the dimmer LED. The only difference between the 4, 5 and 9, is that in one of the LEDS i want to control de intensity (dimmer), using more buttons from the Apple Remote.

We are using the PLay button to start the middle led, the << (rev) button for the left led and the >> (FF) button for the right led. The + and – buttons will be used to change the intensity of the middle led.

/* Code for using the Apple Remote Control on Arduino
To be used with 3 leds, port 4 and 5 (left and right), port 9 center.
The + and - buttons act as dimmers on the port 9 led.
The IR receiver is installed on port 11.
On the center led (PLAY button) yo can switch on and off with the same button.
#include <IRremote.h>

int RECV_PIN = 11;

//Assigning ports
int ledPLAY = 9;
int ledFF = 4;
int ledREV = 5;
//Assigning states (on = 0, off = 1)
int ledPLAYst = 0;
int ledFFst = 0;
int ledREVst = 0;
//Dimmer step
int paso = 10;

IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
  Serial.println("Comenzamos Lectura");
  irrecv.enableIRIn(); // Start the receiver
  pinMode(ledPLAY, OUTPUT);
  pinMode(ledFF, OUTPUT);
  pinMode(ledREV, OUTPUT);
void ledCLEAR(){
    digitalWrite(ledPLAY, LOW);
    digitalWrite(ledFF, LOW);
    digitalWrite(ledREV, LOW);
   //ledPLAYst = 0; 
int brightness = 0;
void loop() {

  if (irrecv.decode(&results)) {
    irrecv.resume(); // Receive the next value
    if (results.value == 2011242556)
    if (ledPLAYst == 0) {
    analogWrite(ledPLAY, brightness);
    ledPLAYst = 1;
  else {
    analogWrite(ledPLAY, 0);
    ledPLAYst = 0;
    else if (results.value == 2011291708)
    digitalWrite(ledFF, HIGH);
    else if (results.value == 2011238460)
    //digitalWrite(ledPLAY, HIGH);
    //digitalWrite(ledFF, HIGH);
    digitalWrite(ledREV, HIGH);
    else if (results.value == 2011287612)
    if (brightness < 255 - paso){
    brightness=brightness + paso;}
    else {brightness = 255;}
    analogWrite(ledPLAY, brightness);
    else if (results.value == 2011279420)
    if (brightness > paso){
    brightness=brightness - paso;}
    else {brightness = 0;}
    analogWrite(ledPLAY, brightness);
    else if (results.value == 2011250748)
    else {Serial.println("Otro");}


Related Posts

  • Tutorials with Arduino: Led controlled by photo sensorThis has been my first project  Arduino UNO. It´s a very simple project, controlling the intenisty of a light with a photoresistor. As darker it gets, the stronger the light will get, and the brighter it gets, the light goes down. Here is a video of the project working: http://youtu.be/pCRhzh3d6ww…
    Tags: the, tutorial, led, dimmer, arduino
  • Tutorials with Arduino: The Knight RiderA very dumb and simple, but really good looking example of the Arduino UNO and LEDS. The effect of the Knight Rider Car. The idea with this example is to learn how to work with arrays on the code. (see the code below) Here is the project working on video: http://www.youtube.com/watch?v=vFqCYGdtPyY…
    Tags: the, arduino, tutorial, led, diy
  • Tutorials with Arduino: Temperature by colors.This is a very simple proyect too. We are measuring the ambient temperature with a Thermistor (4,7k) and showing the results by an RGB Led. We are assuming the cool temperature is Blue and the hot is Red. You can see it working in this video: http://www.youtube.com/watch?v=uouKAKhgowQ The part list…
    Tags: the, led, and, tutorial, diy, arduino