Table of Contents

Using the TCRT1000 and TCRT5000

Both components consist of an IR-LED and a photo transitor. The TCRT1000 is smaller and a bit less sensitive.

Datasheets: TCRT1000, tcrt5000

TCRT1000

Test circuit and software

The above circuit was controlled by an Arduino (Nano V3, 5Volt). The power (5V in schema) was connected to a digital output The output was measured by an analog input

breadboard

Code

The software loops as follows

  1. switch power on
  2. wait 100 us
  3. switch sync output on (to show measuring moment on oscilloscope)
  4. measure
  5. light red/yellow/green LED depending on voltage (easier to check sensitivity)
  6. wait 100 us

Before measuring it is necessary to wait a little to let the sensor output voltage settle. 0.1 ms is more than enough.

In this way, about 5000 measurements are made every second! Reading 96 sensors on one input using multiplexing for the LED can easily be achieved in a fraction of a second.

int power=12;   // power to sensor
int sample=11;  // debug: we sample on rising edge
int measure = A7;  // analog sensor voltage (1023 = 5 V)
 
int green=2, yellow=3, red=4;
 
void setup() {
  pinMode(power, OUTPUT);
  pinMode(sample, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(yellow, OUTPUT);
  pinMode(red, OUTPUT);
 
  Serial.begin(9600);
  Serial.println("reset");
}
 
int cnt = 0;
float scale = 5./1024;      // scale factor ot volts
void loop() {
  digitalWrite(power, 1);   // power to led and transistor
  delayMicroseconds(100);   // wait for output to settle
 
  digitalWrite(sample, 1);  // make sample moment visible on scope
  int val = analogRead(measure);
  float volt = scale * val;  // sensor voltage 
  digitalWrite(red,    volt>0.8);
  digitalWrite(yellow, volt>1.3);
  digitalWrite(green,  volt>1.8);
  digitalWrite(sample, 0);
 
  digitalWrite(power, 0);
  delayMicroseconds(500);
  cnt = (cnt+1)%100;
  if (cnt==0) { Serial.println(volt,3); }
}

Measurements

Circuit

Response to ambient light

Response to white plastic at 8-10 mm

Response to white plastic at 20 mm

Notes

Possible hardware architecture: