Optical proximity sensors generally cost more than inductive proximity sensors, and about the same as capacitive sensors. They are widely used in automated systems because they have been available longer and because some can fit into small locations. These sensors are more commonly known as light beam sensors of the thru-beam type or of the retro reflective type. Both sensor types are shown below.

A complete optical proximity sensor includes a light source, and a sensor that detects the light. The light source is supplied because it is usually critical that the light be "tailored" for the light sensor system. The light source generates light of a frequency that the light sensor is best able to detect, and that is not likely to be generated by other nearby sources. Infra-red light is used
in most optical sensors. To make the light sensing system more foolproof, most optical proximity sensor light sources pulse the infra-red light on and off at a fixed frequency. The light sensor circuit is designed so that light that is not pulsing at this frequency is rejected.
The light sensor in the optical proximity sensor is typically a semiconductor device such as a photodiode, which generates a small current when light energy strikes it, or more commonly a phototransistor or a photo-darlington that allows current to flow if light strikes it. Early light sensors used photoconductive materials that became better conductors, and thus allowed current to pass, when light energy struck them. Sensor control circuitry is also required. The control
circuitry may have to match the pulsing frequency of the transmitter with the light sensor. Control circuitry is also often used to switch the output circuit at a certain light level. Light beam sensors that output voltage or current proportional to the received light level are also available.

Through beam type sensors are usually used to signal the presence of an object that blocks light. If they have adjustable switching levels, they can be used, for example, to detect whether or not bottles are filled by the amount of light that passes through the bottle. Retroflective type light sensors have the transmitter and receiver in the same package. They detect targets that reflect light back to the sensor. Retroreflective sensors that are focused to recognize
targets within only a limited distance range are also available