RS-232 Infrared Receiver in a Serial Connector (LIRC) Computer Remote Control

59,304

58

43

Introduction: RS-232 Infrared Receiver in a Serial Connector (LIRC) Computer Remote Control

About: Just a geek with a soldering iron...

This instructable intends to show you how to create a small & simple infrared (IR) receiver for your computer. The configuration of the software is beyond the scope of this instructable, but I use this receiver with LIRC (Linux Infrared Remote Control) in Linux. You can read more about LIRC and see the circuit diagram I used to build this at http://www.lirc.org/

Note that --I did not design this circuit-- and I wasn't the first to put the circuit into a D-sub connector... but I was the first to post an instructable on it, so hopefully someone will benefit from this : )

My total cost was about $1.50 because I had to purchase an IR receiver, but everything else I had lying around because I'm a computer guy/electronics geek.

Step 1: Parts Needed

Here are the parts I used, all of them were cannibalized from old projects or scavenged from the engineering lab except the IR receiver that I ordered from Mouser.

Parts List:
Vishay TSOP1138 IR Receiver
50v 4.7uF capacitor
4001 Diode
4.7K resistor
7805 voltage regulator (5 volts)

Parts Discussion
TSOP1138 IR Receiver: Most people use the Vishay TSOP 1738, but Mouser was out of those when I ordered and the 1138 is comparable... and it worked, so who cares : )

4.7uF capacitor: I used an axial 50v barrel (electrolytic) capacitor because I had one available and didn't want to spend 75 cents at Radio Shack. But, if you've got a 4.7uF ceramic disc capacitor, it would be a lot easier to fit inside the D-sub housing we're going to use. Also, since I used a 50v capacitor and we're only pushing 5v, it's going to have a pretty long rise time but it shouldn't affect the performance of our device too much.

7805 voltage regulator: I used a big one made by Motorola in the first one of these receivers I made and I had to clip the pins very short and clip and grind the top pole in order to get it to fit in the D-sub (see pictures of completed project). However, when I was digging around for pieces today, I came across a surface mount 7805 that I got from Texas Instruments as a sample years ago. It's tiny and perfect for this project. I'll definitely use it the next time I build one of these as it will cut the footprint of the circuit down tremendously. Both the large and small 7805's are labeled in the electronics closeup picture.

Step 2: Circuit Assembly

Once again note that I did not create this circuit diagram. It was made by Trimbitas Sori and can be found on his blog.

The only part of this diagram that may require a little explanation is the pins on the serial connector:
RS-232 Pinout :
1 = DCD (Carrier Detect)
2 = RXD (Receive Data)
3 = TXD (Transmit Data)
4 = DTR (Data Terminal Ready)
5 = GND (Ground)
6 = DSR (Data Set Ready)
7 = RTS (Request To Send)
8 = CTS (Clear To Send)
9 = RI (Ring Indicator)

As you can see from the circuit diagram, we're only using DCD (pin 1), RTS (pin 7), and GND (pin 5). I've included a second image on this page that shows the pin numbers and labels graphically, but all the 9pin D-subs I've ever worked with have been labeled (however microscopically). Note that this image came from an IRIX book, strangely enough. Just ignore the "not used" notes because we're totally going to use the DCD pin for our purposes : )

It's pretty hard to give you step by step directions on this part because our goal is to make the thing as small as possible in order to fit it in the D-sub connector. I'll give you a few pointers but it's going to be up to you to figure out how to make it fit.

Pointers:
1) Before you try to make this really small and fit into a tight space, try building the circuit on a breadboard to make sure you can do it (and have all working parts). It will make you extremely angry if you spend an hour cramming/soldering pieces into a D-sub then it doesn't work because you have a dead receiver.

2) Cut the pins on the components down very short. However, remember that you can only make them shorter so don't cut off too much until you're sure of the size you need and that you can still solder to it. OK, I lied a little bit, if you do hack off too much of a pin, you can always solder an extension pin onto it or a small piece of wire that you can run wherever you need (don't be embarrassed, we've all done it : ).

3) Don't use wire to connect the pieces unless absolutely required. Just solder the components directly to each other. I think I ended up using three pieces of wire to make connections because it was impossible to bend the components the way I needed them to fit.

4) Lastly, just solder on one component at a time, then check to make sure you can still fit everything in the D-sub.

If the circuit diagram below doesn't quite make sense to you, I'm going to try to walk you through the assembly in the next step... some people learn better by having things laid out in text and since we're not using wires I had a little trouble visualizing how everything should be hooked up directly.

Step 3: Circuit Walkthrough

First of all, I'm going to try to avoid telling you to solder pin1 to pin2, and give you more english directions. The problem with this is that english is ambiguous, just ask any computer scientist : )
The only component I will refer to by pins is the 9-pin serial connector because I gave you a pretty diagram in the last step so everyone should be able to figure that out.

So, in order to try to make the english explanation less ambiguous I'm going to set out a few rules.
1) I will say that a component is 'on its back' which will mean the following:
a) The IR receiver is 'on its back' when the rounded receiver side is up and the flat side is down.
b) The voltage regulator is 'on its back' when the totally flat side is down and the two level side with printed letters is up.

Here we go:
1) Solder the dark side of the diode to pin7 (RTS) on the serial connector, that is the stripe indicating direction will be on the opposite side of the diode from the serial connector.
2) Solder the striped end of the diode to the center pin of the 7805 voltage regulator
3) Solder pin 1 on the serial connector to the resistor.
4) Solder the other end of the resistor to the left-hand pin on the 7805 voltage regulator assuming the voltage regulator is -on its back-
5) Solder pin 1 on the serial connector (where we just connected the resistor) to the right-hand pin on the TSOP1138 IR receiver, assuming the receiver is -on its back.-
6) Solder pin 5 on the serial connector to the negative side of the capacitor
7) Solder the positive side of the capacitor to the center pin of the TSOP1138.
8) Solder pin 5 on the serial connector (where we just connected the negative side of the capacitor) to the left-hand pin of the TSOP1138 (assuming its on its back)
9) Solder the center pin of the TSOP1138 (where we just connected the capacitor) to the right-hand pin of the 7805 voltage regulator, assuming the voltage regulator is -on its back-

Keep in mind that several points will have multiple connections. For example, the center pin of the TSOP1138 connects to the positive side of the capacitor as well as the right-hand pin of the 7805 voltage regulator, assuming the voltage regulator is -on its back-

Okay... so that's really, really nasty and I would never figure how to build a circuit like that... but perhaps it will help someone who doesn't read circuit diagrams very well.

Step 4: Stick It in the D-sub

Now, if you took my advice, you've been stopping between every solder point and fitting the circuit into the D-sub to make sure it works. If you didn't take my advice... well, good luck.

Assuming you've been test fitting the circuit every step, this should be really easy. Just drop the circuit in and make sure no connections short to each other. If you have overlapping contact surfaces, just cut a small piece of electrical tape and squeeze it in there to insulate them. You could also use liquid electrical tape and coat everything inside... but that stuff is really messy and a royal pain if you ever have to work on this again so I'd recommend against it.

The last thing?
The last thing you should have to do with the D-sub is dremel out a rectangular area where the IR receiver can stick out the top. You'll also have to dremel a notch for the rounded receiver area. This doesn't take too long, but try to be fairly precise. If you can keep the area tight enough then the serial connector and pressure on the IR receiver from the D-sub casing will keep everything safe and snug.

Test him (or her) out.
Once everything is insulated, plug the little guy in and test him out. You'll probably want to do this before completely closing up the D-sub just in case you screwed something up : )

If it doesn't work, compare your circuit closely to the circuit diagram and retrace/recheck all of your connections.

Step 5: Plug It In!

Once you've tested and completely closed the D-sub, plug it in and then go about setting up your software. Personally, I had more trouble setting up the software than I did building the circuit but your mileage may vary.

Attached are a few shots of it plugged into my desktop and laptop.

If I missed anything or if you have any questions, please feel free to comment or message me and I'd be glad to help or add corrections.

-darc

Be the First to Share

    Recommendations

    • Make It Bridge

      Make It Bridge
    • Big and Small Contest

      Big and Small Contest
    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge

    43 Comments

    0
    JohnCC330
    JohnCC330

    Tip 1 year ago on Step 5

    Just a remark... At least at the moment, LIRC suggests using a 78L05 version of the regulator (instead of the 7805 in this instructable). As a practical issue it's a lot smaller, so easier to insert into the DB-9 connector. But, more importantly, it consumes only 3mA (max 5mA) instead of 5mA (max 8mA) for the 7805. With modern(er) portables, those couple of mA could make the difference between success or failure!

    0
    darc
    darc

    Reply 9 years ago on Step 2

    Thanks zshtiwi but I want to make it clear that I did not develop the circuit diagram, the credits can be found at the head of this section. I just crammed the damn thing into a D sub : )

    0
    swg
    swg

    10 years ago on Introduction

    will HYPER TERMINAL display any data (character/HEX value) when a key pressed in remote(any remote).

    0
    zack247
    zack247

    12 years ago on Introduction

    is there anything significant about the IR reciever? if theres anything special built in to the small package, is there any way i can make a general 2-pin IR detector work for this?

    0
    darc
    darc

    Reply 12 years ago on Introduction

    Sorry for the delay in getting back to you, I've been traveling.

    You can see here : http://www.vishay.com/docs/82006/tsop11xx.pdf

    That the receiver has some extra innards (preamp, diode, etc) compared to a simple IR detector.

    You could certainly use a regular IR detector, but you'd need to work out the rest of the requirements. And, the receivers run about $1 so it may not be worth the hassle - unless you just want the challenge : )

    0
    tajmohd15
    tajmohd15

    12 years ago on Step 3

    Hi,

    which remote control should be used to this RS-232 Infrared Receiver in a Serial Connector (LIRC) Computer Remote Control.


    is it a universal Infrared Receiver


    please reply me

    0
    darc
    darc

    Reply 12 years ago on Step 3

    Any remote that transmits an IR signal at a receivable frequency should work. I used a 38kHz IR receiver and that's pretty standard (as is 36kHz).

    Personally, I've used this receiver with an RCA Universal Remote (model RCR815) the most and it works great. I've also tested it with the remote that came with my Logitech PC speakers (5.1 with 10" sub... I forget the model number), my old Sanyo DVD player remote, and a few other remotes from various devices in my home. They've all worked (in that the receiver picked up a signal) but I didn't bother to map the output from the remote to an action in LIRC on all of them... I just wanted to see if they'd pick up. The RCR815 is the one that I've used the most and is the only remote that actually gets used in my house.

    Remember that you'll have to configure your receiver software to make it actually "do stuff" but that the receiver will pick up the signal from a ton of different remotes/input devices.

    Good luck!

    0
    tajmohd15
    tajmohd15

    Reply 12 years ago on Step 3

    can u please tell me how to make in usb version

    0
    darc
    darc

    Reply 12 years ago on Step 3

    I'm just going to copy/paste this reply from further down because I'm lazy : )
    -----------------------------------

    There are USB alternatives, but they're a little more complicated because you have to interface with the USB controller... which is trickier than the serial controller. Because of that, you'll have to have some type of IC or MC to do the communication between the IR receiver and the USB bus. And, with the added hardware, your cost will raise a bit. Of course, I built my serial receiver for about $1.50 ... so "rising cost" may come up to $5, probably less than $10... depend on the IC/MC you use.

    Check out these projects for more info, and for a schematics/plans:
    USBTiny : http://www.xs4all.nl/~dicks/avr/usbtiny/

    USB-IR-Boy : http://usbirboy.sourceforge.net/

    I'm sure there's probably a few more projects out there, but these are the two I hear about the most often.

    0
    tajmohd15
    tajmohd15

    Reply 12 years ago on Step 3

    in usb Cant we connect

    DCD to red wire
    RTS to white or Green wire
    GND to Black wire

    0
    darc
    darc

    Reply 12 years ago on Step 3

    I've never looked at the USB options in depth, but if you're talking about wiring the IR receiver directly to USB wires without a microcontroller... I don't think that's going to work out for you.

    0
    tajmohd15
    tajmohd15

    Reply 12 years ago on Step 3

    in usb Cant we connect

    DCD to red wire
    RTS to white or Green wire
    GND to Black wire

    0
    matstermind
    matstermind

    12 years ago on Introduction

    do i need to restart the computer before i plug it in or can i just stick it in.

    0
    darc
    darc

    Reply 12 years ago on Introduction

    You can just plug it in - RS-232 is hot swappable.

    If you're in windows, you may need to scan for hardware changes. Or, the receiver software you're using may be able access it directly... I'm not sure about Windows, I'm a Linux guy.

    On Linux, you just plug it in and then point LIRCD to the correct port (after proper configuration) and alls well.

    0
    darc
    darc

    Reply 12 years ago on Introduction

    You are quite right! It is a 4001 in the picture above.

    I had used a 4148 zener on a different version of the same circuit and must have gotten them mixed up when I wrote the instructable. I'll get that fixed.

    Thanks catching that!

    0
    matstermind
    matstermind

    Reply 12 years ago on Introduction

    your welcome, do you know if

    a. either diode can be used
    and
    b.does it work with windows 7