How-to
Amplifying a 0-20 mA PLC output to drive a 165 mA solenoid
Short answer
No PLC analog output supplies 165 mA directly: the SM 1232 tops out at 20 mA, so you add a closed-loop current amplifier that draws solenoid power from the 24 V rail. The gain is 8.25, set by an 82.5 Ω input resistor over a 10 Ω sense resistor; a 102 Ω coil drops 16.83 V at full scale, leaving 5.52 V and 0.91 W in the pass transistor.
On this page
- Can the SM 1232 output drive the solenoid on its own?
- How much current gain does the amplifier need?
- Does the 24 V rail have enough headroom for the coil?
- What amplifier circuit turns the command into coil current?
- How much heat does the pass transistor have to dissipate?
- Should the amplifier be driven from current mode or ±10 V?
- How do you commission the driver before the PID loop runs?
- Questions asked
No PLC analog output card will hand you 165 mA: the SM 1232 signal module tops out at 20 mA, so the solenoid gets its own driver and you amplify the signal externally. The design that fits is a closed-loop current sink — the module commands it with its full current span, the 24 V rail supplies the coil, and a sense resistor makes the transfer exact. The numbers: gain 8.25, coil drop 16.83 V at full scale, 7.17 V of headroom, and under 1.3 W worst case in the pass transistor. This article sizes each of those, gives the circuit, and walks the commissioning you do before the gas PID closes on flow.
Can the SM 1232 output drive the solenoid on its own? #
No. The solenoid needs over eight times that full-scale signal current at full command, so every workable design adds an external stage that draws its load current from the supply rail while the module supplies only the command.
The module's documented output ranges are ±10 V, 0-20 mA and 4-20 mA, with the current range represented as a 0 to 27,648 data word at 13-bit resolution (voltage is 14-bit). Nothing in configuration pushes the current output past its rated limit: the output stage is built to source signal current into a loop, not load current into a coil. How the conversion and output driving inside such a module work is covered in How PLC analog input and output modules convert signals.
Because this solenoid modulates continuously inside a PID loop on gas flow, the stage between them must be linear and monotonic, not merely capable of full current. That rules out a relay or a transistor switch, and it is why the design below regulates measured coil current instead of trusting a transistor's current gain.
How much current gain does the amplifier need? #
Exactly 8.25, set by the ratio of full-scale coil current to full-scale signal: 0.165 A / 0.020 A = 8.25, and in a closed loop that ratio becomes a resistor ratio rather than a transistor parameter.
Two resistors carry the whole tolerance story: an 82.5 Ω resistor turns the module's full signal span into a 0-1.65 V command, and a 10 Ω sense resistor turns the full coil current into the same 1.65 V. The loop holds those two voltages equal, so coil current is always 8.25 × command current, independent of the pass transistor's gain, temperature drift and unit-to-unit spread. One count of the data word is 0.020 A / 27,648 ≈ 0.72 µA of command, which the amplifier scales to about 5.97 µA of coil current — resolution far finer than the repeatability that matters in a flow loop.
Does the 24 V rail have enough headroom for the coil? #
Yes, with 7.17 V to spare before the sense resistor is chosen — the budget below shows where every volt and watt goes at full command.
| Item | Value at full scale | Arithmetic |
|---|---|---|
| Coil voltage | 16.83 V | 0.165 A × 102 Ω |
| Sense resistor drop | 1.65 V | 0.165 A × 10 Ω |
| Pass device voltage | 5.52 V | 24 V − 16.83 V − 1.65 V |
| Coil power | 2.78 W | 0.165 A² × 102 Ω |
| Sense resistor power | 0.27 W | 0.165 A² × 10 Ω |
| Pass device power | 0.91 W | 0.165 A × 5.52 V |
| Total from the rail | 3.96 W | 24 V × 0.165 A |
The budget closes on the rail: 2.78 W + 0.27 W + 0.91 W = 3.96 W, exactly what the supply delivers at full command. One measurement caveat belongs here: the 102 Ω was taken cold and unloaded, and copper climbs roughly 0.39 percent per °C in service, so a warming coil eats headroom — the hot-coil limit is calculated in the questions at the end.
What amplifier circuit turns the command into coil current? #
A single-supply op-amp current sink: the module's full signal span develops 0-1.65 V across an 82.5 Ω input resistor, the op-amp drives a pass transistor that carries the solenoid current, and feedback across a 10 Ω sense resistor closes the loop.
Topology first. The coil connects from the positive supply rail to the collector or drain of the pass device; the emitter or source goes through the sense resistor to 0 V; the op-amp compares the sense voltage with the command voltage and drives the pass device until they match. Build it in this order:
- Pass device: an NPN power transistor or a logic-level N-channel MOSFET, rated comfortably above the rail. Logic-level matters for the MOSFET because its source rides up to 1.65 V and the gate sees only a few volts above that.
- Sense resistor: 10 Ω from emitter or source to the amplifier's 0 V, in a 1 W part (0.27 W actual).
- Command resistor: 82.5 Ω, a standard E96 value, from the module's current output terminal to the same 0 V; the junction is the command node. 0.1 % parts hold the 8.25 ratio without trimming; 1 % parts give about 2 % worst-case error, which a PID loop closed on flow absorbs.
- Op-amp: non-inverting input to the command node, inverting input to the emitter or source pin, output to the base or gate through a 1 kΩ resistor. Pick a single-supply, rail-to-rail type whose maximum supply rating covers the rail and whose inputs work down to 0 V.
- Protection: a common 1 A rectifier diode reverse-biased across the coil, and 100 nF decoupling at the op-amp supply pin.
One pass of the loop action: at 10 mA of command the node sits at 0.825 V, the op-amp raises drive until 0.825 V appears across the 10 Ω, and 82.5 mA flows in the coil.
Why does the op-amp-plus-buffer schematic want a negative rail? #
Because those amplifiers' outputs cannot swing to the negative supply: the LT1012-plus-LT1010 proposal for this job is drawn with a −5 V rail so that zero command gives a true 0 mA, which a single-ended panel supply cannot provide.
Your two honest options are to add a small −5 V bias supply for that architecture, or to build the ground-referenced sink above with a single-supply op-amp; on a one-rail panel, build the sink. The buffer in the original proposal earned its place by driving long, capacitive cable without oscillating — the sink buys similar robustness from the 1 kΩ gate resistor and the scope check during commissioning. If you would rather specify a finished stage than build one, the established ways to drive proportional valves from standard control signals are laid out in 4-20 mA to 0-24 VDC proportional valve control methods.
How much heat does the pass transistor have to dissipate? #
Worst case 1.29 W at mid-range and 0.91 W at full scale: the pass device is a linear series element, so its dissipation peaks in the middle of the current range, and its package must be sized for the maximum.
With 102 Ω of coil and 10 Ω of sense resistance in the path, pass power is P = I × (Vrail − 112 Ω × I). The maximum sits where the derivative goes to zero, at I = 24 V / 224 Ω = 0.107 A: coil and sense resistor then hold 0.107 A × 112 Ω = 12.0 V, the pass device holds the other 12.0 V, and it burns 0.107 A × 12.0 V = 1.29 W. At the full-scale endpoint it holds only 5.52 V and burns 0.91 W.
The decision: 1.3 W rules out a small-signal TO-92 package. Use a TO-220 or TO-126 free in air, or an SOT-223 on a solid copper pour; above roughly 50 °C panel ambient, fit a small heatsink and isolate the tab if it is not at ground — in this topology the tab sits on the coil side. The sense resistor's 0.27 W justifies its 1 W rating. The coil's own 2.78 W dissipates into the valve body, which is the valve's continuous-rating question, not the amplifier's.
Should the amplifier be driven from current mode or ±10 V? #
Use the current mode: the load is unipolar, the 82.5 Ω burden sits far below the module's maximum load impedance, and a current command rejects the ground offsets a voltage signal would pick up crossing the panel.
In ±10 V mode, half of the module's span is negative command that a unipolar load can never use, while current mode maps the entire 0-27,648 data word onto the working range. If the channel must stay in voltage mode, divide the 0-10 V half down to 1.65 V and clamp negative output at zero inside the controller; that divider arithmetic sits in the questions at the end.
Grounding is one rule: tie the module's analog common and the amplifier's 0 V together at a single point, at the amplifier. When that ground is shared with drives or other noisy loads, or the valve wiring leaves the cabinet, put a signal isolator in the command path — the fault symptoms and the isolator fix are the subject of Fix a 4-20 mA output ground fault with a signal isolator.
How do you commission the driver before the PID loop runs? #
Verify the current stage by itself, with the gas isolated or vented to a safe path: an untuned loop can step straight to full command, which is full flow, so the electrical checks come first.
- Force the output word to 0 and confirm 0 mA in the coil; a ground-referenced single-supply sink shows no residual current.
- Force 27,648, the top of the data word, and confirm full-scale current with the meter in series with the coil. With 1 % resistors, accept roughly 161 to 169 mA; with 0.1 % parts, expect tighter.
- Step 25, 50 and 75 % and read current at each point: the curve must be monotonic and straight within a few percent. Stair-stepping or deadband means oscillation or wiring, not valve physics.
- Put a scope across the sense resistor at each step; it should be flat DC. Hum on a long cable run means increasing the gate series resistance or slowing the op-amp's local loop.
- Soak at full command for half an hour and re-read the current: the loop compensates for the warming coil until headroom runs out, so re-measure the coil resistance while it is hot.
- Restore the gas and tune the PID against measured flow. Current linearity is not flow linearity — the valve's flow curve is the process gain the controller sees — and mapping the controller output onto the data word is the job covered in Scale a PID real output to analog output counts.
Questions asked
Is a linear amplifier the only way, or can you PWM the coil?
A switching driver works too: commercial proportional-valve amplifiers often chop the coil with PWM and regulate the average current, which wastes far less power than a linear pass transistor. At this scale the linear sink is the simpler build, and its worst case of 1.29 W is easy to keep cool. If you go the PWM route, the valve datasheet governs: it states the ripple the coil tolerates and whether the valve needs dither to fight hysteresis.
What changes if the module must stay in the ±10 V voltage mode?
Use only 0 to +10 V and clamp the PID output so negative counts never leave the controller. Scale the command with a divider: 10 kΩ over 2 kΩ turns 10 V into 1.667 V, about 1 percent high, which you correct in the PLC scaling. The negative half of the module's range is dead span for a unipolar coil, so current mode uses the data word better.
How hot can the coil get before the rail can no longer hold full-scale current?
The limit is about 123 Ω. Copper rises roughly 0.39 percent per °C, so a 40 °C rise takes the measured 102 Ω to 118 Ω and 19.5 V at full current. Budgeting 1.65 V for the sense resistor and 2 V minimum across the pass device leaves 20.35 V for the coil: 20.35 V / 0.165 A = 123 Ω, which from 102 Ω is a 53 °C rise. Measure the coil hot; past that point derate full scale or raise the rail.
Does the PLC output need isolation from the amplifier?
Not when both share one panel and the analog common ties to the amplifier's 0 V at a single point: the current loop is short and the 82.5 Ω burden is a low-impedance node. Add a signal isolator when the amplifier ground carries drive or VFD currents, or when the valve wiring leaves the cabinet, because those are the conditions that put offset and noise on the command.
Can one amplifier drive two of these solenoids?
No. The feedback senses the current in one coil; adding a second coil in series or parallel moves the sense point and the loop no longer regulates either valve independently. Build or buy one current stage per coil. They can share the 24 V rail, and each stage gets its own pass device and sense resistor sized by the same arithmetic.