Project 20: Line Tracking Sensor

1.Introduction

Line tracking sensor has a TCRT5000 photoelectric sensor. Infrared reflectivity of color is different ,which is applied to convert strong and weak echoed signal into current signal by photoelectric sensor. The potentiometer is used to adjust sensitivity of this sensor.

In this project, we use graphical programming to detect high and low level of line tracking sensor signal port and the color of objects, displaying it on serial monitor.

2.Materials Required

  1. KEYESTUDIO UNO Control Board *1

  2. V5 Sensor Shield*1

  3. Line Tracking Sensor*1

  4. Female to Female Dupont Line*3

3.Connection Diagram

4.Sample Code

void setup()
{
  pinMode( 3 , INPUT);
  Serial.begin(9600);
}

void loop()
{
  Serial.print("Line Tracking");
  Serial.print(digitalRead(3));
  Serial.println();
  delay( 1000 );
}

5.Result

After downloading program, we can use line tracking sensor to detect the color of line tracking object. If it is white, the light on the sensor turns on, and display “Line Tracking0” on serial monitor;if black, the light off, and display “Line Tracking1”