From Curuxa

Infrared remote control receiver. This module can receive and demodulate a signal sent from a common remote control used by most TVs, DVD/BluRay players, HiFi... The microcontroller will receive a series of digital bits that have to be parsed to undersand the information being sent from the remote control.


Electronic circuit


Bill of materials:

  • 1x TSOP17xx, SFH5110 or equivalent infrared receiver (read below)
  • 1x 180Ω-10k 1/4W resistor, for example 1k (optional)
  • 3x Straight female headers (usually sold as 40-pin strips)
  • Some thin wire
  • Some heat shrink tubing

Manufacturers design their receivers using different pinouts:

SFH5110 Wiring
TSOP17x Wiring

Printable version: Single, Double

How it works

The pin of the microcontroller where CMIR-RC is connected to has to be configured as a digital input.

When you press a button on your remote control, it will send a stream of bits encoded as a sine wave of infrared light at a given frequency. This means your remote control will generate a series of zeroes and ones (digital bits). Those bits will have a given length depending on the protocol used by that remote control. A lack of infrared light would mean a zero is being transmitted. Digital ones are sent as a sine wave at a specified frequency. The infrared receiver has an internal demodulator which will detect those sine waves and output a continuous signal, so at the receiver's output you'll get a square wave easy to parse by the microcontroller.

A more detailed explanation about how infrared remote controls work can be found here.

Also, note that its output is inverted, so digital ones sent by the remote control will be received as a zero, and zeroes sent will be received as ones.

Depending on the modulated frequency your remote control is using, you'll have to use a different TSOP17xx model:

  • TSOP1730, SFH5110-30 – 30kHz
  • TSOP1733, SFH5110-33 – 33kHz
  • TSOP1736, SFH5110-36 – 36kHz
  • TSOP1737 – 36.7kHz
  • TSOP1738, SFH5110-38 – 38kHz
  • TSOP1740, SFH5110-40 – 40kHz
  • TSOP1750 – 50kHz

The most common ones are 36 and 38kHz. If you are not sure which one you should buy, you might be interested in TSOP1736. If your remote control happens to work at a different frequency you'll still be able to receive the signal, but at closer distances.

All the information about each infrared receiver can be found in their datasheets: TSOP17xx, SFH5110.

The resistor is optional, but it's a good idea to include it because in case you set the microcontroller's pin as digital output both components will be short-circuited.

Construction (SFH5110)


Construction (TSOP17xx)



The following code can be compiled using SDCC.

* Sample program for CMIR-RC and LTIND-A using an MBP18
* Plug CMIR-RC to RB3 (pin 9) and LTIND-A to RB4 (pin 10).
* The LED will flick while you are pressing a button on your
* remote control
#include <MBP18.h>
#define IrReceiver RB3
#define LED RB4
#define LedON 1
#define LedOFF 0
void main(){
	//set RB3 as a digital input and RB4 as a digital output
                if(IrReceiver==0) LED=LedON;
                else LED=LedOFF;