What is IR Sensor – Infrared Radiation Sensor with Arduino 1

Infrared (IR) sensors work by detecting and responding to infrared radiation, which is electromagnetic radiation with wavelengths longer than those of visible light but shorter than microwaves. IR sensors use various principles and technologies to sense this radiation, depending on their intended applications. Here is a general overview of how IR sensors work.

How does an IR sensor work?

  1. Emission of Infrared Radiation: In some cases, IR sensors emit their own infrared radiation. For example, IR proximity sensors and IR thermometers have an emitter that produces controlled IR radiation. The emitted IR radiation is direct towards the object or area being monitor.
  2. Reception of Infrared Radiation: IR sensors designed for detection, such as IR receivers or IR motion sensors, do not emit infrared radiation themselves but instead receive the infrared radiation emitted or reflected by objects in their field of view.
  3. Detection Mechanism: The core component of an IR sensor is a detection mechanism that can respond to changes in IR radiation. The type of detection mechanism varies depending on the specific sensor technology being use:
    • Photodiode/Phototransistor: Some IR sensors use photodiodes or phototransistors, which are semiconductor devices that generate a current or voltage when exposed to light, including infrared light. When IR radiation hits the photodiode or phototransistor, it produces an electrical response.
    • Pyroelectric Sensor: Pyroelectric sensors are commonly use in IR motion sensors like PIR sensors. These sensors consist of pyroelectric crystals that generate a voltage when their temperature changes. When an object moves in front of the sensor, it causes a temperature change in the crystal due to the differential absorption of IR radiation, resulting in a voltage signal.
    • Thermopile: IR thermometers often use thermopiles, which are compose of multiple thermocouples connect in series. Each thermocouple generates a voltage proportional to the temperature difference between its two ends. When exposed to IR radiation, one end of the thermopile absorbs more heat than the other, creating a temperature difference and generating a voltage.
  4. Signal Processing: The electrical signal generate by the detection mechanism is then process by the sensor’s internal circuitry. This circuitry may include amplifiers, filters, and signal conditioners to enhance the accuracy and reliability of the sensor’s response.
  5. Output: Depending on the sensor’s design and application, it may provide different types of output signals. For example, an IR receiver used in remote controls typically demodulates the received IR signal and converts it into digital data. In contrast, an IR motion sensor might produce a logical high or low signal when motion is detect.
  6. Interpretation and Action: The output of the IR sensor is often use to trigger specific actions or provide data to a control system. For example, in an IR remote control, the sensor’s output is interpret as a command to change the channel or adjust the volume on a TV.

The specific operation of an IR sensor can vary widely depending on its type and application. Whether it’s detecting the presence of an object, measuring its temperature, or receiving data from a remote control, IR sensors play a crucial role in a wide range of devices and systems.

Arduino Code


* Company Name:LK Tronics
* Author: Research & Development Department
* Date: 2020/ 03/ 01
* https://lk-tronics.com/
* All rights reserved. No part of this code may be reproduced, distributed,
* or transmitted in any form or by any means, including photocopying, recording,
* or other electronic or mechanical methods, without the prior written permission
* of LK Tronics, except in the case of brief quotations embodied in
* critical reviews and certain other noncommercial uses permitted by copyright law.


int IRSensor = 2; //ir sensor module to Arduino pin 2
int LED = 5; //LED to Arduino pin 5

void setup(){

  pinMode(IRSensor, INPUT); // IR Sensor pin INPUT
  pinMode(LED, OUTPUT); // LED Pin Output

void loop(){

  int Status = digitalRead(IRSensor); // Set the GPIO as Input
  if (Status == 1) // Check if the pin high or not
    // if the pin is high turn off the onboard Led
    digitalWrite(LED, LOW); // LED LOW
    Serial.println("Motion Ended!"); // print Motion Detected! on the serial monitor window

    digitalWrite(LED, HIGH); // LED High
    Serial.println("Motion Detected!"); // print Motion Ended! on the serial monitor window



One Comment

  1. Hello, I enjoy reading through your article post. I wanted to write a little comment to support you.

Leave a Reply