Infrared transmitter & receiver interface with Arduino

IR, or infrared, communication is a common, inexpensive, and easy to use wireless communication technology. IR light is very similar to visible light, except that it has a slightly longer wavelength. This means infrared is undetectable to the human eye which means perfect for wireless communication. For example, when you hit a button on your TV remote, an IR LED repeatedly turns on and off, 38,000 time a second, to transmit information (like volume or channel control) to an IR photo sensor on your TV. IR receiving is done by TSOP382 IR photo sensor & IR transmitting is part of IR LED. This tutorial will help you to interface IR sensor with your Arduino or DIY Project.

IR Kit


IR LED is nothing but a normal LED transmitting infrared light with longer wavelength. TSOP382 is a device which combines an IR sensitive photocell, a 38 kHz bandpass filter, and automatic gain control. It operates on a variety of supply voltages including 3.3v and 5v. It de-modulates the received IR signal and gives you a nice clean square wave of off and on pulses at the voltage level of your power supply. This means it is ideal for feeding its output directly into the digital input pin of our Arduino. Last in the picture is IR receiver module with easy pinout for interface with any microcontroller.

TSOP module: It has an inbuilt control circuit for amplifying the coded pulses from the IR transmitter. A signal is generated when PIN photo-diode receives the signals. This input signal is received by an automatic gain control (AGC). For a range of inputs, the output is fed back to AGC in order to adjust the gain to a suitable level. The signal from AGC is passed to a band pass filter to filter undesired frequencies. After this, the signal goes to a demodulator and this demodulated output drives an npn transistor. The collector output of the transistor is obtained at pin 3 of TSOP module. Members of TSOP38xxx series are sensitive to different centre frequencies of the IR spectrum.

Career Frequency  Standard Applications (AGC2/AGC8) Very Noisy Environment (AGC4)
30 kHz TSOP38230 TSOP38430
33 kHz TSOP38233 TSOP32433
36 kHz TSOP38236 TSOP38436
38 kHz TSOP38238 TSOP38438
40 kHz TSOP38240 TSOP38440
56 kHz TSOP38256 TSOP38456

In TSOP1738xx series, last two digit indicates career frequency, ex: TSOP173838 = 38 kHz.

Specifications & Features


  • Forward current (IF) is 100mA (normal condition) and 300mA (max.)
  • 1.5A of surge forward current
  • 1.24v to 1.4v of forward voltage
  • Temperature for storage and operation varies from -40 to 100 ℃
  • Soldering Temperature should not exceed 260 ℃
  • Power Dissipation of 150mW at 25℃ (free air temperature) or below
  • Spectral bandwidth of 45nm
  • Viewing angle is 30 to 40 degree
  • Maximum wavelength is 940nm
  • RoHS certified

TSOP382 IR Receiver:

  • Very low supply current
  • Photo detector and pre-amplifier in one package
  • Internal filter for PCM frequency
  • Improved shielding against EMI
  • Supply voltage: 2.5 V to 5.5 V
  • Improved immunity against ambient light
  • Insensitive to supply voltage ripple and noise
  • Component in accordance to RoHS 2002/95/EC and WEEE 2002/96/EC

IR Receiver Connection With Arduino

As shown in figure, an IR receiver is connected with Arduino UNO. Here we will use an IR remote which is most commonly used for Arduino projects, in your project you can use any remote & can make your own remote as per application. In market you can get a kit which contains an IR Remote, IR Receiver, IR LED for you DIY purpose & jumper wires as shown in image.

Test Program For IR Remote

You can download above code from here.

Code explanation: Here we will use remote as shown in first image of tutorial which is easily available in market. You need IRremote library in this code which is available in library manager. IR receiver signal pin is connected to Pin 11 of Arduino. You need to define two variables; IRrecv irrecv(receiver);- to receive values from IR module, decode_results results;-to compare results value & print text accordingly.

You need to enable receiving using irrecv.enableIRIn(); in void setup() loop which runs in first cycle only. In void loop(), it continuously scans if IR module receives any signal. If it finds any signal then it calls translateIR() loop & then receives new value.

In translateIR() loop switch function is used which compares received value with preset values & print text accordingly. For example, When you press Up/Forward key on remote than remote will transmit a hex value FF629D which is received by IR module, compared in switch condition & print FORWARD in serial monitor. Each key has different value as per make. After printing it will complete the loop with delay of 500ms. Each key of remote has different hex value, you can try other remotes by removing switch condition & directly print hex value in serial monitor, for example;

You can download above code from here.

You can make your own IR remote using a keypad, IR LED & Arduino as per your requirement. Receive key value, compare it with preset & write value on IR LED. In that case you need to add ‘irsend.sendNEC(0x34895725, 32);}’ to transmit the value where 34895725 is the value to transmit & 32 is size of IR signal. For transmitter, IR LED must be connected in Pin 3 as it is defined in IRremote library. (All IR send & receive examples are available in IRremote library).

Device control using IR

You can control device using IR remote/transmitter easily. In this test code, we will control 4 outputs on pin 7, 6, 5 & 4 using numerical keys on IR remote.

You can download above code from here.

As shown in code, it compares received signal with preset values of IR remote control numeric key hex values. You can change the value according to your remote if you know hex values of each button, If you don’t know than use second code in tutorial which is IR remote test code & set it in #define functions.

I hope this tutorial will be helpful to use IR transmission & receiving in your DIY stuff. Give your feedback about this tutorial in Contact, Your feedback will be appreciated.

Subscribe BYB on FacebookTwitterInstagram & Telegram for latest updates.

Leave a Reply

Your email address will not be published. Required fields are marked *