Light and Infrared Sensors for Distance and Obstacle Detection
Robots and electronic projects rely of a variety of sensors for input from the real world. Light sensors, whether visible or infrared, are particularly helpful. These electronic sensors have a variety of names, usually with the prefix "photo":
- Photoresistor or photo resistor
- Photocell or photo cell
- Photodiode or photo diode
- Photodetector or photo detector
- Photoconductor or photo conductor
- Photosensor or photo sensor
Light detectors are commonly used on:
- Line-following robots to see tape or painted lines on the floor
- Sumo robots to find opponents and detect the edges of the ring
- Solar robots to determine the location with the most sunlight
- Room explorers to avoid walls and obstacles, as well as to navigate using beacons
- Other electronic projects to calculate distances and notice activity (light switch turning on or laser beam interrupted)
Most robot light sensors are infrared (IR) based. As such, what they see may be very different than what you see in visible light. Here are some simple tests that you can perform on materials using a remote control to determine if the material is opaque or transparent to infrared.
Bonus: David attempts to paint plastic to see if more IR can be blocked.
Although IR and wireless remotes are common, it is also possible to construct a sensor circuit that is activated with a laser pointer. A modern TLV3702 comparator chip compares a trip-level potentiometer voltage to a photoresistor sensor voltage. The result is connected to a 74AC74 D-type flip-flop that remembers the last state, which is indicated on a large blue LED.
How to create a distance measurement system using an inexpensive level, a bracket, and slide. Oscilloscope traces show why a capacitor is required for this sensor.
Linear polarizing filters can be placed over light sources to act as beacons. By placing a pair of orthogonally-oriented polarized films over ordinary photosensors, the robot can distinguish between two different beacons. This can be useful for robot contests or for navigating between a destination and a charging station.
Infrared LEDs are commonly used for object detection in robots. Blinking the LED on and off 38,000 times a second improves long-range detection and reduces false triggers. Pictures, comparisons, and a schematic demonstrate a simple, reliable, low-power 555 CMOS circuit.
Twenty different kinds of photocells from a grab bag. Some were defective. But the variety of sizes is nice to have.
I experimented with developing a simple, active, color, object sensor for my robots based on three ultra-bright LEDs or a single RGB LED. An old-fashioned cadmium-sulfide sensor or modern TAOS light-to-voltage converter detects the brightness of the reflected red, green, and blue as each is turned on individually.
Surprisingly, if you put an LED in backwards and amplify the signal with an op amp, you can create a color sensor as though the LED were a photodiode. This article shows how to improve the signal quality with multiple LEDs, provides tips on reducing electrical noise, show how to convert the output to a digital signal, and includes a schematic and breadboard photo to help you implement the circuit.

