AVR-Based Serial Port IR Receiver

This is a simple IR receiver circuit which plugs into a serial port of a computer. Okay, there are many other circuits of this kind, and most of them are even simpler, but this circuit has two major advantages: (1) it uses an Atmel AVR RISC microcontroller (an AT90S2313) instead of the usual PIC microcontroller and (2) it uses a Maxim MAX232 for the generation of valid RS232 levels.

Advantage 1 is, of course, only valid for all those AVR addicts which have this device (and the corresponding programmer) ready at hand and don't care about PICs and PIC programmers. Advantage 2 comes into play if the IR receiver has to placed at a great distance from the computer; the MAX232 is more likely to deliver valid signals over bigger distances than cheaper solutions.

The IR receiver can receive it's +5V supply voltage from the keyboard or mouse connector of the computer (either from an unsued PS/2 port or via a pass-thru adaptor). If the IR interface is placed at a great distance from the computer, I power it with an external stabilized 5V DC power supply instead of the PS/2 port.

The interface communicates at 19200 baud, unidirectionally (that means, it only transmits data and does not care anything about data which the computer send), without flow control. For every level transistion in the demodulated IR signal, it transmits a single byte which corresponds to the time since the previous transistion, capping off at a value of 255. It works reliable with a Sony remote control (using the special Sony protocol), and I have also succesfully tested it with an Onkyo remote control (I think this one uses the standard RC5 protocol, but I'm not shure). Decoding happens on the computer; I use PC Remote Control for this.

Okay, 'nuff said, here's the schematic (changed on July 08, 2002 to correct wrong connections to the MAX232). Obviously, it uses european symbols.


Attention! It has come recently to my attention that an SFH601, as shown in the schematic, is not the correct device for that circuit. In fact, the SFH601 seems to be a 6-pin DIP optocoupler device and no IR receiver. Unfortunately, all the devices which were sold to me as "SFH601 IR receivers/demodulators" carry no markings, but I'm pretty confident now that my circuit contains the SFH506 instead. The SFH506 isn't produced any more now, so the TSOP1736 is now commonly used instead (the TSOP1836 is also said to work).

Please note that there are different types of MAX232s, which use different values of external capacitors! Check first which type you've got before soldering in the caps! Datasheets for these ICs are available at www.maxim-ic.com.

If the interface is positioned at a rather short distance to the host computer (I guess a few meters are okay), a simplified version of the RS232 interface may work. The simplfied interface uses a single transistor instead of the MAX232. The resulting signal voltages are 0V and 5V, which are clearly outside the RS232 specifications, but are still correctly interpreted by modern RS232 receiver circuits. The schematic for the simplfied version can downloaded here. Please note that I have not yet built this circuit, so it's still untested.

The microcontroller firmware can be downloaded here: Firmware V1.1. If you have questions, feel free to mail me at ks@expose-media.de.

I also have a (very simple) example which shows how IR signal recognition can be done inside the mircocontroller.

- Klaus Stock

Other sites on this server:

The Raid on Bungling Bay Map Site
Happy Beginnings Wedding Service (german site)
VMPS801 - Virtual Matrix Printer Simulation of the Commodore MPS801
Home of The David Brin Mailing List