Arduino-based IR controller


This project is an exploration of Ken Shirriff’s Arduino-IRremote library. My initial goals with this Arduino library were:

  1. Receive and document the hexadecimal infrared codes corresponding to remote button presses
  2. Manually transmit infrared codes to activate various device functions
  3. Use motion detection functionality to trigger device functions

The breadboard image at the top of this post contains three key parts: an output infrared LED (top left), an input pushbutton (center), and an input TSOP382 infrared receiver (right of center). I followed a very helpful SparkFun tutorial as a reference for these experiments; the recommended circuit diagram is copied below:

Goal 1: Receive IR codes

With the circuit assembled, I used the included IRrecvDemo.ino example to capture IR remote transmissions and print to the serial monitor. Below (left) is a sample screenshot of various button presses from my Ambery security switcher’s remote control. I tabulated each button and its corresponding hexadecimal code for future reference, below (right):

Goal 2: Transmit IR codes

After documenting these codes, I then attempted to control the device using the Arduino and IR LED. I tested the IRrecord.ino sketch, which allows the user to capture an IR code with the Arduino and re-transmit it with the IR LED upon pressing the pushbutton. There were some intermittent issues with the button — perhaps the schematic wasn’t current with the example code — but the sketch proved functional! I hunted down the important bits needed to try manually transmitting an IR code: irsend.sendNEC(), which expects an unsigned long data (the hex code) and int nbits (# of bits). I chose the Freeze function, which has a hexadecimal code of 4FBE817, and nbits = 32.

Goal 3: Freeze frame upon motion detection

To transmit the code upon motion detection, I modified my motion detection Arduino sketch to issue a freeze frame command instead of toggling an LED, in addition to printing a status message to the serial monitor. As shown in the video below, when my hand moves out of the masked right-hand side of the video frame, the Arduino transmits a freeze toggle command.

When the motion of my hand is detected in the left side of the frame, a Freeze Frame command is issued via an IR LED.

Next Steps

The sensitivity settings need to be adjusted, or perhaps debounce logic may be helpful in fine-tuning the response of the motion detection. This initial milestone lays the groundwork for a wide array of potential applications. In particular, I am interested in an interactive installation that affects the displayed video upon viewer movement, notably, playback from and recording to a VCR.

One comment

  1. […] Previously, I demonstrated the basic functionality of Ken Shirriff’s Arduino-IRremote library by controlling the Freeze Frame function of my security recorder. This was relatively easy to accomplish with the provided examples and by having access to the remote I wished to emulate. However, I have 2 thrifted VCRs that did not come with remotes, and I want to use the Arduino to send Play, Stop, Record, Fast-Forward, and Rewind commands. […]


Leave a Reply

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

You are commenting using your 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

Create a website or blog at
%d bloggers like this: