How to Use TCRT5000 IR Sensor Module With Arduino UNO




Introduction: How to Use TCRT5000 IR Sensor Module With Arduino UNO

In this tutorial, we are going to teach you some basics on using TCRT5000 IR Sensor Module. These basic are showing you the analog and digital values at serial monitor.


This IR reflective sensor utilizes a TCRT5000 to detect color and distance. It emits IR and then detects if it receives the echo. This sensor is often used in line following robots, auto data logging on utility meters, because this module can sense if a surface is white or black.
The measuring distance range from 1mm to 8mm, and the central point is about 2.5mm. There is also an on-board potentiometer to adjust the sensitivity. The infrared diode will emitting the infrared continuously when the module connect to the power, when the emitted infrared light has not been reflected or the strength is not big enough,the module will in the off state, at this time, D0 output logic HIGH and the signal indicate LED off.


- Supply Voltage: 3.3V~5V

- Detect distance: 1mm-8mm

- Digital Outputs LOW when objects detected

- On-board indicator LED to show the results

- On-board potentiometer to adjust the sensitivity

- On-board LM393 chip

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Pin Definition

Step 2: Material Preparation

For this tutorial, we require these items:

1. Arduino UNO.

2. TCRT 5000 IR sensor module.

3. Wire male to female.

Step 3: Pin Connection

Step 4: Sample Source Code

The attachment is the sample source code for TCRT 5000 IR Sensor Module. You may download it and upload it into your Arduino Uno.

Step 5: Open the Source Code and Upload to Arduino UNO

Step 6: Way to Open the Serial Monitor

Step 7: Result

The picture above shows the result on the Serial Monitor for the TCRT5000 IR Sensor Module.

TCRT5000 IR Sensor Module detects the obstacle infront

  • The "Digital Reading" shows 1
  • The "Analog Reading" shows value which less than 50

TCRT5000 IR Sensor Module detects nothing

  • The "Digital Reading" shows 0
  • The "Analog Reading" shows value around 900 above

1 Person Made This Project!


  • LED Strip Speed Challenge

    LED Strip Speed Challenge
  • Sculpting Challenge

    Sculpting Challenge
  • Clocks Contest

    Clocks Contest



1 year ago

I played with sensor I bought on Ali and sometimes it works strange: I put box before sensor, sensor shows obstacle, then I remove box, but sensor still shows obstacle! And after I move sensor around (pointing at ceiling) it returns to "no obstacle" status. Not sure we can trust this sensor smth critical :)


Range is also disappointed: max 6cm! It significantly reduces applicability of the sensor.