The Linux Infrared Remote Control (LIRC) Project
Linux Infrared Remote Control (LIRC) allows you to use inexpensive hardware to control your Linux PC with a TV remote control. Why would you want to control your PC with a TV remote control? A number of reasons are possible, the most obvious being MythTV, which I wrote about earlier for LJ.com. You might want to use LIRC for presentations, so you can step out into the audience and still change slides on your laptop. Or, LIRC can be used when you are keeping a machine out of the way somewhere but still want to control it.
As an example, an eatery not too far from me, Linuxcaffe is planning to set up a PC to run in-house displays. The box will be hung just below the ceiling. Linuxcaffe owner David Patrick wants the staff to be able to change displays on the fly, without having to climb a ladder. With LIRC, this can be done.
Here, I am going to demonstrate how to build a LIRC system. For hardware, you need an infrared receiver, which you might have already, and a remote control. A small number of PCs come with an infrared receiver that is supported by the LIRC software. Many laptops come with an IrDA standard interface for doing infrared networking and some IrDA interfaces, but not all of them work with LIRC. Many TV tuner cards come with an infrared port that is supported by LIRC. In addition, Creative Labs used to produce a series of CD-ROM drives that included an infrared port supported by LIRC. If you don't already have an infrared port for your PC, however, you need to look at other options, which I will get to shortly.
A small number of radio-based remote controls have been made to work with LIRC, but basically, LIRC is an infrared system. For remote controls, almost any "universal" infrared remote control can be made to work with LIRC. The only brand of remote control that is notorious for its problems and should be avoided is Bang & Olufsen.
Do give some thought as to how much control you want/need over your PC. For example, if you are planning to do presentations for which your control concerns amount to next/last slide, then a small remote you can carry in your pocket may take priority over a remote with a lot of buttons. If, on the other hand, you want to run a MythTV box, you probably want all of the functions of a TV, DVD player and so on, meaning more buttons. Thus, a larger remote is an acceptable trade-off. Either way, your options here are wide.
The price for the remote can range from effectively free if you have an old VCR remote up to a several hundred dollar color display screen remote that does almost everything (see the Logitech Harmony series of remote controls). With MythTV in mind, I got a factory refurbished RCA remote with batteries at an electronics clearance shop for less than five dollars.
Assuming you don't already have an infrared detector, you have to buy or build one. You can find plans for several infrared detectors on the LIRC Web site, including plans that use the serial port, a USB port or the parallel port. Here, I walk-through building the simple serial port detector inside a DB9 hood. This serial port design does not follow the RS-232 standard fully, but it is close enough for most desktop PCs. When it comes to laptop computers, which often don't fully follow the RS-232 standard themselves, this design may be problematic. The circuit diagram is laid out in Figure 1. In Figure 2, you can see one possible layout on perfboard.
To build your own detector, you need a few parts:
IC1 - SFH 5110-38 Infrared detector, or compatible
IC2 - 78L05 voltage regulator
D1 - 1N4148 diode
R1 - 4.7 K ohm 0.25 watt carbon resistor
C1 - 4.7 uF 16 volt electrolytic capacitor
DB9 female solder connector
Miscellaneous: perfboard, hookup wire, rosin core solder, flux remover
You can expect that finding a suitable infrared detector will be something of a pain. The rest of the parts are quite common and easy to locate. The total cost for all of the above parts should be under $15.
In my case, I had some infrared detector ICs left over from a project I made several years ago. I no longer had the data sheets, however, and the markings on the ICs were not useful. So, I needed to be certain of the pin-outs. On my local user group mailing list, Peter L. Peres suggested setting up the circuit shown in Figure 3 on a prototyping board. The idea behind this is you can set up various possible connections with the voltages involved set so low that there is little chance the IC will be damaged. After setting up each combination, fire a known good infrared remote control at the sensor IC and see if the LED flickers. For the test setup, you ideally want a 5 mA red LED; otherwise, the flicker may be very faint. Regardless, you should do these tests in a dimly lit room.
The pin-outs for my mystery infrared detectors are the same as the Osram SFH-5110 series of detectors. The layout of that series assumes a SFH-5110 or compatible detector. This circuit can be made to work with dozens of detectors, but not all have the same connection layout, so do double check your own compatability.
In addition to the above parts, you need to have a few tools available:
Low wattage soldering iron (20-40 Watts)
Soldering iron stand
Optional but recommended: clip-on heat sink, third-hand parts holder, solder remover tool
When it comes to soldering irons, 100 and 200 watt versions are available for people who do things such as make stained glass windows. The problem with these high-power soldering irons is they get very hot very fast, and computer parts can be destroyed with too much heat. Therefore, don't use a soldering iron with more than 40 watts, and I recommend using one closer to 25 watts. The "cold heat" soldering irons promoted on television have their place for some jobs, but that place isn't here. Among several problems they have, their tips are much too big for the sort of small-work precision this project requires.
Heat is an issue throughout this project. As noted, the parts in this project can be destroyed by too much heat, yet we need enough heat to melt solder. People with a lot of experience soldering could bond all of these parts together quickly enough that heat doesn't build up, so they could get away without using a heat sink. But as a hobbyist who solders only occasionally, I find that a clip-on heat sink buys a lot of leeway and saves a lot of parts from destruction.
Flux is a cleaner put into the middle of the solder to help ensure good solder connections. Two kinds of flux-containing solders are on the market, acid and rosin core solders. Acid core solder is designed for things such as radiator repairs; it should be avoided at all costs for electronic work.
Respect the things you are dealing with; if handled carelessly, the soldering iron can burn. Most solders sold in North America contain lead, a metal with known health issues, so you should try to limit your exposure to it. Flux remover typically contains alcohol, so don't use it near an open flame or other heat sources. Finally, the flux in the solder burns off as you work, creating tiny wisps of smoke. So work in a well-ventilated and well-lit area.
Do collect in advance the parts and tools you need for the project, as you see in Figure 2. Because I was doing my work at the kitchen table, I laid out some newspapers to protect the table surface.
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- The Firebird Project's Firebird Relational Database
- Stunnel Security for Oracle
- My +1 Sword of Productivity
- SUSE LLC's SUSE Manager
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Doing for User Space What We Did for Kernel Space
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide