September 23rd, 2011

Introduction to industrial sensors

Industrial sensors

At Moey, it isn’t uncommon that our projects required us to be unique in our design, nimble in our execution, robust in what we deliver, yet economical all at the same time. Considering we’re all tinkerers at heart, this can be a hard pill to swallow. We like to play with new sensors and appreciate the challenge of learning how to use them, but this is often not the best approach when we have a tight timeline and many pieces of a project to worry about. In the past, we’ve used industrial sensors on occasion when we needed to get something done simply with no hiccups down the road but the cost of the sensors have often bothered us. Industrial sensors, while amazingly robust and reliable, are often overkill for what we do and leave us feeling like we’ll never reap the full benefits of the product. However, lately we’ve had a renewed interest as we’ve stumbled upon some really economical sensors that may just have eased our tummies.

Given we are tinkerers that like to share, we thought we’d try to peel your eyes away from Sparkfun just for a moment to show you how industrial sensors can really improve the quality of your projects with not as much money as you may think!


  • Very reliable
  • Robust, designed for long term use
  • Not uncommon to find U.S.A. made products
  • Possible to get a price deal if purchasing for a prototype
  • Possible to get a “loaner”
  • Great mounting capabilities


  • Often expensive, though cheap varieties can be found
  • Often have to call or email the company to retrieve pricing
  • May have to purchase through vendor and not the company directly
  • Extensive customization and long part numbers can be intimidating

Industrial sensors often provide their sensing feedback in the form of a digital signal or digital control. If the sensor tracks tilt, rotation, or any other naturally analog characteristic it is possible to receive an analog, PWM (pulse width modulation), or quadrature output, but at the moment, I only plan to address digital sensors with this article. Most commonly you will see industrial sensors described as PNP or NPN output with a NO (normally open) or NC (normally closed) default behavior. If you have any experience with transistors this language should sound familiar, but if its not, don’t fret! I plan to explain that all shortly along with how you can make it do your bidding.


Most industrial sensors function in a similar manner to discrete transistors. This means that they are used primarily for turning on or off an electrical load like a switch based on what the sensor is sensing. For instance, a capacitive proximity sensor may turn a motor or light on when it senses the presence of a human hand or finger. Also, like transistors they come in PNP and NPN forms. PNP is used for sourcing a load, i.e. providing a load, that is already grounded, a path to power. NPN is used for sinking a load, i.e. providing a load, that is already connected to power, a path to ground.

Fargo wiring diagram

Diagram from Fargo Controls datasheet

Normally open, normally closed

It is also common to be given the choice between a NO (normally open) and a NC (normally closed) sensor. In a normally open (NO) sensor, it will NOT source or sink until it detects an object, magnet, beam of light, etc. In a normally closed (NC) sensor, it will ALWAYS source or sink until it detects an object, magnet, beam of light, etc. Sometimes you will find a sensor that has the flexibility and wiring to be used in either manner.

How do I use them?

There are many, many different ways of using an industrial sensor. I’d first like to share how you can use these sensors with a microcontroller.

This PNP example requires the use of a voltage divider (two resistors) in order to divide the 12 volts from the sensor to an acceptable level so that a microcontroller’s digital input pin can handle it safely. The digital pin will be brought HIGH whenever the sensor detects an object.

This NPN example does NOT require the use of a voltage divider given we can set a pull-up resistor in the microcontroller. If this internal pull-up resistor is not an option, you can use an external 10k ohm resistor from BLACK to +5V. The digital pin will be brought LOW whenever the sensor detects an object.

Keep in mind, each example is using a NO (normally open) sensor. The logic of each can be inverted if you choose a NC (normally closed) sensor. If your sensor can be either NO or NC, then simply move your circuit from the BLACK wire to the WHITE wire.

Tada! This has been a brief overview of industrial sensors along with a pair of basic examples of how to use them with a microcontroller. Feel free to contact us if you have any questions or if you see anything that needs correctly.


  • Automation Direct – huge variety, moderate cost
  • Fargo Controls – great selection of value line sensors, lowest we’ve seen
  • OMRON – general industrial automation
  • Penny + Giles – interesting joysticks and tilt / rotary sensors
  • Photocraft Encoders – variety of wheel and shaft encoders for tracking rotary motion
  • Turck USA – general industrial automation
  • Balluff – high quality, large variety industrial sensors
  • Mouser – vendor’s industrial sensor section
Be Sociable, Share!
by Rory | Posted in Article | 2 Comments » | Tags: , ,


Comment by elcetro_noob
  • Very, very usefull article!! It’s all clear, but i have one question: is it important to connect sensor and mcu to the same power supply, or i can connect mcu to eg. battery??

    February 22, 2013 @ 10:35 am
  • Comment by Rory
  • The sensor and microcontroller do not need to be connected to the same power supply. They share the same power source in the diagram for simplicity only. You can definitely use two different power supplies but you will need to make sure they share ground (connect the ground wires from each power supply together).

    February 22, 2013 @ 11:07 am
  • RSS feed for comments on this post. TrackBack URI

    Leave a comment