InfraHID

Abstract

This is an USB HID gadget, capable of converting CIR signals from a remote control to keystrokes and/or mouse movements. It uses an ATMega8 AVR microcontroller and the Objective Development firmware-only USB driver stack.

Description

The device contains a TSOP1738 infrared receiver & demodulator, which picks up the signals from the remote control. The microcontroller implements a combo HID device, simulating both a mouse and a keyboard. This way it can send mouse movements, button clicks and keystrokes (such as PageUp, PageDown, Enter, Escape, etc.) to the PC. Also, since most modern operating systems (and also Windows) have built-in HID drivers, it works out-of-the-box without requiring any special software.

In this iteration I used the only remote control I had around, a TV-tuner unit labelled "Leadtek CoolCommand RM-0010". Analysis using xmode2 and irrecord from LIRC revealed that the protocol is constant-length, space-encoded. That means that all codes have the same total length (in this case, some 108 mS), and '1's and '0's are differentiated via the duration of a space. Have a look at the waveforms and the resulting LIRC config file, which fully describes the signals.

Circuit diagram

Click to enlarge. The schematic in Eagle .sch format is available in the downloadable archive -- see below.

Erratum: Connect the VS pin of TSOP1738 directly to the USB +5V line (instead of the 3.3V VCC). This is safe, since the IR receiver has open-collector output.

Photos

Click to enlarge.


Results

It works! :)

Here's a dump of the relevant information as seen on my Linux box. On windows, all you get to see is this silly balloon. But it works there, too.

Further development

Potential TODO list:

    • Implement more IR protocols, most notably RC5
    • Allow run-time configuration of key/mouse mapping, possibly via HID output/feature reports
    • Allow extraction of raw waveform data (possibly via HID input/feature reports), either for visual analysis or as input to LIRC

Download

Current release, source code and circuit schematic: InfraHID.2007-01-18.tar.gz

Links