The Linux Infrared Remote Control (LIRC) Project

Want to build an infrared remote control for your laptop, MythTV or hidden computer? Learn how.
The Hardware

It doesn't matter which way you install the resistor, but for all of the other parts, position matters. The capacitor has a minus sign beside one of the wires to identify which wire is which. The diode has a black line at one end to identify which end is which. When looked at from above, the 78L05 voltage regulator looks like a half moon, and where the wires are relative to the flat sides matters. There is a lens on one side of the infrared detector, and where the wires are relative to that lens counts. Numbers should be molded beside the pins on the DB9 connector.

The Tools and Parts Laid Out for Building a Detector

Perforated board, or perfboard, is a wonder for hobbyist electronics work. It is a thin piece of non-conductive, heat tolerant plastic with holes drilled into it at 0.1" intervals. I use perfboard that has small copper rings bound to the board around each hole, which helps ensure the parts stay attached to the board.

The first step is to cut a piece of perfboard down to the right size. I used a small hacksaw for this job, but a Dremel or other small power-cutting tool can be used. We need a grid that is 4x5 holes, so cut along a line six holes in from one edge and five holes in from the other edge.

The first step is to attach the perfboard to the female DB9 connector. Place the board so that it is between the top and bottom row of pins and the copper rings are lined up with the solder cups for pins 6 through 9. Then, solder pins 6, 8 and 9 to the copper rings on the board.

The Start of Construction with the Perfboard Attached to the DB9

You need to thread the wire from the end of the diode that does not have the black line on it through a hole (C1) in the perfboard and connect it to pin 7 in the DB9 connector. Trim the diode wire so it fits into the DB9 connector. When positioning the diode, remember that you don't have a lot of space above the perfboard, so keep everything close to the board. Clip the heat sink to the wire that goes into the diode and solder it into the DB9 connector. Wait a minute for things to cool down, and then solder the diode to hole C2. Run the wire from the black line end of the diode through hole D1, up to hole D2 and trim off the excess wire. Reposition the heat sink, solder hole D1 and then remove the heat sink.

The resistor goes in next. Place one end in hole D2 and the other in D3. Remember that you need to keep the resistor close to the board, but leave enough room for a wire to get into hole D4. The resistor has a high heat tolerance, so I skipped using the heat sink for this part. Position the resistor wire that comes in through hole D2 so that it ends by hole C2, and trim the excess. The resistor wire that goes into hole D3 should end by hole D4. Leave hole D3 alone for now, and solder hole D2.

Using a piece of wire trimmed from the diode, we make a little jumper. The wire needs to be bent so that one end goes into pin 5 of the DB9 connector, through hole B1 and then up, so it's just touching hole B4. Solder pin 5 in the DB9 connector and hole B1.

Now, put the voltage regulator into holes A2, A3 and A4. Remember to pay attention to the orientation of the regulator. Leave the wires on the component side long enough that you can clip in the heat sink and later fold the voltage regulator over, so it fits close to the board. Clip on the heat sink, solder holes A2, A3 and A4 and then remove the heat sink.

Part Way Through Construction with the Heat Sink in Place

The next part is the capacitor. Pay attention to which wire is negative, and leave enough space for the heat sink and to fold the capacitor over. Clip on the heat sink, solder holes A3 and B3 and remove the heat sink.

Our second jumper comes next, made from a short piece of hook-up wire about 0.75" (2 cm) long. Trim the insulation off both ends and solder one end into pin 1 of the DB9 connector. The other end goes to hole D4. It may be a tight fit, and you may need to shift the resistor to fit things, which is why the resistor wasn't soldered earlier. Once the jumper is in place, solder the resistor at hole D3.

Two Almost-Complete Infrared Detectors

Finally, we come to the infrared sensor. You are going to have to do some test fittings to make sure that the leads are long enough so the sensor is just behind the hole in the plastic DB9 hood. This fitting also may require that you push the capacitor slightly to one side, out of the way. Once the length is adjusted, bend the wire that goes in though hole C4 so it goes across to hole D4. Clip on the heat-sink, solder holes A4, B4, C4 and D4 and remove the heat-sink.

Now you might want to take a minute to clean up. Apply some flux remover, per the manufacturer's instructions, to the solder side of the perfboard to clean away any flux residue left from the assembly.

The last construction job is to assemble the DB9 hood around the project. Once that's done, plug the interface into the serial port on your computer and start the machine. That finishes the hardware part of the project.

A Close-Up of a Completed Detector



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

A minor detail, but it's

Anonymous's picture

A minor detail, but it's called a DE9 connector, not a DB9 :)

Actually, it is called a DB9

Anonymous's picture

Actually, it is called a DB9 connector... but again... minor point.

I'll jump in on this just

Anonymous's picture

I'll jump in on this just because I can :)

IR Detector

Anonymous's picture

I Could not find where the software is to use with the IR Detector. Do I just download the mythtv software or is there a specific software for the IR detector. I just need the software for the IR detector. I do not plan to use the myth tv stuff.

IR Detector software

Mike's picture

It's lirc. Go to for more information.

For a better usage of the 5V regulator

domi's picture

The capacitor should be connected to the input pin of the regulator instead of the output pin.

This way, you'll get a much better 5V supply.

creative infra

Nitin's picture

Hi Did you manage to get it working with an creative infra drive. I have been struggling for the same for days now. It requires it to have the ide-scsi module loaded; and then use scsi inquiries to do the same. Would this work with oldish mother boards / very old Creative Infra drive ??

Actually, you need a cap at

Anonymous's picture

Actually, you need a cap at both the input & the output for regulation and stabilty, respectively. A 1uF at the input and a 0.1uF at the output is fine for this.

Make me one!!

ErRoNeUs's picture

That serial device looks really cool. And while it appears to be simple enough, I was born with five thumbs on each hand and soldering irons hate me. Would there be any volunteers to make one for me? :) (How can someone contact me though? I left my valid email address but it won't show publically...)

maybe, i don't know, type it

Anonymous's picture

maybe, i don't know, type it in the big comment box

Check out this one:

Anonymous's picture

Check out this one:
I added a little led, to blink when I receive some IR signal (this is great for debuging and every days job)

Why not radio?

Anonymous's picture

IR is quite anitquated. It's cool for TV's and video where you have line of sight, but not much use for things like controlling music from another room.

Why not go radio? Or WiFi? Or Bluetooth? Linux should take the lead on some of these instead of just playing catchup.

RF remote with Lirc

Anonymous's picture

I use an rf remote, the X10 Mp3Anywhere remote with Lirc.

Where do you get the appliances ?

Anonymous's picture

1) Where do you get a 'radio' capable remote control ?
2) Where do you get a 'WiFi' capable remote control ?
3) Where do you get a 'Bluetooth' capable remote control ?

LIRCD allows you to interact with a Linux based computer using the same technology as you use to interact with your TV/VCR/DVD/Stereo/... equipment.

If you were to say use something like a Nokia 770 as your remote (hope the battery does not go flat) to control all your home AV equipment, then you need something to convert it's signals from Radio/WiFI/Bluetooth back to IR to allow you to interact with the end appliances.

IR may be old, but it's cheap, pervasive, reliable, secure, and proven to work.


Lansing's picture

I think you might need to re-evaluate that statement:

A simple brute force attack reneders every "secure" ir system useless. For example, most garage door systems work off sending an 8 bit message to the reciever. If you brute force this, that means that you only have to send out 256 guesses ( do you know how fast your computer can count to 256). Furthermore, the most "secure" ir systems use 16 bits which can be brute forced with 64k attempts which at most will take about 3 mins to break. Just a little food for thought.

Antiquated but affordable

pbardet's picture

I suppose the problem is to find a device that will be able to send information to the PC via your preferred method. Currently, finding an infra-red remote is fairly easy, not to mention cheap.

Sure it's a great ID. I personnally love my UHF remote on my PVR, but finding those remotes is not easy, and I didn't even look for an appropriate receiver.