An optical sensor for use in a safety system, comprising: a housing having a front wall and a rear wall, the front wall having an interior surface, an exterior surface and an opening extending through the front wall; an optical receiver mounted within the housing on a substrate located proximate to the rear wall and opposite the opening in the front wall, wherein the optical receiver is an array of photosensitive devices; an optical source mounted within the housing on the substrate for the optical receiver and configured to emit radiation toward a reference target located within the housing; the reference target is mounted on the interior surface of the front wall and configured to reflect the light from the optical source back to a portion of the photosensitive devices that surrounds the optical source, and a logic circuit configured to: (a) receive at least one signal from the portion of the optical receiver corresponding to the radiation received by the portion of the optical receiver, (b) determine a value corresponding to either a time for the light to travel from the light source to the portion of photodetectors or a distance between the light source and the portion of photodetectors as a function of the signals received from the portion of the optical receiver, (c) compare the value to a predetermined threshold, and (d) generate a signal if the value exceeds the predetermined threshold. a housing having a front wall and a rear wall, the front wall having an interior surface, an exterior surface and an opening extending through the front wall; an optical receiver mounted within the housing on a substrate located proximate to the rear wall and opposite the opening in the front wall, wherein the optical receiver is an array of photosensitive devices; an optical source mounted within the housing on the substrate for the optical receiver and configured to emit radiation toward a reference target located within the housing; the reference target is mounted on the interior surface of the front wall and configured to reflect the light from the optical source back to a portion of the photosensitive devices that surrounds the optical source, and a logic circuit configured to: (a) receive at least one signal from the portion of the optical receiver corresponding to the radiation received by the portion of the optical receiver, (b) determine a value corresponding to either a time for the light to travel from the light source to the portion of photodetectors or a distance between the light source and the portion of photodetectors as a function of the signals received from the portion of the optical receiver, (c) compare the value to a predetermined threshold, and (d) generate a signal if the value exceeds the predetermined threshold. (a) receive at least one signal from the portion of the optical receiver corresponding to the radiation received by the portion of the optical receiver, (b) determine a value corresponding to either a time for the light to travel from the light source to the portion of photodetectors or a distance between the light source and the portion of photodetectors as a function of the signals received from the portion of the optical receiver, (c) compare the value to a predetermined threshold, and (d) generate a signal if the value exceeds the predetermined threshold.