Catto / Topic Map · Industrial Electronics I Year 6
Industrial Electronics I · 144 h · Topic 8 of 10

Sensors, actuators and transducers

An automatic machine needs to know —where the part is, at what temperature, how much pressure there is— and it needs to act. Sensors are its senses and actuators its muscles; the control, which was covered earlier, is what sits in between.

Sensors Control 4-20 mA Encoders

01Vocabulary and characteristics

TermWhat it means
TransducerConverts one physical quantity into another, usually electrical.
SensorThe transducer plus its signal conditioning: it delivers a usable signal.
DetectorSensor with an on/off output: there is a part or there isn't.
RangeBetween which values it measures. Outside it, the reading means nothing.
ResolutionThe smallest change it can distinguish.
AccuracyHow far it deviates from the true value. It is not the same as resolution.
RepeatabilityWhether it measures the same thing under the same conditions. In automation it usually matters more than accuracy.
HysteresisThe difference between the switch-on point and the switch-off point. It prevents chatter.
Response timeHow long it takes to reflect the change. It limits the speed of the machine.
Repeatability before accuracy

A detector that always switches 2 mm early is not a problem: you correct the bracket position once and that's it. One that sometimes switches at 4 mm and sometimes at 6 mm is useless, even if on average it is perfect. In a machine, what you have to demand of a sensor is that it always do the same thing.

02Proximity detectors

steel aluminum plastic glass liquid Inductive Capacitive Diffuse optical Ultrasonic yes depends no no no Inductive: metals only · with aluminum, one third of the range yes yes yes yes yes Capacitive: almost anything, even through a non-metallic wall yes yes depends no depends Diffuse optical: depends on color and gloss: matte black barely reflects yes yes yes yes yes Ultrasonic: color doesn't affect it; wind and soft surfaces do Choosing the detector is, above all, a matter of looking at what material the object is made of
Figure 1. What each one detects, animated. The inductive one sees only metals; the capacitive one sees almost any material, even through a wall; the optical one needs to see the object; the ultrasonic one doesn't depend on color or transparency.
DetectorDetectsTypical rangePrecautions
InductiveMetals only2 to 15 mmThe rated range is for steel: with aluminum or bronze it drops to a third or a half. Immune to dirt and water.
CapacitiveAlmost everything: metal, plastic, liquids, grains3 to 25 mmDetects through non-metallic walls: useful for sensing the level inside a tank. Sensitive to moisture and dirt.
Through-beam opticalAny opaque objectUp to 50 mEmitter and receiver face each other: it is the most reliable and has the longest range, but both sides have to be wired.
Retroreflective opticalOpaque objectsUp to 10 mUses a prismatic reflector. A very shiny object can fool it.
Diffuse opticalObjects, depending on their color10 cm to 2 mAll in one housing. The range depends on the color and gloss of the object: matte black barely reflects.
UltrasonicAny material, even transparent10 cm to 6 mColor doesn't affect it. Wind, temperature and soft surfaces that absorb sound do.
Magnetic (reed or Hall)Magnetsmm to cmThe classic position detector for the rod of a pneumatic cylinder.
The inductive sensor's reduction factor

When the datasheet says “Sn = 8 mm,” that is with a standard-size steel plate. With other metals you have to multiply by the correction factor: stainless steel ≈ 0.7, bronze and brass ≈ 0.4, aluminum ≈ 0.35, copper ≈ 0.3. An 8 mm detector on aluminum detects at less than 3 mm, and that is the most common cause of “the sensor doesn't see the part.”

03How they are connected

PNP and NPN

Almost all industrial detectors are three-wire: two for power (24 V and common) and one for the signal.

  • PNP: when activated it drives the output positive. It is the standard in Europe and in most PLCs: the input is “sinking.”
  • NPN: when activated it pulls the output to common. Usual in Asian equipment.

They are not interchangeable: an NPN sensor on an input set up for PNP simply doesn't work, although nothing breaks.

NO and NC

Normally open conducts when it detects; normally closed conducts when it does not detect.

In safety circuits NC is always used: if the cable is cut or the sensor breaks, the system behaves as if the object were not there, which is the safe condition. It is the same criterion as the stop pushbutton seen in electrical installations.

Analog signals: why 4 to 20 mA
  • It is a current, so the drop in the cable doesn't affect it: it can be run for hundreds of meters without error.
  • Zero is at 4 mA, not at zero: if the current falls to 0 mA, the system knows that the cable was cut or the sensor died. This is called a live zero and it is its great advantage over 0-10 V.
  • It is converted to voltage with a resistor: with 250 Ω, 4-20 mA becomes 1-5 V, ready for the A/D converter.
  • 0-10 V is simpler and cheaper, but loses accuracy with distance and doesn't distinguish “real zero” from “cut cable.”
Example · Converting a transmitter's signal

A 0 to 10 bar pressure transmitter delivers 4-20 mA, read with 250 Ω and a 10-bit A/D with a 5 V reference.

  • 4 mA × 250 Ω = 1.0 V → 205 counts. 20 mA × 250 = 5.0 V → 1023 counts.
  • The useful range is 1023 − 205 = 818 counts for 10 bar: 0.012 bar per count.
  • If the reading falls below 205 counts, it is not “less than zero bar”: it is a fault. The program must detect it and raise an alarm.

04Position, speed and acceleration

A B Clockwise rotation: A leads B A B Counterclockwise rotation: A lags B every edge of A and B is a count: counting all four edges, the resolution is quadrupled An incremental encoder counts pulses: when power is cut it loses its reference and has to return to zero.
Figure 2. Incremental encoder, animated. Two channels shifted by 90° make it possible to tell how far it turned and also in which direction: if A leads B it turns one way, and if it lags, the other way.
SensorWhat it deliversNote
PotentiometerVoltage proportional to positionCheap and absolute, but it wears out and has a limited range.
Incremental encoderA, B and Z pulsesIt counts pulses: if power is cut, it loses its reference and has to return to the zero point. With both channels and all four edges the resolution is quadrupled.
Absolute encoderOne code per positionIt knows where it is as soon as it is switched on. More expensive; it communicates over a bus.
ResolverSinusoidal signalsVery rugged: withstands temperature, vibration and dirt. Demanding industrial motors.
TachogeneratorVoltage proportional to speedAnalog and simple. Today it is usually replaced by counting the encoder pulses.
MEMS accelerometerAcceleration on one to three axesMachine vibration, tilt, shock detection. It is the same sensor that cell phones have.
Example · Resolution of an encoder

A 1000 pulses per revolution encoder mounted on a shaft with a pinion that advances 50 mm per revolution:

  • With a single channel: 50/1000 = 0.05 mm per pulse.
  • Counting all four edges of A and B: 4000 counts per revolution → 0.0125 mm.
  • Turning at 3000 rpm, the pulse frequency is 1000 × 3000/60 = 50 kHz; counting in quadrature, 200 kHz. The microcontroller's counter has to be able to handle that: it is the reason why many microcontrollers come with hardware encoder inputs.

05Actuators

TechnologyForceControlWhen to choose it
Electric
motors, servos, steppers
MediumExcellentWhen you need to position accurately, regulate speed or log what happened.
SolenoidMedium, short strokeOn/offValves, latches, strikers. Simple and fast.
PneumaticHighOn/off, or proportional with expensive valvesFast repetitive motions, environments with a spark hazard, cleanliness. Cheap to install if compressed air is already available.
HydraulicVery highProportionalPresses, lifts, heavy machinery. Pressures of hundreds of bar: dangerous and messy if there are leaks.
Pneumatics: the essentials
  • Single-acting cylinder: the air pushes in one direction and a spring returns it. Double-acting: the air acts in both directions and it is the most widely used.
  • 5/2 solenoid valve: five ports and two positions, the typical valve for controlling a double-acting cylinder.
  • Flow controls on the exhaust to adjust the speed: never on the inlet, or the motion comes out jerky.
  • The force is pressure × area: a 32 mm diameter cylinder at 6 bar pushes 6 × 105 Pa × 8.04 × 10−4 m² ≈ 482 N, about 49 kgf.
  • Each cylinder carries magnetic detectors at its ends: they are the inputs that tell the control the motion is finished.

06In the lab

Lab 1 · Actual range of an inductive sensor

Use a caliper to measure at what distance an inductive detector switches with a steel plate, an aluminum one and a bronze one, and with a part smaller than the standard one. Compare with the catalog figure and calculate the reduction factor of each material.

Lab 2 · PNP, NPN, NO and NC

Wire the four cases with an LED and a resistor, and use the multimeter to check what voltage appears on the signal wire in each state. Then connect an NPN sensor to an input configured for PNP and check that it doesn't work, without anything breaking.

Lab 3 · The 4 to 20 mA loop

Build the loop with a transmitter and a 250 Ω resistor. Measure the current and the voltage for several values of the quantity. Then add 100 m of cable (a reel) and measure again: the current doesn't change. Repeat the experiment with a 0-10 V signal and compare the error.

Lab 4 · Encoder and direction of rotation

With an incremental encoder and the two-channel oscilloscope, look at A and B turning one way and the other: the phase relationship reverses. Count pulses with a microcontroller and display position and direction. Cut and restore the power: the count is lost, and that is where you understand what homing (the reference search) is for.

07Common mistakes

SymptomUsual cause
The inductive sensor doesn't detect the partThe part is aluminum or bronze, or smaller than the standard one: the actual range is much shorter.
The sensor gives no signal even though its LED lights upPNP output connected to an NPN input or vice versa.
The diffuse detector sees some parts and not othersIt depends on color and gloss. With dark parts you have to switch to through-beam or retroreflective.
The capacitive sensor switches on by itselfMoisture, dirt or condensation on the active face. Readjust the sensitivity and protect it.
The analog signal varies when the sensor is moved farther awayIt is 0-10 V and the drop in the cable affects it. Switch to 4-20 mA.
The system doesn't distinguish “zero” from “cut cable”Live zero is missing: with 4-20 mA, 0 mA is always a fault.
The encoder loses position every time the power goes outIt is incremental: you have to do homing, or use an absolute one.
Two inductive detectors close together affect each otherMutual interference: respect the minimum distance or use shielded versions.
The pneumatic cylinder arrives with a bangFlow controls badly placed: they go on the exhaust, not the inlet. And end-of-stroke cushions are missing.

08Self-assessment

Why does repeatability matter more than accuracy in automation?

Because a constant offset is corrected just once by adjusting the position or the calibration, whereas a random scatter makes the machine behave differently in each cycle and no adjustment can fix it.

What does an inductive sensor detect and how does it differ from a capacitive one?

The inductive one detects only metals and is very immune to dirt. The capacitive one detects almost any material —including liquids and grains, through a non-metallic wall— but it is affected by moisture and dirt.

An 8 mm inductive sensor detects aluminum. At what distance?

With a reduction factor of approximately 0.35: less than 3 mm. The catalog value corresponds to a standard steel plate.

What is the advantage of the live zero of the 4 to 20 mA signal?

That 0 mA is not a valid value: if it shows up, it is a cut cable or a dead sensor. With 0-10 V, a real zero and a fault look exactly the same.

With what resistor is 4-20 mA converted into 1-5 V?

With 250 Ω: 0.004 × 250 = 1 V and 0.020 × 250 = 5 V.

Why are safety sensors normally used normally closed?

Because with a cut cable or a failed sensor, the circuit is left open and the system takes the safe condition: it stops. With NO, a fault would be mistaken for “all in order.”

How does an incremental encoder determine the direction of rotation?

With two channels shifted by 90°: if A changes before B, it turns one way; if it changes after, the other way. Counting all four edges also quadruples the resolution.

A 500 pulses/revolution encoder on a shaft that advances 40 mm per revolution: what is the quadrature resolution?

2000 counts per revolution: 40/2000 = 0.02 mm per count.

What is the difference between an incremental and an absolute encoder?

The incremental one counts pulses and loses its reference when power is cut; the absolute one delivers a different code for each position and knows where it is as soon as it is switched on.

What force does a 32 mm pneumatic cylinder produce at 6 bar?

Area = π × 0.016² = 8.04 × 10−4 m². F = 6 × 105 × 8.04 × 10−4 ≈ 482 N, about 49 kgf. On the return stroke it is less, because the rod takes up part of the area.

Development of the topic “Sensors, actuators and transducers” of Industrial Electronics I (Year 6), based on the “Curriculum Proposal – Second Cycle of the Technical-Vocational Track, Secondary Education – Electronics,” Ministry of Education of the Province of Córdoba, DGETyFP. Back to the Topic Map · catto.ar