Home / Wiki / Sensor / Distance
TCRT5000

Introduction

The IR move are reflective sensors made up of a TCRT5000 which include an infrared emitter and phototransistor. There two tubes, the blue one is the emitter and the other is receiver, the emitter emit infrared and the receiver catch it when the infrared was reflected by the obstacle, and then the phototransistor is saturated, the module output high power lever, however, when there’s no obstacle to reflect the infrared, this module will output low power level.

 


Technical data

Operating wavelength: 950mm

Operate voltage: DC 3 to 5.5V

Typical voltage: 5V

 

Usage

[code]

/*

 * Connnet the pin DO(digital output) of IR movement module(TCRT5000) to D2

 * When detect the barrier, the module output logic high.

 */

 int TCRT5000_value=A5;

 int sensorValue=analogRead(TCRT5000_value);

 int a=0;

 void setup() {

  Serial.begin(9600);  //Initial the serial  baud rate of 9600.

  pinMode(TCRT5000_value, INPUT);

}

 

void loop() {     

int sensorValue=analogRead(TCRT5000_value);

if (sensorValue>512)    //the value has been devided into 1024 part, so, if the value is more than 512, default it as high level.

sensorValue=1;

else

sensorValue=0;

 Serial.println(sensorValue);   

 }

[/code]

 

Resource

Program

Datasheet