view · edit · print · history

With the following (minimal) hardware circuitry the NSLU2 is able to receive and transmit infrared signals, e.g. like RC5. These are normally received by audio and video equipment and sent by remote controls from your couch. The signals are decoded and generated in software using LIRC.

This is not IrDA! In order to use IrDA, buy a cheap USB-IrDA adapter.

How it works

We receive on CTS of the 2nd serial port (can be tapped at the left end of R142), that is otherwise unused. The xScale-UART can be programmed to generate interrupts on CTS.

We transmit with a IR diode between GPIO[1] (can be tapped at the right end of R53) and ground. GPIO[1] is also wired to cathode of the green status LED, which has it's anode at +3.3V. As the green LED is normally on, the IR LED is normally off. When transmitting, the green LED flashes. However while booting, the green LED is off for a minute and the IR LED is constantly on. But because there is no carrier, this shouldn't cause problems with erroneous IR signals.

For the precise locations of R142 and R53 see AddASimpleTenPinConnector. I'd recommend to remove R142, because it has only 18 ohms. When the MOSFET pulls the trace to ground, it costs your SLUG almost 200mA!

The Receiver Circuit

SFH5110-38                                    SLUG:
+---------------+          +------+
|    --   VCC 3 |--+-------| 100R |---------- +5V
|   /  \        |  |       +------+    
|  /    \       |  =  4u7              
| |      |      |  |                   
| |      |GND 2 |--+---------+--------------- GND
| |      |      |            |         
|  \    /       |            |       
|   \  /        |            |       
|    --   OUT 1 |-----| |----+    +-------+
+---------------+   G | | S     +-|  4k7  |-- +3.3V
                      |         | +-------+
                      | | D     |  
                      | |-------+------------ CTS2 (Left side of R142)

               (N-Channel MOSFET)


  • The CTS of the internal second serial port is pulled to +3.3V,
    the MOSFET will pull it to ground -> no 3.3V/5V level problems.
  • The SFH5110-38 needs 5V.
  • You can have more than one SFH5110 in parallel.
  • The Buerklin part numbers (in Germany, http://www.buerklin.com/):
    SFH5110-38 (68 S 3438)
    BS170 TO92 (17 S 7400)

The Transmitter Circuit

      +--------| 270R |---------------------- GPIO[1] (Green Ready LED)
      |        +------+
 IR  _|_
<--  \ /
<--   V 
      +-------------------------------------- GND

or even better with a driver transistor:

                      +---------------------- + 3.3 V
                      E \| B   +------+
                BC557    |-----|  1k  |------ GPIO[1] (Green Ready LED)
                      C /|     +------+
          +------+     /
      +---| 270R |----+
      |   +------+
 IR  _|_
<--  \ /
<--   V 
      +-------------------------------------- GND


  • You can use almost any IR-LED, e.g. a LD271 (67 S 1710).
  • The transmitter is active when the green LED is off
    -> in normal operation the green LED should be on
    -> while transmitting ir, the green LED will flash
  • If you need more transmission power, choose the second circuit with the driver transistor. There you can reduce the resistor from 270 ohm (IR current is about 7 mA) safely down to 50 ohm (IR current is about 40 mA).
  • With the second circuit, you can have more IR LEDs in parallel and/or serial (adapt the resistor if necessary).
  • I'm using a de-underclocked NSLU2.

The Software

The NSLU2-specific code is already in LIRC since version 0.8.0 (thanks to Christoph).
If you are using openslug, you can simply bitbake lirc-modules_0.8.0.bb and lirc_0.8.0.bb. For your convenience you should install the package lirc-nslu2example, it contains all dependencies and should work out-of-the box if you own a RC5 compatible remote.

The following picture is an example of a receiver/transmitter circuit that is plugged into my 10-pin-connector (see AddASimpleTenPinConnector). It has two receivers and two transmitters in different directions: Attach:LIRC-Adapter.jpg Δ

Matthias Goebl <matthias(dot)goebl(at)goebl(dot)net>

view · edit · print · history · Last edited by Matthias Goebl.
Based on work by Matthias Goebl and tman.
Originally by Matthias Goebl.
Page last modified on March 07, 2009, at 08:25 AM