Introduction
An optical proximity sensor is a proximity sensor that uses light. An LED is the transmitter (emitter) and a photodiode is the receiver.
How it works
- lenses focus the emitter and the receiver into two cones of light on the same plane
- the two cones cross in a pencil shaped volume, called the sensitive volume
- when an object is in the sensitive volume, light reflects back to the receiver

Difficulties
- The axis of the sensor must be normal to the surface
- To find the distance, you must know how white the surface is
- The same signal can come from two different distances (one on each side of the peak)

Use cases
They are mostly used to detect the presence of an object, usually within a few inches. They are sometimes used to measure distance, and very rarely for recognition.
Example
The cone of each beam starts at its lens and has its vertex 5 cm in front of the centre of the other lens. Each lens has a diameter of 4 mm, and the lens centres are 6 mm apart. Over what range will the sensor detect an object?

The sensitive volume starts where the two cones first overlap () and ends where they stop overlapping (). Use similar triangles with the 50 mm cone height:
The sensor detects objects from 12.5 mm to 31.25 mm.