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.
01Vocabulary and characteristics
| Term | What it means |
|---|---|
| Transducer | Converts one physical quantity into another, usually electrical. |
| Sensor | The transducer plus its signal conditioning: it delivers a usable signal. |
| Detector | Sensor with an on/off output: there is a part or there isn't. |
| Range | Between which values it measures. Outside it, the reading means nothing. |
| Resolution | The smallest change it can distinguish. |
| Accuracy | How far it deviates from the true value. It is not the same as resolution. |
| Repeatability | Whether it measures the same thing under the same conditions. In automation it usually matters more than accuracy. |
| Hysteresis | The difference between the switch-on point and the switch-off point. It prevents chatter. |
| Response time | How long it takes to reflect the change. It limits the speed of the machine. |
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
| Detector | Detects | Typical range | Precautions |
|---|---|---|---|
| Inductive | Metals only | 2 to 15 mm | The rated range is for steel: with aluminum or bronze it drops to a third or a half. Immune to dirt and water. |
| Capacitive | Almost everything: metal, plastic, liquids, grains | 3 to 25 mm | Detects through non-metallic walls: useful for sensing the level inside a tank. Sensitive to moisture and dirt. |
| Through-beam optical | Any opaque object | Up to 50 m | Emitter and receiver face each other: it is the most reliable and has the longest range, but both sides have to be wired. |
| Retroreflective optical | Opaque objects | Up to 10 m | Uses a prismatic reflector. A very shiny object can fool it. |
| Diffuse optical | Objects, depending on their color | 10 cm to 2 m | All in one housing. The range depends on the color and gloss of the object: matte black barely reflects. |
| Ultrasonic | Any material, even transparent | 10 cm to 6 m | Color doesn't affect it. Wind, temperature and soft surfaces that absorb sound do. |
| Magnetic (reed or Hall) | Magnets | mm to cm | The classic position detector for the rod of a pneumatic cylinder. |
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
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.
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.
- 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.”
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
| Sensor | What it delivers | Note |
|---|---|---|
| Potentiometer | Voltage proportional to position | Cheap and absolute, but it wears out and has a limited range. |
| Incremental encoder | A, B and Z pulses | It 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 encoder | One code per position | It knows where it is as soon as it is switched on. More expensive; it communicates over a bus. |
| Resolver | Sinusoidal signals | Very rugged: withstands temperature, vibration and dirt. Demanding industrial motors. |
| Tachogenerator | Voltage proportional to speed | Analog and simple. Today it is usually replaced by counting the encoder pulses. |
| MEMS accelerometer | Acceleration on one to three axes | Machine vibration, tilt, shock detection. It is the same sensor that cell phones have. |
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
| Technology | Force | Control | When to choose it |
|---|---|---|---|
| Electric motors, servos, steppers | Medium | Excellent | When you need to position accurately, regulate speed or log what happened. |
| Solenoid | Medium, short stroke | On/off | Valves, latches, strikers. Simple and fast. |
| Pneumatic | High | On/off, or proportional with expensive valves | Fast repetitive motions, environments with a spark hazard, cleanliness. Cheap to install if compressed air is already available. |
| Hydraulic | Very high | Proportional | Presses, lifts, heavy machinery. Pressures of hundreds of bar: dangerous and messy if there are leaks. |
- 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
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.
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.
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.
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
| Symptom | Usual cause |
|---|---|
| The inductive sensor doesn't detect the part | The 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 up | PNP output connected to an NPN input or vice versa. |
| The diffuse detector sees some parts and not others | It depends on color and gloss. With dark parts you have to switch to through-beam or retroreflective. |
| The capacitive sensor switches on by itself | Moisture, dirt or condensation on the active face. Readjust the sensitivity and protect it. |
| The analog signal varies when the sensor is moved farther away | It 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 out | It is incremental: you have to do homing, or use an absolute one. |
| Two inductive detectors close together affect each other | Mutual interference: respect the minimum distance or use shielded versions. |
| The pneumatic cylinder arrives with a bang | Flow 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.