IR Sensor Module

What is an IR module? How does it work ? And most importantly, how can you use it? This post covers it all.

An active IR module is an electronic device with 4 components-An IR transmitter and receiver pair(also called opto-couple), an Op-Amp(Operational Amplifier), a variable resistor and an output LED. It can be given 3.3V or 5V power supply with maximal current 20mA.

A passive IR module used mainly for thermal detection, doesn’t have a transmitting bulb.

IR stands for Infra-Red light. It has a lower (hence infra) frequency than visible red light (Infra-Red: 3×1011Hz-4×1014Hz, Visible red: 4.3×1014Hz). A tungsten lamp is a typical infrared radiator. IR is basically electromagnetic radiation emitted by heated objects in accordance with the 3 radiation laws: Wein’s, Planck’s and Stefan’s radiation laws.

Working of IR Module – In brief:

The transmitter is a bulb which emits light onto a surface .The receiver is a photodiode which absorbs the light reflected back from the surface. The voltage across the photodiode series resistance changes corresponding to the light absorbed by the photodiode. This voltage value is fed to a comparator(Op-Amp) and compared with a threshold value.

If Vinput>VThreshold ,  comparator output is High whereas

If Vinput<VThreshold , comparator output is Low

The  comparator output is connected to an LED bulb in a standalone IR module. The LED bulb glows accordingly.

Now let’s have a look at the components on the PCB.

IR transmitter-receiver pair

This looks like a pair of LED bulbs on the IR module. The transmitter is an IR emitter and is transparent for maximum emission. The receiver is a photodiode made of Gallium Arsenide which is black in color for maximum absorbance.

The photodiode is a p-n junction semiconductor diode operating in reverse bias. The semiconductor, of course, is chosen such that it operates below breakdown voltage.

The amount of light received drives the current flow through the resistor connected in series with the photodiode. The voltage across the resistor is fed to one input of the Op-Amp.


Op-Amp (IC LM358)

It has 2 inputs, one connected to a potentiometer, is used to set the threshold value. The other is connected to the photodiode’s output series resistor. The output of the Op-Amp is connected to an LED which indicates output of IR sensor. The same output is also read into the microcontroller GPIO for further processing and decision making.


Variable resistor:

It is used to set the distance range of the IR sensor. It is usually preset, depending on the specifications of the transmitter–receiver pair.

Circuit diagram:

The red box highlights the voltage divider formed since the photodiode acts like a variable resistor depending on the intensity of incident light

IR sensor module circuit


The photodiode is a p-n junction diode in reverse bias as mentioned earlier.  Typically  resistance of the photodiode varies from 1k-10k from light to dark(no light). Now when the photodiode is connected in series with a 10k resistor , and the voltage is tapped at the node between them, it forms a voltage divider network, shown by the red box in the diagram.

Plugging the resistances and 5V supply voltage  in the voltage divider equation:

When maximum IR light is incident, Voltage at pin 3(non-inverting pin of op-amp)

When no light is incident,

So when maximum IR light is incident, voltage drop is higher(4.54V).

These values are compared against the threshold voltage value set at pin2 (inverting pin) of the Op Amp. Suppose you set VTh to 3V by turning the variable resistor knob (which btw is also a voltage divider network) . When the amount of light reflected by the object increases as the object comes nearer, the voltage at V3 also increases , when it crosses 3V, the digital output of the comparator is 1. The LED connected to the  comparator o/p glows indicating presence of object.


IR module use-cases:

  1. Use as a Proximity sensor

When an object is placed in front of the IR sensor (within range), light emitted by the transmitter is reflected back by the object and absorbed by the photodiode. This is called indirect incidence. The amount of light received varies with the distance of the object from the receiver. Closer the object, more the light reflected. So the voltage drop across the photodiode series resistor will be higher(Voltage is directly proportional to current through resistor), it crosses threshold value when object is nearest and the output LED turns ON.(nearness to threshold value depends on the values you set) You can also connect the output pin to a microcontroller such as an Arduino instead of an LED. That way you can take any other action when an obstacle is detected.

When you use IR sensor for making a people counter you must place the emitter LED and photodiode opposite each other. The photodiode continues to detect the emitter light by direct incidence, and returns 1 at digital o/p until suddenly when there is an obstacle or person in the path of the IR rays, the photodiode current drops to near 0,digital o/p is also 0.

Note: IR sensors are very sensitive to ambient light and heat so it’s not a great choice if you want to build a vehicle proximity detector in a busy traffic junction. You can use a highly sensitive ultrasonic sensor instead.


  1. Use as a colour detector

A white surface reflects all the light incident on it as opposed to a black surface which absorbs all the incident radiation. In the simplest application, a robot can be made to follow a white line on a black surface.  The colour spectrum in between can be detected and used by an IR module with an analog output pin.

To use it as a colour detector, connect the analog output pin to the analog input pin of your Arduino or any other microcontroller.

Specific Industrial Applications:

Now let us check out some specific applications.

  • Passive IR sensors only detect the heat radiated by objects and are used in missile guidance systems, motion detectors, night vision mapping, thermometry etc.

Eg: Melexis MLX90614 Datasheet

  • IR is used in optical communication. The Infrared Data Association provides standards for IR communication.
  • A typical IR sensor module with both emitter and detector called active IR sensor can be used in your robot to avoid obstacles and follow lines. It is also used as a position encoder.
  • Another active IR sensor is the LiDAR or LIght Detection And Ranging . It is a remote sensing method for measuring distances and elevations. It uses IR light concentrated into LASER pulses which reflect off the earth’s surface and are detected by a sensor. The amount of time taken for each IR laser pulse to bounce back is measured.
  • A digital tachometer also uses an IR transmitter-detector pair aligned side by side. The disc or wheel whose speed or RPM has to be measured is placed in front of the pair. The distance between them must be less than 1cm.  A reflective strip is pasted on the wheel. When the reflective strip passes in front of the transmitter, IR waves are reflected back to the detector.  Hence the number of rotations per minute can be measured.
  • IR sensors are commonly used to make simple line following robots. They can follow either a black line or a white line.

A more advanced proximity sensor used in home based IoT systems is  the Vishay TSSP77P38Datasheet

We might not have Harry Potter’s Secrecy Sensors or Dark Detectors  but carry on reading posts like these and who knows, you might make them one day! We are magicians of a different breed indeed:)


Leave a Reply

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