IR Sensor-TCRT5000 Pin And Working Details

The TCRT5000 and TCRT5000L are reflective sensors which include an infrared emitter and photo-transistor in a leaded package which blocks visible light. The package includes two mounting clips. TCRT5000L is the long lead version.
1. IR sensor with transistor output.
2. Operating Voltage:5V.
3. Diode forward Current: 60mA.
4. Output: Analog or digital data.
5. Transistor collector current: 100mA.
6. Operating temperature: -25°C to +85°C
The TCRT500 sensor is just a combination of a photodiode and a photo transistor. The photo diode is powered through a current limiting resistor of value 220R and the Transistor is also grounded through a 10K resistor as shown in the below picture. The transistor does not have a base pin because the biasing of the transistor is controlled by the amount of IR light it receives. So basically the IR light from the photo diode hits an object/surface and returns back to the photo transistor to bias it.
IR Sensor Circuit FOR TCRT 5000.
The TCRT5000 is an IR sensor unit. It has both a Photodiode and a Phototransistor coupled in its package. The photo diode has two pins (Anode and Cathode) which can be used to generate an IR signal. Similarly the Photo transistor also has two pins (Collector and Emitter) which can be used to read the IR signal that is reflected back. This sensor can be used to detect the presence of object or any other reflective surface in front it, also with some level of programming it can also calculate the distance of the object in front it. But the distance can only be calculated for short range objects and is also subjected o environmental disturbance. So if you look for a sensor to measure distance of an object in front of it.
This sensor can either be used as an analog sensor or as a digital sensor. If we only have to detect the presence of an object then the sensor will be used as digital sensor if the distance of the object should also has to be measured then the sensor is used as a analog sensor. For either method the circuit diagram shown above will remain the same.
1. Package type: leaded.
2. Detector type: photo-transistor.
3. Peak operating distance: 2.5 mm.
4. Operating range within > 20 % relative.
5. collector current: 0.2 mm to 15 mm.
6. Typical output current under test: IC = 1 mA.
7. Daylight blocking filter.
8. Emitter wavelength: 950 nm.
9. Lead (Pb)-free soldering released
Commonly used in proximity detection applications
1. Line follower or maze solver robots
2. Distinguish between reflective and non-reflective surface
3. Obstacle detection and avoidance
4. 2D-Model
5. Position sensor for shaft encoder
6. Detection of reflective material such as paper, IBM cards,magnetic tapes.
7. Limit switch for mechanical motions.
Copy and paste the code or download via below given link:
// is an automatic generator of schematics and code
//Copyright (C) 2016 Roboplan Technologies Ltd.
// Include Libraries
#include “Arduino.h”
#include “LiquidCrystal.h”
#include “Button.h”
// Pin Definitions
#define LCD_PIN_RS 7
#define LCD_PIN_E 6
#define LCD_PIN_DB4 2
#define LCD_PIN_DB5 3
#define LCD_PIN_DB6 4
#define LCD_PIN_DB7 5
// Global variables and defines
// object initialization
// define vars for testing menu
const int timeout = 10000; //define timeout of 10 sec
char menuOption = 0;
long time0;
// Setup the essentials for your circuit to work. It runs first every time your circuit is powered with electricity.
void setup()
// Setup Serial which is useful for debugging
// Use the Serial Monitor to view printed messages
while (!Serial) ; // wait for serial port to connect. Needed for native USB
// set up the LCD’s number of columns and rows
lcd.begin(16, 2);
menuOption = menu();
// Main logic of your circuit. It defines the interaction between the components you selected. After setup, it runs over and over again, in an eternal loop.
void loop()
if(menuOption == ‘1’) {
// LCD 16×2 – Test Code
// Print a message to the LCD.
lcd.setCursor(0, 0);
lcd.print(“Circuito Rocks !”);
// Turn off the display:
// Turn on the display:
else if(menuOption == ‘2’)
// Reflective IR Sensor TCRT5000L – Test Code
//read Reflective IR Sensor.
//if the sensor detects an echo function will return LOW (0).
//if it is not detect an echo function will return HIGH (1).
bool ReflectiveIR_Val =;
Serial.print(F(“Val: “)); Serial.println(ReflectiveIR_Val);
if (millis() – time0 > timeout)
menuOption = menu();
// Menu function for selecting the components to be tested
// Follow serial monitor for instrcutions
char menu()
Serial.println(F(“\nWhich component would you like to test?”));
Serial.println(F(“(1) LCD 16×2”));
Serial.println(F(“(2) Reflective IR Sensor TCRT5000L”));
Serial.println(F(“(menu) send anything else or press on board reset button\n”));
while (!Serial.available());
// Read data from serial monitor if received
while (Serial.available())
char c =;
if (isAlphaNumeric(c))
if(c == ‘1’)
Serial.println(F(“Now Testing LCD 16×2”));
else if(c == ‘2’)
Serial.println(F(“Now Testing Reflective IR Sensor TCRT5000L”));
Serial.println(F(“illegal input!”));
return 0;
time0 = millis();
return c;
Download Full Arduino sketch Here. TCRT IR 5000 Sensor Code

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.