Table of Contents
KEY TAKEAWAYS
- IR sensor modules detect objects by emitting infrared light and detecting the reflection
- The module outputs a digital HIGH/LOW signal based on whether an obstacle is detected
- Detection range is adjustable via an onboard potentiometer (typically 2-30 cm)
- Common applications include obstacle avoidance robots, line followers, and proximity detection
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 whereasIf Vinput<VThreshold , comparator output is LowThe 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.
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:

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)

IR module use-cases:
Use as a Proximity sensor
Use as a colour detector
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.
- 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.
📖 Related: How to improve readings of Ultrasonic Sensor – Temperature and Humidity Compensation
Related on this site
- IR is one of several proximity-sensing technologies — motion and proximity sensors compares it against PIR, ultrasonic, and accelerometer-based motion detection.
- For a complementary distance-measurement technology, see working of an ultrasonic sensor — ultrasonic works at longer range but is slower and bulkier than IR.
- For a worked project using proximity sensing in practice, see automatic light on/off based on presence of people.

Vivek Bhageria — Lead Firmware R&D Engineer, 12+ years. Ex-Bosch (automotive powertrain), MusicTribe (real-time audio), medical devices. M.Tech BITS Pilani. I write at NerdyElectronics — practical, register-level embedded systems for engineers who want to understand what’s actually happening under the hood.





