TSOP1838 IR Infrared Receiver

I received my TSOP1838 IR Infrared Receiver last week from Dealextreme. This post briefly summarises some useful information regarding the PCB pinout and links to an Arduino library that can be used to read the signals from common IR remote controls.

I’ve previously described my new Arduino Uno, and running the Arduino IDE under WindowsXP/Virtualbox/FreeBSD.


The unit is a TSOP 1838 infra-red remote control receiver tuned for 38kHz operation (“37.9Khz” according to Dealextreme). It operates from 2.7V – 5.5V DC supply, with a nominal range of 18m. It is useful for receiving consumer remote control IR signals (at least ones that operate with 38kHz modulation of their IR signal).

PCB pinout

A crucial point to note is that the PCB has a three-pin header whose pinout is different to that of the TSOP 1838 IR receiver chip itself.

The actual chip’s pins are indicated on page 6 of this datasheet — http://www.datasheetcatalog.org/datasheets/134/301155_DS.pdf. However, the PCB transposes pins 2 and 3 of the IR chip (not easily visible on the PCB, and something I learnt by doing it wrong the first time!)  Numbering closest to furthest from the PCB header pin labelled “S”, the header pins are: OUT, VCC and GND (see the photo below).

IRremote Arduino library

Ken Sherriff’s Arduino IR Library (IRremote) from 2009 proves to be very useful — see http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html for discussion and download link.

Ken’s zip file contains a folder IRremote, and the website says this should be unpacked into <arduino>/hardware/libraries (<arduino> being the path to your Arduino IDE directory). However, for my Arduino 1.0.1 IDE the correct path was <arduino>/libraries.

Furthermore, for Arduino 1.0 and later, Ken recommends changing

#include <WProgram.h>


#include <Arduino.h>

in <arduino>/libraries/IRremote/IRRemoteInt.h

IRrecvDemo sketch

Having installed the library and made the change to IRRemoteInt.h I launced my Arduino IDE then opened, compiled and uploaded the Examples->IRremote->IRrecvDemo sketch.

This worked nicely — I was able to decode the keypresses from my XBox 360 media controller and my Sony LCD TV controller (although not from my Foxtel IQ box controller). Pressing buttons on the remote controls caused a small LED on the IR PCB to flash, and the IR codes (corresponding to the buttons being pressed) appeared on the Arduino serial console. Yay!

Other links

See http://www.ladyada.net/learn/sensors/ir.html for more details and ideas on IR sensors in general. Also see http://tigar.nl/2012/01/tsop-1838-ir-receiver/ for someone else’s brief comment on using the TSOP1838 IR device itself (not PCB w/header) with an Arduino.



  1. I was very happy to uncover this page. I need to to thank you for
    ones time due to this wonderful read!! I definitely appreciated every
    part of it and i also have you book marked to see new stuff in your site.

  2. thanks much for the information about the difference for the PCB wiring !

  3. Thanks ! this was helpfull… although I m reading codes from different Ir controls from the use, I get erratic readings….. when I press the same button on one control, check:


    This was by pressing the same button over and over again. WIERD!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: