A photoelectric sensor adapted to detect presence or absence of a target, wherein the target is located at a distance from the photoelectric sensor, the photoelectric sensor comprising: an emitting portion for emitting light toward a target; a receiving portion including a receive lens for receiving, through the receive lens, reflected light that is at least some of the emitted light reflected by the target; a photodetector for receiving light, and providing a detection signal indicative of the light received by the photodetector; and an aperture situated between the receive lens and the photodetector; characterized in that: the photoelectric sensor further comprises: a refraction block having a block first surface and a block second surface, wherein the reflected light received through the receive lens is refracted by at least one of the surfaces as it passes through the refraction block; a housing for at least partially enclosing the emitting portion, the receiving portion and the refraction block; and wherein the aperture is a housing aperture that is included in the housing, wherein the housing aperture is situated between the refraction block and the photodetector, wherein the housing aperture provides a controlled entry point for the reflected light refracted by the refraction block, wherein the housing aperture serves as a pre-defined cut-off for a desired target distance such that reflected light that is received from a target that is located at a distance greater than the desired target distance is prevented from reaching the photodetector, and wherein the light received by the photodetector is the reflected light refracted by the refraction block. an emitting portion for emitting light toward a target; a receiving portion including a receive lens for receiving, through the receive lens, reflected light that is at least some of the emitted light reflected by the target; a photodetector for receiving light, and providing a detection signal indicative of the light received by the photodetector; and an aperture situated between the receive lens and the photodetector; characterized in that: the photoelectric sensor further comprises: a refraction block having a block first surface and a block second surface, wherein the reflected light received through the receive lens is refracted by at least one of the surfaces as it passes through the refraction block; a housing for at least partially enclosing the emitting portion, the receiving portion and the refraction block; and wherein the aperture is a housing aperture that is included in the housing, wherein the housing aperture is situated between the refraction block and the photodetector, wherein the housing aperture provides a controlled entry point for the reflected light refracted by the refraction block, wherein the housing aperture serves as a pre-defined cut-off for a desired target distance such that reflected light that is received from a target that is located at a distance greater than the desired target distance is prevented from reaching the photodetector, and wherein the light received by the photodetector is the reflected light refracted by the refraction block. a refraction block having a block first surface and a block second surface, wherein the reflected light received through the receive lens is refracted by at least one of the surfaces as it passes through the refraction block; a housing for at least partially enclosing the emitting portion, the receiving portion and the refraction block; and wherein the aperture is a housing aperture that is included in the housing, wherein the housing aperture is situated between the refraction block and the photodetector, wherein the housing aperture provides a controlled entry point for the reflected light refracted by the refraction block, wherein the housing aperture serves as a pre-defined cut-off for a desired target distance such that reflected light that is received from a target that is located at a distance greater than the desired target distance is prevented from reaching the photodetector, and wherein the light received by the photodetector is the reflected light refracted by the refraction block.