Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use IR Sensor : Examples, Pinouts, and Specs

Image of IR Sensor
Cirkit Designer LogoDesign with IR Sensor in Cirkit Designer

Introduction

The IR Sensor (Manufacturer: JLC PCB, Part ID: UNO) is a versatile electronic component designed to detect infrared (IR) radiation. It is widely used in applications such as proximity sensing, motion detection, and remote control systems. The sensor operates by emitting and/or detecting IR light, making it suitable for both reflective and transmissive sensing tasks.

Common applications include:

  • Obstacle detection in robotics
  • Line-following robots
  • Motion detection in security systems
  • Remote control signal reception
  • Non-contact temperature measurement

Explore Projects Built with IR Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO IR Sensor Motion Detector
Image of ir: A project utilizing IR Sensor  in a practical application
This circuit consists of an IR sensor connected to an Arduino UNO. The IR sensor's output is connected to digital pin D2 of the Arduino, while its power and ground pins are connected to the 5V and GND pins of the Arduino, respectively. The Arduino is programmed to read the sensor data and can be used for applications such as object detection or proximity sensing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based IR Sensor and OLED Display System
Image of Tachometer Using IR sensor: A project utilizing IR Sensor  in a practical application
This circuit uses an Arduino UNO to read data from an IR sensor and display the information on a 128x64 OLED display. The IR sensor is connected to the Arduino's analog input A0, while the OLED display communicates with the Arduino via I2C using pins A4 (SDA) and A5 (SCL).
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered IR Sensor Alarm with LED Indicator and Buzzer
Image of PROJECT: A project utilizing IR Sensor  in a practical application
This circuit is a simple IR sensor-based alarm system. When the IR sensor detects an object, it triggers an OR gate, which in turn activates a buzzer and lights up an LED. The circuit is powered by a 9V battery and includes a rocker switch to control the power supply.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Car Detection System with IR Sensors
Image of IR SENSOR: A project utilizing IR Sensor  in a practical application
This circuit uses an ESP32 microcontroller to monitor the presence of a car using four IR sensors. The sensors are connected to GPIO pins 35, 34, 25, and 26 of the ESP32, which reads their values and prints the sensor states to the Serial Monitor. The system is designed to detect and report the status of each sensor in real-time.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with IR Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ir: A project utilizing IR Sensor  in a practical application
Arduino UNO IR Sensor Motion Detector
This circuit consists of an IR sensor connected to an Arduino UNO. The IR sensor's output is connected to digital pin D2 of the Arduino, while its power and ground pins are connected to the 5V and GND pins of the Arduino, respectively. The Arduino is programmed to read the sensor data and can be used for applications such as object detection or proximity sensing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Tachometer Using IR sensor: A project utilizing IR Sensor  in a practical application
Arduino UNO-Based IR Sensor and OLED Display System
This circuit uses an Arduino UNO to read data from an IR sensor and display the information on a 128x64 OLED display. The IR sensor is connected to the Arduino's analog input A0, while the OLED display communicates with the Arduino via I2C using pins A4 (SDA) and A5 (SCL).
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of PROJECT: A project utilizing IR Sensor  in a practical application
Battery-Powered IR Sensor Alarm with LED Indicator and Buzzer
This circuit is a simple IR sensor-based alarm system. When the IR sensor detects an object, it triggers an OR gate, which in turn activates a buzzer and lights up an LED. The circuit is powered by a 9V battery and includes a rocker switch to control the power supply.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of IR SENSOR: A project utilizing IR Sensor  in a practical application
ESP32-Based Car Detection System with IR Sensors
This circuit uses an ESP32 microcontroller to monitor the presence of a car using four IR sensors. The sensors are connected to GPIO pins 35, 34, 25, and 26 of the ESP32, which reads their values and prints the sensor states to the Serial Monitor. The system is designed to detect and report the status of each sensor in real-time.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

The following table outlines the key technical details of the IR Sensor:

Parameter Specification
Operating Voltage 3.3V - 5V
Operating Current 20mA (typical)
Detection Range 2cm - 30cm (adjustable)
Output Type Digital (High/Low)
Wavelength Sensitivity 760nm - 1100nm (Infrared range)
Response Time < 2ms
Operating Temperature -25°C to 85°C

Pin Configuration and Descriptions

The IR Sensor typically has three pins. The table below describes each pin:

Pin Number Pin Name Description
1 VCC Power supply pin (3.3V - 5V)
2 GND Ground pin
3 OUT Digital output pin (High when no object detected, Low when object detected)

Usage Instructions

How to Use the IR Sensor in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to the ground of your circuit.
  2. Connect the Output: Attach the OUT pin to a digital input pin of your microcontroller or to an external circuit for further processing.
  3. Adjust the Sensitivity: Use the onboard potentiometer (if available) to adjust the detection range of the sensor.
  4. Test the Sensor: Place an object within the detection range and observe the output signal on the OUT pin.

Important Considerations and Best Practices

  • Ambient Light Interference: Avoid using the sensor in environments with strong IR sources (e.g., direct sunlight) as it may affect accuracy.
  • Mounting Distance: Ensure the sensor is mounted at an appropriate distance from the object to be detected, within its specified range.
  • Power Supply Stability: Use a stable power supply to avoid erratic behavior.
  • Avoid Overvoltage: Do not exceed the maximum operating voltage of 5V to prevent damage to the sensor.

Example: Connecting the IR Sensor to an Arduino UNO

Below is an example of how to connect and use the IR Sensor with an Arduino UNO:

Circuit Diagram

  • Connect the VCC pin of the IR Sensor to the 5V pin on the Arduino.
  • Connect the GND pin of the IR Sensor to the GND pin on the Arduino.
  • Connect the OUT pin of the IR Sensor to digital pin 2 on the Arduino.

Arduino Code

// IR Sensor Example Code for Arduino UNO
// This code reads the output of the IR sensor and prints the status to the Serial Monitor.

const int irSensorPin = 2; // IR sensor output connected to digital pin 2
int sensorValue = 0;       // Variable to store the sensor reading

void setup() {
  pinMode(irSensorPin, INPUT); // Set the IR sensor pin as input
  Serial.begin(9600);          // Initialize serial communication at 9600 baud
}

void loop() {
  sensorValue = digitalRead(irSensorPin); // Read the sensor output
  if (sensorValue == LOW) {
    // Object detected
    Serial.println("Object detected!");
  } else {
    // No object detected
    Serial.println("No object detected.");
  }
  delay(500); // Wait for 500ms before the next reading
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Sensor Not Detecting Objects

    • Cause: Incorrect wiring or insufficient power supply.
    • Solution: Double-check the connections and ensure the power supply is stable and within the specified range.
  2. False Positives or Erratic Behavior

    • Cause: Ambient IR interference or unstable power supply.
    • Solution: Shield the sensor from strong IR sources and use a decoupling capacitor (e.g., 0.1µF) across the power pins.
  3. Short Detection Range

    • Cause: Sensitivity not properly adjusted.
    • Solution: Use the onboard potentiometer to increase the detection range.
  4. Output Always High or Low

    • Cause: Faulty sensor or incorrect pin connections.
    • Solution: Test the sensor with a multimeter or replace it if necessary. Verify the pin connections.

FAQs

Q1: Can the IR Sensor detect transparent objects?
A1: No, the IR Sensor may not reliably detect transparent objects as they do not reflect sufficient IR light.

Q2: Can I use the IR Sensor with a 3.3V microcontroller?
A2: Yes, the sensor operates within a voltage range of 3.3V to 5V, making it compatible with 3.3V systems.

Q3: How do I increase the detection range?
A3: Adjust the onboard potentiometer to increase the sensitivity and detection range.

Q4: Can the IR Sensor detect heat?
A4: No, this sensor is designed to detect reflected IR light, not heat. For heat detection, use a thermal IR sensor.

By following this documentation, you can effectively integrate and troubleshoot the IR Sensor in your projects.