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

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

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

Introduction

The Keyes IR Sensor Module, manufactured by ETC_BVN (Part ID: uno), is an infrared sensor used for detecting objects and measuring distance by emitting and receiving infrared light. This versatile component is widely used in various applications, including obstacle detection, line-following robots, and proximity sensing.

Explore Projects Built with Keyes IR

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based Battery-Powered Universal IR Remote with OLED Display
Image of IR remote: A project utilizing Keyes IR in a practical application
This circuit is an IR remote control system using an ESP32 microcontroller. It includes an IR receiver and transmitter for capturing and sending IR signals, an OLED display for user interface, and multiple buttons for user input. The system can store and manage multiple remote control codes.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Security System with RFID and Laser Intrusion Detection
Image of CPE doorlock system upgrade: A project utilizing Keyes IR in a practical application
This circuit is a security and access control system featuring motion detection, laser beam-break sensing, and RFID scanning, interfaced with a keypad and visual/audible indicators, powered by a solar-charged battery, and capable of controlling an electric lock via a relay.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based IR LED Control and Keypad Input with LCD Display
Image of UNDERWATER: A project utilizing Keyes IR in a practical application
This circuit uses an Arduino UNO to control an IR LED, read input from a 4x4 keypad, and display messages on a 16x2 I2C LCD screen. The Arduino runs code to blink the IR LED, capture and print keypad inputs, and display a static message on the LCD.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based IR Sensor and LCD Display System with Servo Control
Image of circuit diagram: A project utilizing Keyes IR in a practical application
This circuit features two Arduino UNO microcontrollers interfaced with multiple IR sensors, an LCD display, a servo motor, and a 4x4 membrane keypad. The circuit is designed to read inputs from the IR sensors and keypad, display information on the LCD, and control the servo motor, likely for a user-interactive application or automated system.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Keyes IR

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 remote: A project utilizing Keyes IR in a practical application
ESP32-Based Battery-Powered Universal IR Remote with OLED Display
This circuit is an IR remote control system using an ESP32 microcontroller. It includes an IR receiver and transmitter for capturing and sending IR signals, an OLED display for user interface, and multiple buttons for user input. The system can store and manage multiple remote control codes.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of CPE doorlock system upgrade: A project utilizing Keyes IR in a practical application
ESP32-Based Security System with RFID and Laser Intrusion Detection
This circuit is a security and access control system featuring motion detection, laser beam-break sensing, and RFID scanning, interfaced with a keypad and visual/audible indicators, powered by a solar-charged battery, and capable of controlling an electric lock via a relay.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of UNDERWATER: A project utilizing Keyes IR in a practical application
Arduino UNO-Based IR LED Control and Keypad Input with LCD Display
This circuit uses an Arduino UNO to control an IR LED, read input from a 4x4 keypad, and display messages on a 16x2 I2C LCD screen. The Arduino runs code to blink the IR LED, capture and print keypad inputs, and display a static message on the LCD.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of circuit diagram: A project utilizing Keyes IR in a practical application
Arduino UNO-Based IR Sensor and LCD Display System with Servo Control
This circuit features two Arduino UNO microcontrollers interfaced with multiple IR sensors, an LCD display, a servo motor, and a 4x4 membrane keypad. The circuit is designed to read inputs from the IR sensors and keypad, display information on the LCD, and control the servo motor, likely for a user-interactive application or automated system.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Technical Details

Parameter Value
Operating Voltage 3.3V - 5V
Operating Current 20mA
Detection Range 2cm - 30cm
Output Type Digital (High/Low)
Dimensions 32mm x 14mm x 7mm
Weight 2g

Pin Configuration and Descriptions

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

Usage Instructions

How to Use the Component in a Circuit

  1. Power Supply: Connect the VCC pin to a 3.3V or 5V power supply and the GND pin to the ground of your circuit.
  2. Output Signal: Connect the OUT pin to a digital input pin on your microcontroller (e.g., Arduino UNO).

Example Circuit Diagram

  Arduino UNO          Keyes IR Sensor Module
  ------------         -----------------------
  5V  ----------------> VCC
  GND ----------------> GND
  Digital Pin 2 ------> OUT

Arduino UNO Example Code

// Keyes IR Sensor Module Example Code
// Connect the OUT pin of the sensor to digital pin 2 on the Arduino UNO

const int sensorPin = 2; // Pin connected to the sensor's OUT pin
const int ledPin = 13;   // Pin connected to the onboard LED

void setup() {
  pinMode(sensorPin, INPUT); // Set sensor pin as input
  pinMode(ledPin, OUTPUT);   // Set LED pin as output
  Serial.begin(9600);        // Initialize serial communication
}

void loop() {
  int sensorValue = digitalRead(sensorPin); // Read the sensor value

  if (sensorValue == HIGH) {
    digitalWrite(ledPin, HIGH); // Turn on the LED if object is detected
    Serial.println("Object detected!");
  } else {
    digitalWrite(ledPin, LOW);  // Turn off the LED if no object is detected
    Serial.println("No object detected.");
  }

  delay(100); // Small delay to avoid serial monitor flooding
}

Important Considerations and Best Practices

  • Power Supply: Ensure the sensor is powered within the specified voltage range (3.3V - 5V).
  • Interference: Avoid placing the sensor near sources of infrared interference, such as direct sunlight or other IR-emitting devices.
  • Distance Calibration: The detection range can vary based on the reflectivity of the object. Test and calibrate the sensor for your specific application.

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Detection:

    • Issue: The sensor does not detect any objects.
    • Solution: Check the power connections and ensure the sensor is properly powered. Verify that the object is within the detection range (2cm - 30cm).
  2. False Positives:

    • Issue: The sensor detects objects when there are none.
    • Solution: Ensure there are no sources of infrared interference nearby. Adjust the sensor's position and angle.
  3. Inconsistent Readings:

    • Issue: The sensor provides inconsistent readings.
    • Solution: Verify stable power supply and proper grounding. Ensure the sensor is not exposed to rapid changes in ambient light.

FAQs

  • Q: Can the Keyes IR Sensor Module detect transparent objects?

    • A: The sensor may have difficulty detecting transparent objects due to low reflectivity of infrared light.
  • Q: What is the maximum detection range of the sensor?

    • A: The maximum detection range is approximately 30cm, but it can vary based on the object's reflectivity.
  • Q: Can I use the sensor with a 3.3V microcontroller?

    • A: Yes, the sensor operates within a voltage range of 3.3V to 5V, making it compatible with both 3.3V and 5V microcontrollers.

By following this documentation, users can effectively integrate the Keyes IR Sensor Module into their projects, ensuring reliable object detection and distance measurement.