Voltage divider to read a resistive sensor
Also available in: Català · Castellano
The problem
Many sensors change their resistance (spring sensors, potentiometers, LDRs, thermistors…). The analogue input of a PLC or an Arduino only reads voltage.
The solution
Connect the sensor in series with a fixed resistor and power it with DC. The voltage at the midpoint is:
Vout = Vcc · RS / (RS + Rfixed)
Example: Vcc = 10 V, Rfixed = 10 kΩ. If the sensor reads 10 kΩ, Vout = 5 V; if it drops to 5 kΩ, Vout ≈ 3.3 V.
The analogue input turns Vout into a number (an ADC) and the program converts it to units with a calibration.
In the cell: sensor S4
When the lifter raises the part, it compresses a spring and the resistance of S4 changes. The PLC reads the divider voltage on channel CIO 2005 and a function block calculates the height. If it’s out of limits, the part goes to reject bin 1.
Choosing the fixed resistor
Sensitivity is highest when Rfixed is close to the sensor’s resistance in the middle of its range.
Interactive demo
Related concepts
Load cell
Strain gauges glued to a piece of metal change their resistance slightly when it bends. A Wheatstone bridge gives a few millivolts, an ADC turns them into counts and calibration converts those to grams.
Flexible manufacturing cell
An automated line in three phases: feeding and sorting, machining and storage. Two PLCs coordinate sensors, pneumatic cylinders and servomotors to handle each part according to its material and colour.