Infrared Line Tracing Module(TCRT5000)
The product is an infrared transmission and reception sensor module designed specifically for line tracing applications. It comes equipped with an adjustable variable resistor, allowing for fine-tuning of sensitivity.
The part of the sensor that detects is highlighted in red in the accompanying image, while the yellow part represents the sensitivity adjustment component.
Specifications
- Operating Voltage: 3V ~ 5V
- Output Type: Analog, Digital
Example Required Hardware
- Arduino board
- Jumper cables
- TCRT5000 module
Connection
Arduino | TCRT5000 |
5V | V+ |
GND | G |
D2, A7 | S |
Example Code
const int analogPin = A7; // Analog pin used to connect the sensor
const int digitalPin = 2; // Digital pin used to connect the sensor
void setup() {
pinMode(digitalPin, INPUT); // Set the digital pin as input
Serial.begin(9600); // Start serial communication at 9600 baud
}
void loop() {
Serial.print(analogRead(analogPin)); // Read the analog value from the sensor
Serial.print("\t"); // Print a tab for formatting
Serial.println(digitalRead(digitalPin)); // Read and print the digital value from the sensor
delay(100); // Wait for 100 milliseconds before the next reading
}
Execution Results
- When nothing is close to the sensor
- When a black object is near the sensor
- When a white object is near the sensor