Talk Page




Photoeyes are devices that detect the presence of an object, such as a box or tote, by use of a light emitting diode (LED). Photoeyes generally have two pieces: an emitter, which emits a beam of light from an LED, and a receiver, which detects that beam of light. When something passes between the two pieces, the light beam from the emitter is broken and the detector no longer receives a signal.

Figure 1

Computers interpret this break in the signal as an indicator to begin performing a variety of actions. Photoeyes can tell a computer to begin a counter, trigger a divert, or stop a machine. There are other types of photeyes, such as:

  • Reflectors The emitter has a receiver on the same housing, and points the beam of light at a reflector on the other side of the conveyor.
  • Proximity Sensors These photoeyes have no reflector, but instead receive a beam of light reflected from packages or totes.

The most common error made using photoeyes is failing to center the beam on the target.

  • If the gain is set too high, the package appears to the computer to be shorter than actual size.
  • If the gain is set too low, the package appears to the computer longer than actual size.

Although most reflective devices are based on a corner cube design, there are limitations on the angle of reflectance that will allow the reflector to work. Remember that the hole for receiving reflected light must be large enough to emit and receive enough light. The smaller the hole, the less light will be returned to the photoeye receiver.

Aligning Retroreflective Devices

The most important goal when using LED retroreflective photoeyes is to center the light beam on the target.

  • The principle of retroreflection permits the target to be somewhat skewed at an angle to the beam (up to 15 degrees), so it is not critical that the mounting surface for the target be perpendicular to the beam.
  • If excess gain is one, the application should be reviewed to find a way to increase the signal strength. Note that, even after initial setup, this is a good way to check scanner operation. It is not important to precisely control the hole diameter; simply holding both hands over a portion of the target gives an indication of the percentage that may be covered, and therefore the existence of excess gain.

Adjusting for Longer Scanning Distances

At longer scanning distances (20 to 30 feet), it is sometimes difficult to initially find the target. To make alignment easier, use a second reflector to locate the beam and then slowly move the second target away from the scanner, moving the mounted target to match the beam position (Figure 2).

Figure 2: Use of Intermediate Target to Locate Beam

Determining Excess Gain

Once the initial alignment is complete and the mounting bracket has been tightened, mask a portion of the reflector to determine if the beam is centered and if there is enough excess gain for the application. Excess gain allows the detector to continue functioning if there is dirt on the reflector or a slight misalignment.

Figure 3: Conventional three-inch Retroflective Target

The left side of Figure 3 shows a conventional two-inch diameter target. The right side of the image shows the same target with a piece of paper having a 1-inch diameter hole taped to the front of the target, with the hole approximately centered. If the scanner still operates properly with the paper taped over the target, there is sufficient signal strength for the detector to function with only one-third of the diameter, and therefore one-ninth of the area of the target. This is the same as saying there is an excess gain of nine. If the scanner does not operate, enlarge the hole in the paper until the detector works properly. The larger the hole in the paper, the less excess gain the unit will have. If the system only works when the paper is completely removed, then there is an excess gain of one. You will want to have some excess gain, since an excess gain of one means that the system will not work properly if just a little dirt is on the reflector or the system is slightly out of alignment.

  • If excess gain is one, the application should he reviewed to find a way to increase the signal strength. Note that, even after initial setup, this is a good way to check scanner operation. It is not important to precisely control the hole diameter; simply holding both hands over a portion of the target gives an indication of the percentage that may be covered, and therefore the existence of excess gain.


Proxing refers to the reflecting of a beam directly back from an object that is supposed to break the beam. If enough light is reflected back, the scanner thinks it is still seeing the retroreflective target, and no output occurs. Proxing is common when sensing shiny objects such as cans, bottles, and packages with shrink-wrap or cellophane covering. With round objects, the best way to mount a scanner is with the beam striking objects at both a horizontal and vertical angle, as shown in Figure 4.

Figure 4: Best Mounting for Most Applications at an Angle (Horizontal and Vertical) to the Objects

The angle does not have to be particularly large, typically 10 to 15 degrees. In some applications, when it is very important that no "prox" signal ever occur, it will be necessary to consider separate emitters and receivers in the opposed mode.

Increasing the Signal

At scanning distances of more than a few feet, the beam is typically larger in diameter than the target. This means that some of the beam is being "wasted." A simple solution is to mount a cluster of three targets together, as shown in Figure 5, to obtain three times the excess gain of a single target. Be careful with this solution however, as the object must be at least as large as the cluster or it will not reliably break the beam.

Figure 5: Use of Multiple Reflectors to Increase Excess Gain

A second method of increasing the signal involves the target itself. Normally, reflectors are three-inch diameter plastic disks, but retroreflective tape is often used.

  • If tape is being used, replace it with a plastic target. Plastic targets have several times the reflectivity of the tape.
  • If a small-diameter plastic target is being used, replace it with the largest diameter plastic target that still permits the object to completely break the beam.

Many retroreflective photoeyes exhibit a reduction in signal strength at close range due to the characteristics of the optics used. It is best to mount the target at least one foot from the scanner.

Signal strength is also affected by the angle of the beam. If the target is skewed slightly, there is a small reduction of signal that occurs. Squarely aligning the scanner and reflector will add strength to the signal, about 2% per degree for plastic retroreflectors, and about twice that amount for tape.

Polarizing Filters

Since retroflective targets polarize light they reflect, you can use polarized filters to reduce the prox effects on scanners. When the beam reflects off a retroflective target, it is rotated 90 degrees. Since light reflected from an object is not rotated, you can filter these prox effect light waves by applying a polarized filter. This technique is illustrated in Figure 6.

Figure 6: Elimination of Direct Reflections Using Polarized Filters

Most photoeyes have either internal or external sensitivity adjustments. Do not adjust the sensitivity of a photoeye just to get the photoeye to function. Before adjusting the sensitivity of a photoeye, determine how much excess gain is needed.

Image Halo

Infrared light sources frequently exhibit a characteristic known as halo (Figure 7). Halo is a ring of light surrounding the central core of the beam. It is due to internal reflections involving the housing of the LED itself. It is of much lower intensity than the core, but can be a problem, particularly at short ranges. If the receiver is aligned with the halo instead of the core, the excess gain is severely reduced. If another scanning pair is being used adjacent to the first pair, it is possible for crosstalk to occur between the pairs, where a receiver gets a signal from a second emitter. You can find the halo using a receiver on an extension cord and moving it in the beam, locating the outer edges of the halo.

Figure 7: Halo Effect of Infrared LEDs

Fundamentals of Photelectric Sensors

As the manufacturing world becomes more and more automated, industrial sensors have become the key to increasing both productivity and safety.

Industrial sensors are the eyes and ears of the new factory floor, and they come in all sizes, shapes, and technologies. The most common technologies are inductive, capacitive, photoelectric, magnetic, and ultrasonic. Each technology has unique strengths and weaknesses, so the requirements of the application itself will determine what technology should be used. This article is focused on photoelectric sensors and defines what they are, their advantages and some basic modes of operation.

Photoelectric sensors are readily present in everyday life. They help safely control the opening and closing of garage doors, turn on sink faucets with the wave of a hand, control elevators, open the doors at the grocery store, detect the winning car at racing events, and so much more.

A photoelectric sensor is a device that detects a change in light intensity. Typically, this means either non-detection or detection of the sensors emitted light source. The type of light and method by which the target is detected varies depending on the sensor.

Photoelectric sensors are made up of a light source (LED), a receiver (phototransistor), a signal converter, and an amplifier. The phototransistor analyzes incoming light, verifies that it is from the LED, and appropriately triggers an output. Photoelectric sensors offer many advantages when compared to other technologies. Sensing ranges for photoelectric sensors far surpass the inductive, capacitive, magnetic, and ultrasonic technologies. Their small size versus sensing range and a unique variety of housings makes them a perfect fit for almost any application. Finally, with continual advances in technology, photoelectric sensors are price competitive with other sensing technologies.

Sensing Modes

Photoelectric sensors provide three primary methods of target detection: diffused, retroreflective and thru-beam, with variations of each. Just as the basic operating principal is the same for all photoelectric families, so is identifying their output. "Dark-On" and "Light-On" refers to output of the sensor in relation to when the light source is hitting the receiver. If an output is present while no light is received, this would be called a "Dark On" output. In reverse, if the output is ON while the receiver is detecting the light from the emitter, the sensor would have a "Light-On" output. Either way, a Light On or Dark On output needs to be selected prior to purchasing the sensor unless it is user adjustable. In this case it can be decided upon during installation by either flipping a switch or wiring the sensor accordingly.

Diffused Mode

In diffused mode sensing, sometimes called proximity mode, the transmitter and receiver are in the same housing. Light from the transmitter strikes the target, which reflects light at arbitrary angles. Some of the reflected light returns to the receiver, and the target is detected. Because much of the transmitted energy is lost due to the target's angle and ability to reflect light, diffused mode results in shorter sensing ranges than are attainable with retroreflective and thru-beam modes.

The advantage is that a secondary device, such as a reflector or a separate receiver, is not required. Factors affecting diffused mode sensing range include the targets color, size, and finish because these directly affect its reflectivity and therefore its ability to reflect light back to the sensors receiver. The table below illustrates the effect of the target on the sensing range for diffused mode sensing.

Diffused Mode Reflectivity Table

  • The values in this chart are intended only as guidelines, as a variety of factors determine the exact sensing range in an application.

Diffused Convergent Beam Mode

Convergent beam mode is a more efficient method of diffused mode sensing. In convergent beam mode, the transmitter lens is focused to an exact point in front of the sensor, and the receiver lens is focused to the same point. The sensing range is fixed and defined as the focus point. The sensor is then able to detect an object at this focal point, plus or minus some distance, known as the sensing window. Objects in front of or behind this sensing window are ignored. The sensing window is dependent on the targets reflectivity and the sensitivity adjustment. Because all of the emitted energy is focused to a single point, a high amount of excess gain is available, which enables the sensor to easily detect narrow or low reflectivity targets.

Diffused Mode with Background Suppression

Diffused mode sensing with background suppression detects targets only up to a certain cut-off distance, but ignores objects beyond the distance. This mode also minimizes sensitivity to a targets color among the diffused mode variations. One main advantage of diffused mode with background suppression is the ability to ignore a background object that may be incorrectly identified as a target by a standard diffused mode photoelectric sensor. Diffused mode with background suppression can operate at a fixed distance or at a variable distance. Background suppression can be accomplished technically in two ways, either mechanically or electronically.

Diffused Mode with Mechanical Background Suppression

For mechanical background suppression, there are two receiving elements in the photoelectric sensor, one of which receives light from the target and the other receives light from the background. When the reflected light at the target receiver is greater than that at the background receiver, the target is detected and the output is activated. When the reflected light at the background receiver is greater than that at the target receiver, the target is not detected and the output does not change state. The focal point can be mechanically adjusted for variable distance sensors.

Diffused Mode with Electronic Background Suppression

With electronic background suppression, a position sensitive device (PSD) is used inside the sensor instead of mechanical parts. The transmitter emits a light beam, which is reflected back to two different points on the PSD from both the target and the background material. The sensor evaluates the light striking these two points on the PSD and compares this signal to the preset value to determine whether the output changes state.

Retroreflective Mode

Retroreflective mode is the second primary mode of photoelectric sensing. As with diffused mode sensing, the transmitter and receiver are in the same housing, but a reflector is used to reflect the light from the transmitter back to the receiver. The target is detected when it blocks the beam from the photoelectric sensor to the reflector. Retroreflective mode typically allows longer sensing ranges than diffused mode due to the increased efficiency of the reflector compared with the reflectivity of most targets. The target color and finish do not affect the sensing range in retroreflective mode as they do with diffused mode.

Retroreflective mode photoelectric sensors are available with or without polarization filters. A polarization filter only allows light at a certain phase angle back to the receiver, which allows the sensor to see a shiny object as a target and not incorrectly as a reflector. This is because light reflected from the reflectors shifts the phase of the light, whereas light reflected from a shiny target does not. A polarized retroreflective photoelectric sensor must be used with a corner-cube reflector, which is a type of reflector with the ability to accurately return the light energy, on a parallel axis, back to the receiver. Polarized retroreflective sensors are recommended for any application with reflective targets. Non-polarized retroreflective photoelectric sensors usually allow longer sensing ranges than polarized versions, but can falsely identify a shiny target as a reflector.

Retroreflective mode for clear object detection

Detecting clear objects can be achieved with a retroreflective mode for clear object detection photoelectric sensor. These sensors utilize a low hysteresis circuit to detect small changes in light that commonly occur when sensing clear objects. The clear object mode sensor uses polarized filters on both the sensor transmitter and receiver to reduce false responses caused by reflections from the target.

Retroreflective mode with foreground suppression

Retroreflective sensors with foreground suppression will not falsely identify glossy targets as the reflector when they are within a certain distance, or dead zone. This mode is suited for detecting shrink-wrapped pallets, as a standard retroreflective mode sensor can mistake the glossy covering for a reflector and not change state. Optical apertures in front of the transmitter and receiver elements in the sensor housing produce a zone to eliminate erroneous detection of reflective material.

Thru-Beam Mode

Thru-beam mode, also called opposed mode, is the third and final primary method of detection for photoelectric sensors. This mode uses two separate housings, one for the transmitter and one for the receiver. The light from the transmitter is aimed at the receiver and when a target breaks this light beam, the output on the receiver is activated. This mode is the most efficient of the three, and allows the longest possible sensing ranges for photoelectric sensors. Thru-beam mode sensors are available in a variety of styles. The most common includes one transmitter housing, one receiver housing, and one light beam between the two housings. Another type is slot or fork photoelectric sensors that incorporate both transmitter and receiver into one housing, with no alignment required. Light grids are arrays of many different transmitters in one housing and many different receivers in another housing, which, when aimed at each other, create a virtual sheet of light beams.

Fiber Optic Sensing

Fiber sensors guide the light from the transmitter through either plastic or glass cables that are called fiber optic cables. In applications involving small targets or unfavorable conditions, fiber optic cables may be the optimum solution. Fiber optic cables allow either diffused mode or thru-beam mode sensing.

Glass fiber optic cables are constructed from tiny strands of glass that are bundled together inside an application-specific sheath. Glass fiber optic cables are typically more rugged than plastic versions, more efficient in light transmission resulting in longer sensing ranges, and work well with both visible red and infrared light.

Plastic fiber optic cables are manufactured from a light conductive plastic monofilament material and are housed in a protective PVC jacket. Plastic fiber optic cables are typically more flexible and cost-effective than glass versions, can be cut to length, and work only with visible light.

Application of Specific Photoelectric Sensors

In addition to the standard modes of operation for photoelectric sensors, several application specific sensors also exist. These sensors are used to solve many non-traditional photoelectric applications, such as detecting changes in a targets color, porous targets, and invisible markings on products. Examples of Application Specific Sensors include:

  • Color - Color sensors are available in a wide variety of styles and options. The most basic color sensors are single channel units, which can be programmed to detect a single color. More advanced units can detect up to ten or more unique colors and allow multiple shades to be programmed on the same channel. Typical applications include quality control where different colors are marked on the product as a stage of production is completed. Another possible application would be to program multiple shades of a color on the same channel. These colors could indicate the manufacturers acceptable range of color variance for a finished product in a dyeing or injection molding application.
  • Contrast - Contrast sensors are used to detect a difference in two colors or media. The sensor is first taught two different conditions. Next, it evaluates the current conditions, and if the current targets reflected light is closer to the first condition the output will remain off. If the current targets reflected light is closer to the second condition, the output will change state. A typical application for contrast sensing is registration mark detection before cutting or converting paper in the packaging industry.
  • Luminescence - Luminescence sensors are used to detect inks, greases, glues, paints, chalks, and other materials with luminescent properties. Marks on irregular backgrounds and clear or invisible markings are easily sensed using an ultraviolet light source. Typical applications for luminescence sensors are detecting the clear tamper-proof seals on medicine bottles or detecting a defective product that has been marked with chalk (i.e. a knot in a piece of wood).
  • Light grids - Light grids are used to create a grid or sheet of light. There are many variations, sizes, and applications for light grids. Miniature, high-resolution light grids can be used for small parts counting. Larger grids can be used to ensure part ejection from a press before the next press cycle. Safety light grids are used to create a safe perimeter around a machine so that operators are protected from potentially dangerous parts of the machine.
  • Passive infrared - Passive infrared sensors are used to detect movement of an object within a defined sensing area or zone. The term passive is used because the sensor does not emit any light, but instead detects infrared emissions from an object with a temperature that is different than the surrounding environment. A typical application for passive infrared sensors is controlling automatic doors or lights.
  • Zone scanners - Much like passive infrared sensors, area scanners are used to detect the presence or movement of an object within a defined sensing area or zone. The main difference is that active infrared sensors emit light and are able to detect movement of an object in the area when the temperature of the target cannot be determined. A typical application could be detecting vehicles approaching an overhead door in a warehouse since neither the temperature of the vehicle or the environment could be determined.

Light Curtains

Safety light curtains are most simply described as photoelectric presence sensors specifically designed to protect plant personnel from injuries related to hazardous machine motion. Also known as AOPDs (Active Opto-electronic Protective Devices), light curtains offer optimal safety, yet they allow for greater productivity and are the more ergonomically sound solution when compared to mechanical guards. They are ideally suited for applications where personnel need frequent and easy access to a point of operation hazard.

Safety light curtains consist of an emitter and receiver pair that creates a multi-beam barrier of infrared light in front of, or around, a hazardous area. When any of the beams are blocked by intrusion in the sensing field, the light curtain control circuit sends a signal to the machines e-stop. The emitter and receiver can be interfaced to a control unit that provides the necessary logic, outputs, system diagnostics, and additional functions (muting, blanking, PSDI) to suit the application. When installed alone, the light curtain pair will operate as a control reliable switch.

Light curtains are also called light screens, optical guards, and presence sensing devices. Light curtains emit a "curtain" of infrared light beams in front of the hazardous area being protected. A stop signal is sent to the machine being guarded when any of the beams are blocked. Light curtains guard areas many meters wide, and can be diverted around corners using mirrors. Application areas include perimeter guarding for industrial robots and machinery, and point of access guarding for automated machine assemblies. A photoelectric transmitter projects an array of synchronized, parallel infrared light beams to a receiver unit. When an opaque object interrupts one or more beams, the light curtain controller sends a stop signal to the guarded machine. The transmitter unit contains light emitting diodes (LEDs) that emit pulses of invisible infrared light when energized by the light curtain's timing and logic circuitry. Light pulses are both sequenced, one LED after another, and modulated, pulsed at a specific frequency. The receiver unit contains phototransistors and supporting circuitry to detect only the specific pulse and the frequency designated for it.

There are several important parameters to consider when specifying light curtains. These include spanning distance, protection height, sensitivity or resolution, response time, and operating temperature. The spanning distance is how far the transmitter and receiver can be separated and properly function. The transmitter and receiver must be able to function reliably within this minimum to maximum range of separation.

Using mirrors reduces the operating range up to 25% per mirror. (Example: 6 inches to 18 feet.) Protection height is the dimension of the active sensing field (correlates to the number of beams required). Sensitivity or resolution is the smallest sized object that will be positively detected by the light curtain. The response time of the light curtain is the maximum time between actuation of sensing function and the output relays. Operating temperature is the full-required range of ambient operating temperature.

Light curtains have a basic object detection size, finger, hand or body. Finger and hand detection is necessary when the operator is a short distance away from the hazardous zone. Body (or arm detection) is suitable for perimeter guarding. Safety categories for light curtains can be type 2, type 3, or type 4.

  • A type 2 light curtain runs a self-check when it is turned on or reset. The safety function shall be checked at machine start up and periodically by the machine control system. If a fault is detected, safe status shall be initiated or if that is not possible, a warning shall be given. The occurrence of a fault between checking functions can lead to a loss of the safety function between checking intervals.
  • A type 3 light curtain requires that more than one component must fail before it loses functionality. A single fault in any of the system parts does not lead to a loss of the safety function. Some but not all faults will be detected. An accumulation of undetected faults can lead to a loss of the safety function.
  • A type 4 light curtain continuously self-checks and will detect any loss of function immediately. A single fault does not lead to a loss of the safety function. The faults will be detected in time to prevent the loss of the safety function.

Most light curtains require an external controller. They may either come equipped with an integral controller, in which case they will not require the external controller, or they come equipped with the external controller. Multitasking controllers that monitor and control more than one set of light curtains are also available. Light curtains may be mounted on brackets, DIN rails, or the floor.

Changing a Photoeye Live

These are the steps for replacing an electrical photoeye while the power is on. Materials and equipment necessary are: VR rated hand tools, ESWP Gloves, Goggles or Safety Glasses, Hearing Protection, FR lon sleeve shirt, and long pants.


  1. Fill out an Energized Electrical work permit and submit it to management for approval.
  2. Notify affected personnel.
  3. Barricade work area (as applicable).
  4. Don your PPE.
  5. Using the VR rated screwdriver, open the junction box to expose the wires.

6. Using the VR Philips screwdriver and VR needle nose pliers, disconnect the photoeye power cable from the terminal strip in the following order: a. Blue/Black pair b. White c. Brown

7. Remove the power cord from the side of the junction box.

8. Remove the photoeye mounting plate from the conveyor.

9. Remove the photoeye assembly from the mounting plate.

10. Separate the photoeye from the swivel base.

11. Install the new photoeye on the swivel base.

12. Complete the installation of the photoeye by following steps 1-7 in reverse.

13. Align the new photoeye so that all three (green, red, and yellow) indicator lights are lit.

14. Open the access panel on top of the photoeye.

15. Turn the trim pot counterclockwise (to the left) until only the yellow light remains lit.

16. Turn the trim pot clockwise (to the right) until the green then red lights are lit.

17. Add an additional 1/4 turn.

18. Close the access panel.

19. Test the operation of the conveyor/photoeye by blocking the photoeye and observing the red and green lights. The lights should go out when the eye is blocked.

20. Notify affected personnel that the conveyor is back in service.

Basic Wiring and Connection Configurations

Normally there are three wires to a photoelectric sensor, they are colored brown, black, and blue. The brown wire is your positive source wire and should be connected to the positive side of the power supply. The blue wire is your negative or neutral wire and should be connected to the power supply as well but to the negative side of the supplied power. This leaves the black wire, which is considered the signal wire, and connects to the PLC input card.

When the sensor is activated, the signal wire will send a signal to the PLC and the PLC will respond as programmed.

There are two types of signals that can be sent to the PLC that will trigger a response. These are called the sink (NPN) and source (PNP). The sink signal is just what it sounds like, there is a source voltage present on the signal wire and when the sensor is activated this voltage sinks to zero volts.

The source signal acts just the opposite, there is a zero voltage potential on the signal wire and when the sensor is activated this potential sources from zero to a voltage range from 5 to 30 volts depending on the type of sensor being used.

Basic Troubleshooting of a Photoelectric Sensor

Determine what type of photoelectric sensor is being used. Is there a separate sender (transmitter) and receiver arranged in a through-beam configuration so that they are looking at one another? Is it a single photoelectric device using a reflector or bouncing a beam off the objects to be detected? Look for a part number and manufacturer name on the device. Try to find data sheets for the device on the company's website. Having the data sheets will reduce much of the guesswork involved in troubleshooting.

Determine the problem. Is the photoeye detecting an object with no object present? Is the sensor ignoring an object that it should be detecting? Does the problem happen at a certain time of day? Are there environmental influences acting upon the sensor? These are just a few conditions that should be noted when troubleshooting photoelectric sensors.

If the photoeyes register an output when no object is present, first check the face of the eyes to be sure it is clean. If the face is dirty, use a soft cloth and a non-abrasive, non-corrosive cleaner to wipe the face clean. If the photoelectric system incorporates a reflector, be sure to clean it thoroughly too. After cleaning test the photoeye now to see if it works.

If problems persist, try aligning the photoeyes. Using a length of string or wire have one person hold the line beside one photoeye and take your end across to the other. Pull the line tight so that it passes in parallel beside each eye, forming a straight line. It should be obvious that the photoeyes are out-of-alignment if one eye is parallel to the string and the other is not. Adjust both photoeyes as close as you can. Once they are pretty straight, make fine tuning adjustments to the sender eye only. If the sender photoeye is projecting a beam off to the side, then adjusting the receiver photoeye is worthless. This "string method" can also be used with the reflector combo.

If the photoelectric system still is not functioning, check the data sheet for the sensor to determine what supply voltage is necessary to operate the sensor. Set your multi meter to the correct setting AC or DC and verify that enough power is present to operate the sensor.

Is the receiver photoeye positioned in direct sunlight? The light from the sun can have adverse affects on photoelectric systems. It is OK to mount a sender (transmitter) in direct sunlight as long as the receiver is shielded from it.

If the photoeyes do not generate random signals, but instead ignore the objects that they are supposed to detect, then the problem is, more than likely, that the beam of light is not actually being broken. If there is a gain adjustment available on the sensor, adjust it to a lower setting.

Check your splices. If the wires of the sensor have ever been spliced, check the splices and verify that they are clean. Don't just wrap them together and wind electric tape around the splice. Use a molex connector, crimp the connector or solder the connections, and use a heat shrink tube to seal the connection.

If all else fails, try calling the manufacturer of the photoelectric sensor or a distributor of the product and ask for troubleshooting assistance.

Most of the time the fault will be obvious, either the sensor will be broken, became loose from its mount, misaligned or blocked by debris.

Be sure to eliminate the obvious conditions first before getting deeply involved with troubleshooting.