ELECTRONS.PSYCHOGENIC.COM NEWS   RAVES & RANTS   GAMES   CONTACT US    
HOME ACCOUNT PRIVATE MESSAGE  
Main Menu

Login

Electrons :: Articles :: Projects :: Infra-Red Signaling
Infra-Red Signaling
Description: Describes our experience and experiments constructing various infra red (IR) remote control receivers.
It presents a bit of theory, instructions on building the circuits and anectotal information in what we hope to be a light and interesting format.

  • 1. Infra-Red Signaling
Infra-Red Signaling

This page describes our experience and experiments constructing various infra red (IR) remote control receivers. It presents a bit of theory, instructions on building the circuits and anectotal information in what we hope to be a light and interesting format.

Rationale

The LIRC project, which allows you to "decode and send infra-red signals of many (but not all) commonly used remote controls" had us interested in IR signals for a while but we'd yet to do anything about it.

Then we installed Freevo and MythTV on a Mandrake box equiped with an ATI TV-Wonder tuner card. After getting everything working, we had the beginnings of a great PVR--but we were in need of a remote control.

But it was the Atmel application notes:

that finally convinced us to start experimenting with IR.

InfraRed Remote Control signals

The world is a noisy place: everything emits some infra red light. In order to differentiate a remote control unit's signal from the general noise and black body radiation, it tries to get noticed by being particularly annoying and blinking at a specific (high) frequency, while it sends its (lower frequency) message. In other words the signal is modulated, usually somewhere between 36-40kHz.

LIRC Receiver

The simple receiver presented here uses a special remote control receiver component to keep the circuit straightforward and easy to build.

The LIRC site has a section devoted to building IR remote receivers. I'll spare you the ASCII art--here is a schematic of a detector circuit as described by LIRC:

LIRC IR Detector Schematic

This is an extremely simple system. Point by point:

  • Power comes in through the serial port (pin 7, "RTS") and the diode (D1) ensures that only the correct polarity gets through to the 7805 voltage regulator (IC1).
  • The regulator does its best to keep a steady 5 Volts on its output pin (VO) while the capacitor (C1) is present to get rid of remaining ripple from the source.
  • The IR Receiver module (SV1) is the heart of the system. It sends information back to the serial port through pin 1 (the "DCD" is used as the signal line here). This component merits further attention and will be described below.

IR Reciever Module

Sharp Remote IR Receiver The remote control reciever is a single inexpensive (around $1.50) and easy to use component. It keeps your circuit component count down by packing a lot of functionality within. The block diagram for the Sharp GP1UD261XK is typical:

IR Receiver block diagram

  • A photodiode, which is sensitive to light around 1000nm (infrared), reacts to all incomming infrared signals close to these wavelengths.
  • Its "reactions" are amplified and passed through a Band Pass Filter (B.P.F.) centered around 38 kHz. Signals at or near 38kHz get through easily while other frequencies are attenuated or blocked.
  • The signal is demodulated, which means that the 38kHz modulation waves get smoothed out and only the (lower frequency) message remains.
  • Because it has been demodulated and has a smooth waveform, the signal is unfit for digital consumption. It is passed through an integrator (resulting in ramp like waveforms) and then a comparator (schmitt triggered, to provide clean transitions in the noisy world) which will allow nice, digitally acceptable, logic levels to be output on Vout.

modulated IR signal and receiver output

Notice how Vout is tied to the transistor's collector in the block diagram? Because of that 100K pull-up resistor, when nothing is going on (transistor off) Vout will be high (will have Vcc present). When the transistor is activated, it is as if a switch is closed and Vout is then tied to ground (through the transistor), which is a logic low. This explains the inverted output from the IR receiver (incomming signal causes a low pulse on Vout).

Prototype test circuit

Once you've acquired a suitable remote receiver module (a list of suitable ICs is available on the LIRC site), you'll want to verify that it is working and able to pickup signals from your remote. A good way to do so, it to setup up this modified version of the LIRC receiver circuit:

LIRC test circuit

Differences with the implementation version:

  • The serial port is gone, replaced by a battery (or other suitable power supply somewhere between 9 and 15 volts).
  • Two new components were inserted between the 7805 voltage regulator output (VO) and the IR receiver module: a Light Emitting Diode (LED1) and a current limiting resistor (R2).

Here is the test circuit, laid out on a miniature breadboard (click on the image for a more detailed top view):

IR Receiver test circuit

When no signal is detected by the IR receiver, the data line is high and the LED is therefore reverse biased: the cathode (the left side of the LED in the above schematic) is at a higher voltage (about +8.4V) than the anode of the LED, which is connected to VO at +5V. LEDs, like other diodes, will not normally conduct when reverse biased so current doesn't flow and the LED does not emit.

Remote control usedWhen a signal is detected, the IR receiver data pin goes low putting the LED cathode at ground and allowing current to flow... the LED lights up:

IR Board detects remote

This test circuit was phenomenal when used with a magnavox remote--you could see the LED pulsing when you activated the remote control on the opposite side of the room, facing another direction!

You may also have noticed that I used different values than those in the original LIRC schematic for a few of the components, namely R1 and C1.

  • R1 acts as a pullup resistor and its main function is to keep the data line high when no activity is present (tying the pullup resistor before the voltage regulator may help ensure the serial port detects the high value, but I'm not certain of this), so it's precise value isn't so important--as long as it is high enough to ensure that there aren't gobs of current flowing into the data line when it is pulled low by the IR receiver module.

  • C1 functions like a shock absorber, storing excess energy and releasing it during lulls, to reduce ripple present on the input voltage. This isn't normally much of a problem with battery operated devices but as soon as you're drawing energy from the AC lines you run the risk of injecting ripple into your circuit.

    The LIRC schematic mentions 4.7 uF, the Sharp datasheet for the IR receiver leans towards 47 uF (ten times higher). It may be that the voltage present on the serial port is very clean compared to the juice available from your average power supply. In any case, using a 10 uF cap can't hurt.

Circuit PCB

To keep things clean in the final circuit, it's always nice to use a printed circuit board. If you know how to create a PCB, you can use this pattern (it's a mirror image, allowing you to transfer it to the copper easily):

LIRC PCB Board

Click on the above image to get a higher resolution version which you can print at 400dpi. Note: The PCB assumes that you've got an IR module pin out like that of the Sharp GP1UD261XK (Vout, Vcc, Gnd):

Sharp IR receiver outline

This (x-ray) top view of the board will show you how to place the components once you've etched and drilled your PCB. Notice that the IR receiver module is placed such that the Vout pin is the "uppermost" pin of SV1 while the GND pin is that closest to the "X1" marking at the bottom.

Component placement for LIRC PCB

Mouse House

I know a mouse, and he hasn't got a house.
I don't know why. I call him Gerald.
--Pink Floyd

Before we had the chance to construct the above printed circuit board, I was handed an old compaq mouse. This mouse had old style buttons, from the days back when you wanted the company next door to know you had a modern computer just by the sound of your clickety-clicking all day long. This, along with the fact that just about everybody here is ergonomically obsessed and won't get near these wrist killers meant there wasn't much for me to do with the hardware other than give or throw it away.

PS2 mouse with serial adaptor

The mouse had also been connected to an even older computer, and was therefore equipped with a PS/2 to serial port adaptor...aha! If the adaptor actually routed the serial pins 1 and 7 through the PS/2 cable, we could have a nice housing for our IR receiver and would save one serial port wire to boot. Our trusty screwdriver helped us find out if it would work.

Mouse innards

Opening the device revealed a rather simple PCB by Logitech comprised of two IR LED/phototransistor pairs to track ball motion, a main logitech IC and support components. The most interesting part for us was the J1 component--the 6 pin PS2 cable header.

Desoldered PS2 header

With a little desoldering work, the header was free from the circuit board. Be careful if you do this as excessive heat will melt the plastic header and allow the metallic pins to roam freely, getting crooked or falling out. Attaching the header to the cable on one end and a male DB9 to the serial adaptor allowed be to easily discover the adaptor wiring. I don't know if this is standard or not, so if you should come upon a similar setup, you can use a multimeter (set to measure resistance) or a simple interrupted LED circuit to try each combination and map the adaptor wiring. Here is how ours was setup:

Pins 1,2,4,7 and 8 each map to one of the PS/2 wires. The white wire seems to be attached to the DB9 shield (metal casing). I'm guessing it's supposed to act as ground and a quick look at the mouse PCB traces seems to confirm this.

If we want to build the LIRC receiver, we need access to pins 1 (signal line), 7 (power) and 5. It looks like we're in trouble but since 5 is the ground pin, we'll use the white wire (db9 shield) and go from there.

Level: Article
Additional Article Data
Level: Article

Comments
The comments are owned by the poster. We aren't responsible for their content.

Jump to section
News

All contents are Copyright (C) 2004-2005 Psychogenic Inc -- All rights reserved