Kenwood RC-405 remote control meets an Arduino Uno

Show of hands: how many of you think remote controls for car stereos are ridiculous?

Okay, maybe I’m the only one. Regardless, I have one and there’s no way in hell I’m ever going to use it in or around my car, so I may as well put it to good use elsewhere.

Like, maybe to control an Arduino? Sure, why not.

Remote, IR receiver, Arduino, oh my…

I’ve used remote controls with my Arduino Uno already. Nothing special, but hey, it worked. Last time it was a PlayStation2 remote control; this time, it’s my Kenwood RC-405 remote control, IMO one of the smallest, coolest, and most utterly and completely pointless remotes in existence, which of course makes it a perfect dedicated Arduino remote.

Anyone trying to tie a remote to an Arduino will start his/her journey by searching for a code listing, something that tells you what code is sent by each button on the remote. Codes for many common remotes are available all over the Internet. The RC-405, however, is not a common remote. No, this puppy required some extra love, specifically I needed to figure out the codes all by my lonesome.

Various paths exist to achieve this goal. A common method employs a Linux application called LIRC which utilizes any of a variety of different IR receivers to read codes from your remote. It’s a decent option, but I didn’t go there. I already have an Arduino and a receiver, and the library I used to write my previous Arduino/remote experiment reads IR codes just fine, so I opted to just use what I already had.

Here is the full list of thingies I used to make this dream come true:

And to make wiring simpler because IR receivers have short posts that don’t stretch across Arduinos,

  • A small breadboard
  • Wires that are breadboard-friendly (i.e. solid core, stiff)

Note that this is all stuff I needed for a remote controlled Arduino anyway, so no new/special hardware was required to scan the remote control codes. Win win. Also, I’ll note something that may be intuitive but is worth making official: there is nothing in these instructions that require a Kenwood RC-405 remote. Just about any remote control will do (exceptions exist, but I doubt they’ll bite you if you try this).

The process is sort of straightforward. Note that I assume this is not your first experience with an Arduino. If it is, please stop here and get familiar with how the Arduino IDE and Arduino hardware work together, then come back.

1. Install the IRremote library. This should not be done in any Arduino IDE directories! Just create your own personal directory to hold Arduino libraries and put the files there. I believe when you create your sketch, before you compile it you’ll need to go to the Sketch | Import Library | Add Library menu item to actually add the IRremote library.

2. Create a new sketch using the following IRrecvDemo code, written by the author of the IRremote library (Ken Shirriff), not me:

/*
 * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
 * An IR detector/demodulator must be connected to the input RECV_PIN.
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * http://arcfn.com
 */

#include <IRremote.h>

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
}

void loop() {
 if (irrecv.decode(&results)) {
 Serial.println(results.value, HEX);
 irrecv.resume(); // Receive the next value
 }
}

3. Set up the Arduino and IR receiver. The labeling for your IR receiver will say what post goes where. If you use the same one I used, if you look directly at the front of the receiver, the posts from left to right are signal, ground, and positive power (VCC to some folks). Connect the signal post to pin 11 on the Arduino (that’s the pin the sketch above expects you to use), connect ground to one of the GND pins on the Arduino, and connect the positive power post to the 5V pin on the Arduino.

The breadboard and wires that I mentioned earlier? Yeah, you’re going to need them here unless you want to solder wires to the posts on the IR receiver. If you don’t know how breadboards work, there are instructions on the Internet.

4. Connect your Arduino to your computer and compile/upload the sketch. I assume you already know how to do this from the Arduino IDE.

If all goes as planned, you’re in business. Open the serial monitor by clicking on the magnifying glass icon in the upper-right corner of the Arduino IDE and start pushing buttons on the remote. You should see hexadecimal codes appear in the serial monitor.

The hexadecimal codes are the codes your remote sends when each button is pushed. Save these somewhere so you never, ever have to do this again. Of course, indicate which button was pushed to generate each code. Note: if you see “FFFFFFFF” after pushing a button, that just means the previous code was repeated. Feel free to ignore all “FFFFFFFF” codes.

In the interest of sharing, here’s the set of codes that I got from my RC-405 remote control:

9D6228D7 Volume up
9D62A857 Volume down
9D62C837 SRC
9D62A15E Return
9D626897 ATT
9D62718E Exit
9D62E817 AUD
9D62E11E Up
9D62619E Down
9D6250AF Previous
9D62D02F Next/+
9D62708F Enter/Play/Pause
9D6230CF */AM/-
9D62B04F #/FM/+
9D62807F 1
9D6240BF 2
9D62C03F 3
9D6220DF 4
9D62A05F 5
9D62609F 6
9D62E01F 7
9D6210EF 8
9D62906F 9
9D6200FF 0
9D6249B6 Phone
9D62F00F DIRECT

I can’t say for sure that these codes work with anything other than the Arduino IRremote library, so buyer beware. This post is about Arduino control so I’m not overly concerned.

In case it’s of any interest, here’s a sloppy old sketch I “wrote” that turns an LED on and off using the “square” button on a PlayStation2 remote control. This, without a doubt, borrows heavily from a sketch by the IRremote author. Feel free to adapt it to your own needs. (The remote control button code is highlighted in bold.)

#include <IRremote.h>

/*
 * IRremote: IRblinkLED - light up an LED using a Sony PS2 remote
 * An IR detector/demodulator must be connected to the input RECV_PIN.
 * Make sure the LED variable points to the POSITIVE pin of the LED
 * Version 0.1 January, 2011
 * (Probably borrowing heavily from code written by Ken Shirriff, author of IRremote)
 * Copyright 2011 Erik Ratcliffe
 */

#define LED 13         // Positive pin of the LED
#define BUTTON 0xFAB5B // The button that we want to find (Sony PS2 remote "Square")
int RECV_PIN = 11;     // Receive pin of the IR detector/demodulator
int val = 0;           // Store the state of the LED

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  pinMode(LED, OUTPUT); // Set up the LED as output
  Serial.begin(9600);
  irrecv.enableIRIn();  // Start the receiver
}

void loop() {
 if (irrecv.decode(&results)) {
   if (results.value == BUTTON) {
     if (val == 0) {
       digitalWrite(LED, HIGH);
       val = 1;
     } else {
       digitalWrite(LED, LOW);
       val = 0;
     }
   }
   delay(100);
   irrecv.resume(); // Receive the next value
 }
}
This entry was posted in hardware.

One Response to Kenwood RC-405 remote control meets an Arduino Uno

  1. atrain says:

    Thanks for this post!

    I bought a car with a similar generation Kenwood radio (DDX372BT) which uses a similar remote (rc-dv331). These remote codes worked perfectly with the sendNEC() function.

    (My car did not include the remote, and the radio doesn’t interface with the steering wheel controls, so I’ll be using these to build my own.)