Discrete Sensors 101: Sensor types and best practices

Measuring success: Understand which type of discrete sensors to use for what applications, terminology, and tips.

By Jon Breen, Breen Machine Automation Services LLC June 7, 2018

Discrete or digital sensing is ubiquitous in automation. It has been used since the days of relay logic, before programmable logic controllers (PLCs) even existed, and its use today continues to simplify logic in the PLC. A discrete sensor sends an on/off (yes/no) signal, often allowing the PLC to ignore analog threshold, deadband, detection speed, and other complexities.

That signal could mean “I see a part,” “machine air pressure is above 80 psi,” “actuator has reached position,” “heater at temperature,” or a number of other situations. Robust machine function is highly dependent on using the right sensors in the right ways. Each one of these conditions is likely to use a different type of sensor.

Common types of sensors in automation

Below are many common types of sensors used for automation.

Limit switches

Limit switches, which are still in use today, have a mechanical switch that’s turned on or off when it’s in contact with a part. They can be found in various shapes and sizes and offer options like redundant contacts. Despite their simplicity and availability, many applications have transitioned to non-contact, solid-state sensors for their flexibility and long life. It can also be an inconvenience that limit switches require contact with the part they sense.

Reed switches

Reed switches, which are mostly used in pneumatics have a mechanical switch that’s turned on/off by a magnet. These are typically mounted on the cylinder where the piston has a magnet in it. Note that it’s not always best practice to sense the cylinder position. For example, when a cylinder drives a linkage that drives a plate which pushes a part into position. What if the pin comes out of the linkage? What if the linkage has some “slop” or backlash in its motion? It’s better to sense the plate that touches the part, rather than sensing the position of the cylinder. Since these are mechanical devices, there’s the same question of longevity as with limit switches. There are solid state versions of cylinder switches that can be used instead.

Proximity switches

Proximity switches are another common sensor that usually operates on an inductive principle, which requires metal—preferably containing iron—to function. Non-ferrous metals such as aluminum and copper can also be used, but these metals don’t detect as well as iron. In this case, there would be a shorter sensing range, and require a larger target to sense at all (sometimes to the point where it’s not very useful). There are two ways to improve detection in this case:

  1. Put a steel screw in the non-ferrous target for the prox to see.
  2. Use a “long-range” or “unshielded” prox. These are two names for a prox that is more sensitive because it has less metal shrouding on the tip of the sensor.

Other varieties exist that function on non-inductive principles (capacitive and ultrasonic) and can sense non-metallic parts. However, this is unusual enough that when a proximity switch comes up in conversation, it’s usually assumed to be inductive.

Photoelectric or photo eye sensors

Photo eye (PE) sensors have a light “emitter” and “receiver.” Sometimes they’re in the same package, and sometimes they’re separate. These are usually an inexpensive way to track parts in a system. Sometimes the light is guided through fiber optic lines and sometimes it’s used directly from the emitter/receiver. Parts can be detected either by reflecting light back to the receiver (a reflective application) or by blocking the light beam from reaching the receiver (a through-beam application). [subhead]

Choosing a type of sensor

When purchasing a sensor, there are many options. Once a sensor is chosen that fits mechanically and is the general type, there are other considerations to consider during the selection process:

  • PNP versus NPN: This is a required option for all solid-state devices. It describes the direction of current flow. PNP is typical in the U.S., but if there’s equipment from other origins, it’s important to know what the PLC input is expecting. If the PLC manual says “sinking input,” it’s PNP; if it says “sourcing input,” it’s NPN. Some input modules can be configured as either. In that case, look at what’s connected to the “common” terminal. If the common terminal is 0 V dc, it’s PNP; 24 V dc is NPN.
  • 2-wire versus 3-wire: This is mostly a choice between a mechanical contact (2-wire) and a solid-state contact (3-wire).
  • Quick disconnect versus integrated cable: Many sensors offer the option to have a permanently connected cable or a quick disconnect. For a slightly higher cost, the quick disconnect option usually makes maintenance a lot easier. If the sensor breaks, a new cable isn’t necessary.

There was a time when discrete sensors were truly digital in nature such as a mechanical pressure switch using a spring-loaded diaphragm, or a mercury-based thermostat, but the line is blurring. Modern discrete sensors often measure things such as pressure, temperature, inductance, and brightness in analog and convert to a digital yes or no using a tiny computer. Remarkably, many very simple sensors are now able to pass that analog information back to the PLC using technologies like IO-Link. If the data exists, and there’s a computer in there already, why not take advantage of it? This is a relatively new trend and hasn’t yet found a strong foothold in the market. The PLC and ladder logic programming language were founded on the concept of discrete signals.

Basic overview of where, when, how it simplifies programming:

  • Proxes
  • PEs
  • Lasers
  • More advanced
    • Color recognition
    • Pattern matching
    • Vision
    • Temperature controller.

Key terms and application notes for PEs

  • Visible versus infrared light: Users will usually have to aim the light, and that’s a lot easier if it can be seen, so consider visible light unless there’s a reason to use infrared (IR).
  • Crosstalk: The light from these sensors can interfere with other sensors and light curtains. Consider that the light won’t be a line, it’ll be a cone and may affect other devices that use the same wavelength (Figure 2). Several strategies can help combat crosstalk:
    • Alternate light direction when PEs are close to each other (Figure 3). For example, where two PEs are measuring across a conveyor 6-in. apart, the first one has its emitter on the left side, the second on the right.
    • Use different light wavelengths. For example, light curtains typically use infrared light. If PEs are used near a light curtain, use visible light PEs.
    • Put apertures on the emitters to narrow the cone of light (Figure 4).
  • Light-on versus dark-on: Should the sensor be on when it sees light, or when it doesn’t see light? This is usually adjustable with a screwdriver or button.
  • Precision: Simple PE applications don’t give very precise locations of the object being sensed. For example, sensing boxes on a conveyor with a reflective PE may only be accurate within an inch or two. Using fiber optic lines or apertures to make the emitted light and receiving area both as small as possible can help improve accuracy.
  • Lasers: These cost a little more, but they can do things other sensors can’t such as detect distance rather than only light blocking/reflecting. They also can sense clear parts, like plastic or glass.

Lessons learned

  • Proximity switches
    • Work best with magnetic materials (steel/iron) ○ Use a bolt head in other materials as a flag
    • “Long range” or “unshielded” proxs work better on non-magnetic materials (still has to be metallic)
  • Photo eyes
    • Can interfere with light curtain
    • Can look through material, even if it’s not transparent – it can then watch for “step” change in opacity (like in label strip)
    • Light on vs. dark on
    • Lasers are better at seeing transparent objects
    • Visible spectrum is easier to set up (aim)
    • Apertures – different shapes for different applications
  • Limit switches have moving parts, so they wear out faster

Jon Breen is the owner at Breen Machine Automation Services LLC. Edited by Emily Guenther, associate content manager, Control Engineering, CFE Media, eguenther@cfemedia.com.


KEYWORDS: discrete sensors, programmable logic controller (PLC)

  • Explore the main uses for discrete sensors.
  • Recognize common discrete sensor types by category.
  • Learn best practices and pitfalls to avoid with discrete sensors.

Consider this

What type of sensor would make the most sense for your application?


Learn more about sensors and PLCs on CFE Edu at https://cfeedu.cfemedia.com/

Related Resources