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

How to Use TCRT-5000 IR sensor: Examples, Pinouts, and Specs

Image of TCRT-5000 IR sensor
Cirkit Designer LogoDesign with TCRT-5000 IR sensor in Cirkit Designer

Introduction

The TCRT-5000 IR sensor is a compact, reflective sensor that incorporates an infrared emitter and a phototransistor in a leaded package which blocks visible light. It is widely used for proximity sensing, line following robots, and object detection, making it a popular choice in robotics and automation projects.

Explore Projects Built with TCRT-5000 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!
Raspberry Pi Zero-Based IR Sensor Array
Image of CSC 615 A4: A project utilizing TCRT-5000 IR sensor in a practical application
This circuit integrates a Raspberry Pi Zero with two types of IR sensors: a TCRT 5000 IR sensor and a generic IR sensor. The Raspberry Pi Zero is configured to receive digital output signals from both sensors on GPIO14 and GPIO15 respectively, allowing it to process and respond to infrared light detection. The 5V and GND pins of the Raspberry Pi Zero provide power to both IR sensors, establishing a common voltage reference.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP-8266 Based Obstacle Detection System with IR and Ultrasonic Sensors
Image of iot rev: A project utilizing TCRT-5000 IR sensor in a practical application
This circuit integrates two types of sensors, the TCRT 5000 IR sensors and HC-SR04 Ultrasonic sensors, with an ESP-8266 microcontroller. The IR sensors are connected to both analog and digital input pins on the ESP-8266, allowing for both threshold-based and precise distance measurements. The ultrasonic sensors are interfaced with digital pins for triggering and echo reception, enabling distance measurement through time-of-flight calculations. The ESP-8266 likely processes these sensor inputs for applications such as obstacle detection or proximity sensing, and could potentially communicate the data wirelessly given its capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Leonardo-Based Line Following Robot with TCRT-5000 IR Sensors and L298N Motor Driver
Image of compt_neapolis_nebeul: A project utilizing TCRT-5000 IR sensor in a practical application
This circuit is a line-following robot that uses four TCRT-5000 IR sensors to detect the path and an Arduino Leonardo to process the sensor data. The Arduino controls two DC motors via an L298N motor driver module, powered by a 7.4V battery and a rocker switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Controlled Dual Gearmotor System with IR Sensing
Image of esp32 BLETHOOTH with motor driver: A project utilizing TCRT-5000 IR sensor in a practical application
This circuit features an ESP32 microcontroller interfaced with three TCRT 5000 IR sensors and two DC gearmotors controlled by an L298N motor driver. The ESP32 reads digital outputs from the IR sensors to likely make decisions based on line or obstacle detection, and it controls the gearmotors' directions and speeds, possibly for a robot or automated system. Power is supplied by a 6V battery connected to the motor driver, which also provides 5V to the ESP32 and the IR sensors.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with TCRT-5000 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 CSC 615 A4: A project utilizing TCRT-5000 IR sensor in a practical application
Raspberry Pi Zero-Based IR Sensor Array
This circuit integrates a Raspberry Pi Zero with two types of IR sensors: a TCRT 5000 IR sensor and a generic IR sensor. The Raspberry Pi Zero is configured to receive digital output signals from both sensors on GPIO14 and GPIO15 respectively, allowing it to process and respond to infrared light detection. The 5V and GND pins of the Raspberry Pi Zero provide power to both IR sensors, establishing a common voltage reference.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of iot rev: A project utilizing TCRT-5000 IR sensor in a practical application
ESP-8266 Based Obstacle Detection System with IR and Ultrasonic Sensors
This circuit integrates two types of sensors, the TCRT 5000 IR sensors and HC-SR04 Ultrasonic sensors, with an ESP-8266 microcontroller. The IR sensors are connected to both analog and digital input pins on the ESP-8266, allowing for both threshold-based and precise distance measurements. The ultrasonic sensors are interfaced with digital pins for triggering and echo reception, enabling distance measurement through time-of-flight calculations. The ESP-8266 likely processes these sensor inputs for applications such as obstacle detection or proximity sensing, and could potentially communicate the data wirelessly given its capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of compt_neapolis_nebeul: A project utilizing TCRT-5000 IR sensor in a practical application
Arduino Leonardo-Based Line Following Robot with TCRT-5000 IR Sensors and L298N Motor Driver
This circuit is a line-following robot that uses four TCRT-5000 IR sensors to detect the path and an Arduino Leonardo to process the sensor data. The Arduino controls two DC motors via an L298N motor driver module, powered by a 7.4V battery and a rocker switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of esp32 BLETHOOTH with motor driver: A project utilizing TCRT-5000 IR sensor in a practical application
ESP32-Controlled Dual Gearmotor System with IR Sensing
This circuit features an ESP32 microcontroller interfaced with three TCRT 5000 IR sensors and two DC gearmotors controlled by an L298N motor driver. The ESP32 reads digital outputs from the IR sensors to likely make decisions based on line or obstacle detection, and it controls the gearmotors' directions and speeds, possibly for a robot or automated system. Power is supplied by a 6V battery connected to the motor driver, which also provides 5V to the ESP32 and the IR sensors.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Technical Details

  • Operating Voltage: 3.3V to 5V
  • Current Consumption: 60mA (max)
  • Output Type: Analog voltage corresponding to the amount of reflected IR light
  • Peak Operating Distance: 2.5mm (typical optimal sensing distance)
  • Wavelength: 950 nm

Pin Configuration and Descriptions

Pin Number Name Description
1 Vcc Power supply (3.3V to 5V)
2 GND Ground connection
3 AO Analog output voltage
4 DO Digital output (active low)

Usage Instructions

Connecting the TCRT-5000 to a Circuit

  1. Connect the Vcc pin to the power supply (3.3V to 5V).
  2. Connect the GND pin to the ground of the power supply.
  3. The AO pin provides an analog output which can be connected to an analog input pin on a microcontroller.
  4. The DO pin provides a digital output and can be connected to a digital input pin on a microcontroller.

Important Considerations and Best Practices

  • Ensure that the sensor is not exposed to direct sunlight or other strong light sources as it may interfere with the sensor's operation.
  • The optimal sensing distance is typically around 2.5mm, but it can detect objects at varying distances by adjusting the potentiometer on the back of the sensor module.
  • Use a current limiting resistor with the IR LED if you are not using a module that already includes one.

Example Code for Arduino UNO

// Define the TCRT-5000 sensor's analog and digital pins
const int analogPin = A0; // Analog output from the sensor
const int digitalPin = 2; // Digital output from the sensor

void setup() {
  pinMode(digitalPin, INPUT); // Set the digital pin as input
  Serial.begin(9600);        // Start serial communication at 9600 baud
}

void loop() {
  int analogValue = analogRead(analogPin); // Read the analog value
  int digitalValue = digitalRead(digitalPin); // Read the digital value

  // Print the values to the serial monitor
  Serial.print("Analog Value: ");
  Serial.print(analogValue);
  Serial.print("\tDigital Value: ");
  Serial.println(digitalValue);

  delay(100); // Wait for 100 milliseconds before the next loop
}

Troubleshooting and FAQs

Common Issues

  • Sensor not responding: Ensure that the sensor is properly powered and that the pins are correctly connected.
  • Inconsistent readings: Check for any external light interference and adjust the potentiometer for sensitivity.
  • No digital output: Verify that the threshold has been properly set for the digital output to trigger.

Solutions and Tips for Troubleshooting

  • If the sensor is not functioning, double-check the wiring and ensure that the power supply is within the specified range.
  • For erratic sensor readings, calibrate the sensor by adjusting the onboard potentiometer while monitoring the analog output.
  • Ensure that the surface being detected is not too reflective or too absorbent of IR light, as this can affect the sensor's performance.

FAQs

Q: Can the TCRT-5000 detect colors? A: The TCRT-5000 is not designed to detect colors; it detects the presence of an object based on reflected IR light.

Q: What is the maximum sensing distance of the TCRT-5000? A: The maximum sensing distance varies but is typically around a few millimeters. It can be adjusted using the onboard potentiometer.

Q: How can I increase the sensing range of the TCRT-5000? A: The sensing range can be increased by adjusting the potentiometer to increase the sensitivity or by using external optics to focus the IR light.

Q: Is the TCRT-5000 sensor waterproof? A: No, the TCRT-5000 is not waterproof. Care should be taken to protect it from moisture and other environmental factors that could damage the sensor.