TCRT5000 Infrared Reflective Sensor Module
= 5V Digital/Analog IR Detector for Line Following and Obstacle Avoidance =
The TCRT5000 is a popular reflective optical sensor module combining an infrared emitter and a phototransistor in one compact package . It detects objects and surfaces by measuring reflected IR light, producing both digital and analog outputs for line following, obstacle detection, and object counting projects .
Reflective Optical Sensor - Detects objects by measuring reflected infrared light
Dual Output Modes - Provides both analog and digital signals with adjustable threshold
Operating voltage: 5V DC with onboard comparator and potentiometer for sensitivity adjustment
Detection distance: 1mm to 15mm (optimal 2-8mm) depending on surface reflectivity
For line following, place sensor 5-10mm above the surface for best contrast detection
= Technical Specifications =
| Parameter | Value |
|---|
| Operating Voltage | 5V DC |
| Output Modes | Analog (AO) and Digital (DO) |
| Comparator IC | LM393 |
| Detection Range | 2mm to 15mm (adjustable) |
| Effective Range | 1mm to 8mm |
| Power Consumption | <100mA |
= Key Features =
+Adjustable Sensitivity - Onboard potentiometer sets the digital output trigger threshold
+Power and Signal LEDs - Visual indicators for module status and object detection
+Mounting Holes - M3 holes for secure attachment to robot chassis
+Wide Compatibility - Works with 3.3V to 5V logic systems
== Applications ==
- Line following robots and maze solving
- Obstacle avoidance for smart cars
- Object counting and edge detection
- Optical tachometer and RPM measurement
- Position sensing and limit switches
CostEffective Sensor Low-cost solution for reflective object detection
Wide Contrast Detection - Reliably detects black, white, and gray surfaces
√ Compatible with Arduino, ESP32, Raspberry Pi, and other MCUs
√ Available as bare module or with cable
√ Easy integration with popular robotics libraries
= Connecting TCRT5000 to Arduino =
| Sensor Pin | Arduino Pin | Function |
|---|
| VCC | 5V | Power supply |
| GND | GND | Ground |
| AO | A0 | Analog signal (object distance) |
| DO | D2 | Digital signal (threshold trigger) |
Use analog output for variable reflectance reading (e.g., line position)
Use digital output for simple object detection (HIGH/LOW based on threshold)
Adjust potentiometer for different surface colors
= Working Principle =
The sensor works by emitting infrared light from the IR LED . When an object is close, the light reflects back to the phototransistor, which changes its resistance . The LM393 comparator converts this analog signal to a digital output with adjustable sensitivity . High reflectance surfaces (e.g., white paper) produce a higher output voltage, while low reflectance surfaces (e.g., black paper) produce a lower output voltage .
For line following, the sensor reads low on white surfaces and high on black surfaces (or vice versa)
Place the sensor 5-10mm above the track for reliable line detection
Adjust the potentiometer to the point where the sensor triggers just as the color transitions
= Troubleshooting =
Inconsistent readings:
- Clean the IR emitter and phototransistor surfaces
- Reduce ambient IR light interference
- Adjust the sensitivity potentiometer
No signal:
- Check 5V power and GND
- Ensure object is within detection range
- Verify potentiometer is properly set