For today's how-to we spent some time rummaging around in our parts box to build a serial IR remote interface for our PC. We took a few pieces from various designs to come up our own, built specifically to work with WinLirc or LIRC; it can transmit and recieve IR signals, just imagine the possibilities.
It'll probably work with other software packages, but may require some small modifications.
For today's how-to you'll need:
- IR(Infrared) LED (RS 276-142)
- IR Receiver module (RS 276-640)
- 4.7uf and 100-220uf capacitors
- 47ohm and 4.7k resistors
- Sub-D 9 pin Female Connector
- NPN Transistor (cheapies from RS are fine)
- PC Board
- Sacrificial USB Cable
- Tools, hookup wire, solder, etc.
The receiver portion is pretty simple. Rather than use extra parts to generate stable power from the serial port, we decided to steal 5 volts from the USB port.
The transmitter is a little bit more complicated. The resistor is 47 Ohms, and the capacitor can be 100 to 220uF. The WinLIRC project recommends using the TX pin of the serial port for better performance.
To test our our customized circuits we built it on a breadboard first. Using WinLIRC (which is getting kind of old at this point) we easily recorded commands from our remote and got around 10 feet of range with our transmitting LED. We suspect you can get even more range, but the surround receiver we tested with is a bit picky.
Breadboards just aren't good enough for us, we had to pull out the soldering iron. Here's our Serial connector with USB connector to supply a solid 5 volts to the transceiver. And yes, we'll cover those exposed leads with some heat shrink tubing.
We built our remote transceiver to use a standard piece of Cat-5 so we can easily place it wherever we need it. Upstairs, the ceiling... or next to the hot tub.
Download WinLIRC and unzip the folder to wherever you want it to reside. There's no installer, so somewhere on C: or in Program Files might be a good idea. Double click the remote + computer icon labeled winlirc.
The first thing you'll get is an error message. Click OK to pull up the configuration window.
Select the correct COM port. Usually it'll be either COM1 or COM2. Most of the default values are fine. The receiver should be DCD and under Transmitter, TX should be selected. Finally, click Browse next to the Config line. To get started, select sample.cf and hit OK. It won't let you create a new blank config. If you think everything is correct, click on the Raw Codes button. If everything is correct, you'll get a new window. Otherwise you get an error message.
Point a remote at the receiver. If you see codes, it's working! Close the window and click on the Learn button in the main configuration window.
WinLIRC will complain some more. Click Yes.
Now we get the Learn remote window back again. This time we get prompted. Enter a name for the remote like VCR and click Enter. Next, the default error margin of 25 should be fine. Type in 25 and click Enter again. The next question lets you tune a custom gap length between signals. Leave it blank and click Enter again. Next you'll be asked to press a button. Just follow the prompts. Don't worry about which buttons you're pressing. WinLIRC is just checking out the signal timing you're sending it until it asks for the name of a button.
When asked for a name, enter something like Power and click enter. Now you'll be asked to hold down the button. Aim the remote at your receiver and watch the signal count rise.
Finally, you get to declare if you want to keep the recording of each button. Repeat this for every button on the remote you wish to store. When you're done, click Enter without typing anything in the box. You should get a confirmation message that the config was saved.
More WinLIRC silliness. Just click OK, then click the Analyze button back in the main config window. If you're done, click OK in the main configuration window. Now WinLIRC will hide in the TaskBar as an icon. The icon will change colors to show status. It turns green if it gets a signal it recognizes.
Clicking on the icon will bring up a WinLIRC window. To test sending a code you've recorded, select the remote and the code you want, and click Send Code. You'll need to aim the transmitter at whatever you want it to talk to.
Now that it's working, you'll want to make it do something besides make a green dot on your task bar. On the WinLIRC page you'll find links to various pieces of software that supports WinLIRC. Go forth and vanquish TV signals, friend, or whatever unusual things one does with a fully customizeable homebrew IR blaster / receiver.