Proximity sensor in manufacturing, Photosensor in automation