Collection: IR Sensors

IR sensors pair an infrared LED with a receiver to detect what is directly in front of them. They are the parts behind line-following robots, obstacle detectors and touchless switches.

The TCRT5000 reflective sensor tells a light surface from a dark one at very short range, about 2-15 mm, which is why line followers mount it just above the floor. Most modules give two outputs:

  • DO: a clean HIGH/LOW from an onboard LM393 comparator, with a potentiometer to set the threshold. It is enough for simple left/right line following.
  • AO: the raw reflectance value, for tuning thresholds yourself or for PID line following.

How to choose:

  • Pick a TCRT5000 or a line-sensor array for following tracks.
  • Pick an IR obstacle module for "is something there?" triggers.
  • For a real distance reading, use an ultrasonic or ToF sensor instead.

These modules run on 3.3-5V and connect to any Arduino or ESP32 digital or analog pin. Strong sunlight carries infrared, so outdoor tests often need the threshold pot re-tuned.

Frequently asked questions

Is the TCRT5000 digital or analog?

Both. DO gives a threshold HIGH/LOW, and AO gives a continuous reading.

Why must it be so close to the surface?

It only sees IR bounced straight back, which weakens fast. The usable range is about 2-15 mm.

How many sensors does a line follower need?

Two at minimum. Three or more handle sharper turns and junctions.

Does sunlight affect IR sensors?

Yes. Strong ambient IR raises the baseline, so re-tune the threshold outdoors.

Guides