Discrete Sensors 101: Terminology and Best Practices

This article explores the main uses for discrete sensors, categorizes the most common types, and lists best practices and pitfalls to avoid.

Common Types of Sensors in Automation

Discrete, or digital, sensing is ubiquitous in automation.  It’s been used since the days of relay logic, before 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, so let’s talk about some of the most common and how to use them.

Limit Switches  

An oldy but goody, limit switches are still in use today.  These have a mechanical switch that’s turned on or off by contact with a part.  They can be found in just about any size and shape and even offer options like redundant contacts.  Despite the 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.

Figure 1 – The schematic representation of a limit switch or other mechanical contacts.

Reed Switches

Mostly used in pneumatics, reed switches have a mechanical switch that’s turned on/off by a magnet.  These are typically mounted right 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, let’s say 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.

The “Prox”

Short for “proximity switch,” you’ll see this sensor everywhere.  It 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 iron – in this case you can expect a shorter sensing range, and a larger required target to be able to sense at all (sometimes to the point that 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 is has less metal shrouding on the tip of the sensor.
Figure 1 – Shielded vs unshielded prox switches.  Notice the extra yellow plastic visible on the unshielded version. The yellow faces the part to detect

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

The schematic representation of a proximity (prox) switch.

Photo Eyes

Also called photoelectric (PE) sensors, photo eyes 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).

The schematic representation of a photo eye (photoelectric) sensor.

There are a lot of choices, terms, and application notes when it comes to PEs.  Here’s a quick rundown:

  • Visible vs IR light – You’ll usually have to aim the light, and that’s a lot easier if you can see it, so consider visible light unless there’s a reason to use 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 to combat crosstalk: 
    • 1) Alternate light direction when PEs are close to each other (Figure 3).  For example, where two PEs are measuring across a conveyor six inches apart, the first one has it’s emitter on the left side, the second on the right.  
    • 2) Use different wavelengths of light.  For example, light curtains typically use IR light.  If PEs are used near a light curtain, use visible light PEs.  
    • 3) Put apertures on the emitters to narrow the cone of light (Figure 4).
  • Light-on vs 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 – The simplest PE applications don’t give very precise location 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.  However, there are ways to be precise, usually using fiber optic lines or apertures to make the emitted light and receiving area both as small as possible.  
  • Lasers – These cost a little more, but they can do things others can’t.  They can detect distance, rather than only light blocking/reflecting.  They can also sense clear parts, like plastic or glass.  
Figure 2 – Photo eyes interfering with each other
Figure 3 – Alternate which side the light source is on to prevent interference
Figure 4 – Use apertures to narrow the light beam and prevent interference

All the options!

When you look to buy a sensor, you’ll undoubtedly have many choices.  Once you find something that fits mechanically and is the general type you’re looking for (e.g., a prox), you’ll probably still have to answer these questions:

  • PNP vs 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 you’ve got equipment from other origins, it’s important to know what your 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 common is 0VDC, it’s PNP; 24VDC is NPN.
  • 2-wire vs 3-wire – This is mostly a choice between a mechanical contact (2-wire) and a solid-state contact (3-wire).  
  • Quick disconnect vs integrated cable – Many sensors offer the option to have a permanently connected cable or a quick disconnect.  For slightly higher cost, the quick disconnect option usually makes maintenance a lot easier.  If the sensor breaks, you don’t have to run a new cable (sometimes a frustrating task).

Analog and Beyond: Discrete Sensors Continue to Evolve

There was a time when discrete sensors were truly digital in nature – e.g. 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 like 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 ubiquitous ladder logic programming language were founded on the concept of discrete signals, and for many applications, you just can’t beat the simplicity of a yes or no.

Leave a Reply