Stufin
Home Quick Cart Profile

TCRT5000 IR Sensor (Pack of 5)

Buy Now

Component Description

TCRT5000 IR Sensor (Pack of 5)

Overview

The TCRT5000 IR Sensor is a reflective infrared sensor module designed for detection and tracking of objects, obstacles, or people. This sensor is widely used in robotics, automation, and IoT projects for various applications such as obstacle avoidance, line following, and object detection. This pack includes 5 individual TCRT5000 IR sensors.

Functionality

The TCRT5000 IR Sensor module operates by emitting an invisible infrared light beam from the LED emitter, which is then reflected back to the phototransistor detector when an object is nearby. The sensor detects the reflected light and outputs a digital signal indicating the presence or absence of an object.

Key Features

  • Infrared Emitter and Detector: The TCRT5000 IR Sensor module consists of an infrared LED emitter and a phototransistor detector, which are both housed in a single package.
  • Digital Output: The sensor provides a digital output signal, making it easy to interface with microcontrollers, Arduino boards, and other electronic devices.
  • Adjustable Sensitivity: The sensor has a built-in potentiometer to adjust the sensitivity of the sensor, allowing for fine-tuning of the detection range.
  • Short Response Time: The TCRT5000 IR Sensor has a fast response time, ensuring quick detection of objects and accurate tracking.
  • Low Power Consumption: The sensor operates at a low voltage (5V) and consumes minimal current, making it suitable for battery-powered devices.
  • Compact Size: The sensor module is compact and lightweight, making it ideal for integration into small robots, drones, and other IoT devices.
  • Pack of 5: This pack includes five individual TCRT5000 IR sensors, providing a cost-effective solution for prototyping and development.

Technical Specifications

Operating Voltage

5V

Operating Current

20mA (typical)

Detection Range

1-10cm (adjustable via potentiometer)

Response Time

10s (typical)

Output Signal

Digital ( HIGH or LOW)

Operating Temperature

-20C to 80C

Package Dimensions

10mm x 10mm x 5mm (L x W x H)

Applications

Obstacle avoidance systems for robots and drones

Line following and track detection in autonomous vehicles

Object detection and tracking in IoT and automation projects

Proximity sensing and gesture recognition

Industrial automation and robotics

Smart home and building automation systems

Pinout and Wiring

The TCRT5000 IR Sensor module has three pins

VCC (5V power supply)

GND (ground)

OUT (digital output signal)

Connect the VCC pin to a 5V power supply, GND pin to ground, and OUT pin to a digital input on your microcontroller or Arduino board.

Pin Configuration

  • TCRT5000 IR Sensor Module
  • The TCRT5000 IR Sensor Module is a popular infrared reflectance sensor used in various robotics and automation projects. It is a versatile and reliable sensor that detects objects by measuring the reflected IR light. Here is a detailed explanation of the pins on the TCRT5000 IR Sensor Module:
  • Pinout:
  • The TCRT5000 IR Sensor Module has 5 pins, labeled as follows:
  • 1. VCC (Power Supply):
  • Description: Power supply pin for the sensor module.
  • Voltage Range: 4.5V to 5.5V (typical operating voltage is 5V).
  • Connection: Connect to a positive power supply (e.g., +5V from an Arduino or a breadboard power supply).
  • 2. GND (Ground):
  • Description: Ground pin for the sensor module.
  • Connection: Connect to a ground pin on your microcontroller or a common ground point on your breadboard.
  • 3. OUT (Output):
  • Description: Digital output pin that indicates the presence or absence of an object.
  • Logic Level:
  • + High (H) when an object is detected (IR light is reflected).
  • + Low (L) when no object is detected (no IR light is reflected).
  • Connection: Connect to a digital input pin on your microcontroller (e.g., Arduino).
  • 4. EN (Enable):
  • Description: Enable pin for the internal IR LED.
  • Logic Level:
  • + High (H) to enable the IR LED.
  • + Low (L) to disable the IR LED.
  • Connection: Typically connected to a digital output pin on your microcontroller (e.g., Arduino) to control the IR LED.
  • 5. N/C (No Connection):
  • Description: No internal connection.
  • Connection: Leave this pin unconnected.
  • Connection Structure:
  • Here's a suggested connection structure for the TCRT5000 IR Sensor Module:
  • Connect VCC to a positive power supply (e.g., +5V from an Arduino or a breadboard power supply).
  • Connect GND to a ground pin on your microcontroller or a common ground point on your breadboard.
  • Connect OUT to a digital input pin on your microcontroller (e.g., Arduino).
  • Connect EN to a digital output pin on your microcontroller (e.g., Arduino) to control the IR LED.
  • Leave the N/C pin unconnected.
  • Example Connection Diagram:
  • Suppose we're using an Arduino Uno board to interface with the TCRT5000 IR Sensor Module. Here's an example connection diagram:
  • VCC -> Arduino Uno 5V pin
  • GND -> Arduino Uno GND pin
  • OUT -> Arduino Uno Digital Pin 2
  • EN -> Arduino Uno Digital Pin 3
  • N/C -> Leave unconnected
  • In this example, we're using Digital Pin 2 to read the sensor output and Digital Pin 3 to control the IR LED. You can adjust the pin connections according to your specific project requirements.

Code Examples

TCRT5000 IR Sensor Documentation
Overview
The TCRT5000 IR Sensor is a reflective infrared sensor used to detect objects or obstacles. It consists of an infrared transmitter and receiver pair, allowing it to detect the reflected light and determine the presence or absence of an object. This sensor is commonly used in robotics, automation, and IoT applications.
Key Features
High accuracy and sensitivity
 Adjustable detection range (5-30 mm)
 Infrared wavelength: 940 nm
 Operating voltage: 5V
 Output type: Digital (High/Low signal)
Pinout
| Pin | Function |
| --- | --- |
| VCC | Power supply (5V) |
| GND | Ground |
| OUT | Digital output (High/Low signal) |
Example 1: Basic Object Detection using Arduino
This example demonstrates how to use the TCRT5000 IR Sensor to detect an object using an Arduino board.
Hardware Requirements
Arduino Uno or compatible board
 TCRT5000 IR Sensor
 Breadboard and jumper wires
Code
```c
const int sensorPin = 2;  // Pin 2 as output pin
void setup() {
  pinMode(sensorPin, INPUT);
  Serial.begin(9600);
}
void loop() {
  int sensorState = digitalRead(sensorPin);
  if (sensorState == HIGH) {
    Serial.println("Object detected!");
  } else {
    Serial.println("No object detected.");
  }
  delay(50);
}
```
Explanation
In this example, we connect the OUT pin of the TCRT5000 IR Sensor to digital pin 2 of the Arduino board. We then read the output of the sensor using the `digitalRead()` function and print the result to the serial monitor. If the output is HIGH, it indicates that an object is detected.
Example 2: Line Follower Robot using Raspberry Pi
This example demonstrates how to use the TCRT5000 IR Sensor to implement a line follower robot using a Raspberry Pi.
Hardware Requirements
Raspberry Pi 3 or compatible board
 TCRT5000 IR Sensor
 L298N motor driver
 DC motors
 Breadboard and jumper wires
Code
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
# Sensor pin connections
sensor_pin = 17
# Motor pin connections
motor_left_forward = 23
motor_left_backward = 24
motor_right_forward = 25
motor_right_backward = 26
GPIO.setup(sensor_pin, GPIO.IN)
GPIO.setup(motor_left_forward, GPIO.OUT)
GPIO.setup(motor_left_backward, GPIO.OUT)
GPIO.setup(motor_right_forward, GPIO.OUT)
GPIO.setup(motor_right_backward, GPIO.OUT)
while True:
    sensor_state = GPIO.input(sensor_pin)
    if sensor_state == GPIO.HIGH:
        # Object detected, turn left
        GPIO.output(motor_left_forward, GPIO.HIGH)
        GPIO.output(motor_left_backward, GPIO.LOW)
        GPIO.output(motor_right_forward, GPIO.LOW)
        GPIO.output(motor_right_backward, GPIO.HIGH)
    else:
        # No object detected, move forward
        GPIO.output(motor_left_forward, GPIO.HIGH)
        GPIO.output(motor_left_backward, GPIO.LOW)
        GPIO.output(motor_right_forward, GPIO.HIGH)
        GPIO.output(motor_right_backward, GPIO.LOW)
    time.sleep(0.05)
```
Explanation
In this example, we connect the OUT pin of the TCRT5000 IR Sensor to GPIO pin 17 of the Raspberry Pi. We then read the output of the sensor using the `GPIO.input()` function and control the DC motors using the L298N motor driver. If the output is HIGH, it indicates that an object is detected, and the robot turns left. Otherwise, it moves forward.
Remember to adjust the sensor's detection range and threshold values according to your specific requirements.