S7-300 SM 331 Potentiometer Wiring: 0-10V and 4-20mA Methods

David Krause18 min read
S7-300SiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

Connecting a potentiometer to a SIMATIC S7-300 SM 331 analog input module is a routine task, but it requires deliberate decisions on three engineering points: the module variant and its measuring range, the wiring topology (2-wire, 3-wire, or 4-wire), and the scaling of the raw integer (0..27648 or 0..32767) into engineering units. The most common destination is the SM 331 6ES7331-1KF0-0AB0 (8 AI, 13-bit) configured for 0-10 V ratiometric measurement, but a 4-20 mA loop can be implemented as well using a precision burden resistor or a dedicated voltage-to-current converter.

This reference consolidates the official Siemens connection guide for the 6ES7331-1KF0-0AB0, the S7-1200 potentiometer module documentation (used here only for the principle of operation), and field-tested wiring practice into a single step-by-step procedure. After wiring, the article shows how to scale the raw value in STEP 7 Classic with FC105 "SCALE" and in TIA Portal with NORM_X / SCALE_X, and finishes with a troubleshooting matrix for the typical diagnostic events raised by the module.

Read first. The SM 331 is shipped with a measuring range module that must be physically re-positioned (A, B, C, or D) whenever the input type changes. See Siemens KB 17071108 for the position of the module for voltage and current ranges.

SM 331 Module Family and Input Capabilities

The SM 331 family covers a wide range of channel counts, resolutions, and isolation. Potentiometer inputs are almost always implemented on a voltage range, so the relevant modules are those that support ±10 V, 0-10 V, or ±5 V with a high enough input impedance.

Article number Short designation Channels Resolution Voltage ranges Current ranges Input impedance (V mode)
6ES7331-1KF02-0AB0 AI 8 x 13 Bit 8 (4 in 2-wire, 8 in 4-wire) 13 bit + sign ±50 mV … ±10 V ±10 mA, 0/4-20 mA ≥ 100 kΩ
6ES7331-7KF02-0AB0 AI 8 x 13 Bit (isolated) 8 13 bit + sign ±50 mV … ±10 V ±10 mA, 0/4-20 mA ≥ 100 kΩ
6ES7331-1HF01-0AB0 AI 8 x 14 Bit 8 14 bit + sign ±50 mV … ±10 V ±5/20 mA, 4-20 mA ≥ 100 kΩ
6ES7331-7NF00-0AB0 AI 8 x 16 Bit 8 15 bit + sign ±50 mV … ±10 V ±10 mA, 0/4-20 mA ≥ 200 kΩ
6ES7331-7NF10-0AB0 AI 8 x 16 Bit (HS) 8 15 bit + sign ±50 mV … ±10 V ±10 mA, 0/4-20 mA ≥ 200 kΩ
6ES7331-1PF01-0AB0 AI 8 x RTD/TC 8 15 bit + sign ±50 mV … ±1 V (TC mode) — ≥ 10 MΩ

The base potentiometer measurement is best done on the 1KF02 or 7NF00 variants, where the 0-10 V range combined with 100-200 kΩ input impedance draws negligible current from the wiper (typically 50-100 µA at 10 V). The 1PF01 RTD/TC module can also be used, but only with the 0-1 V range and a low-resistance potentiometer (≤ 1 kΩ) to keep the source impedance within the module's specifications.

Potentiometer Selection and Ohm's Law Primer

Two parameters of the potentiometer must be checked before wiring: the total resistance (Rtot) and the power rating (Pmax). The 6ES7331-1KF0x input draws less than 100 µA at 10 V, so the wiper current is not the limiting factor. The real constraint is the excitation voltage applied across the element and the resulting self-heating.

Potentiometer Rtot Excitation Wiper current at midpoint Power dissipation at endpoints Recommended element
1 kΩ 10 V 5.0 mA 0.1 W Wirewound, 0.5 W minimum
2.2 kΩ 10 V 2.3 mA 0.045 W Conductive plastic, 0.25 W
5 kΩ 10 V 1.0 mA 0.020 W Conductive plastic, 0.1 W
10 kΩ 10 V 0.5 mA 0.010 W Conductive plastic, 0.1 W
47 kΩ 10 V 0.1 mA 0.0021 W Any (noise increases)

Keep the total resistance between 1 kΩ and 10 kΩ for best linearity. Above 10 kΩ, the cable capacitance starts to slow the input; below 1 kΩ, the module's input impedance (≥ 100 kΩ) introduces a small but measurable gain error of Rtot / (Rtot + Rin) that must be compensated in the application.

Linearity vs. life. Conductive-plastic elements give ±0.5 % to ±2 % linearity and 1 Mcycle life. Wirewound elements give ±0.1 % to ±0.5 % linearity and only 25-100 kcycle life. For position feedback on a valve or damper, prefer conductive plastic. For a laboratory set-point, prefer wirewound.

Three Wiring Topologies

The S7-300 SM 331 uses single-ended voltage inputs, so three different physical wirings are possible. Each has different error sources.

2-wire potentiometer (wiper + one end)

The simplest hookup: connect the wiper to M+ of the channel, the lower end of the track to M-, and tie the upper end to the 24 V reference (or to the same M- for a 0-V offset). This topology is the one described in Siemens KB 17071108.

        +24 V
         |
         |
       [ P1 ]  ←── upper end of track
         |
         └──── wiper ──────→  Ch0 M+  (terminal 2 on 1KF02)
         |
       [ P2 ]  ←── lower end of track
         |
        M-  ─────────────────→  Ch0 M-  (terminal 3 on 1KF02)

Gain: Uout = Uref × (Rwiper-P2 / Rtot). With Uref = 10 V and a 10 kΩ pot, the source impedance seen by the channel varies from 0 to 5 kΩ as the wiper moves. The loading error of the 100 kΩ input is therefore at most 5/105 ≈ 4.8 %, which is unacceptable for a precision application. Compensate this in software by dividing the measured ratio by 0.952.

3-wire potentiometer (Kelvin excitation)

Drives both ends of the track from a stiff reference and uses the wiper as the single signal conductor. This is the recommended topology for SM 331.

        +10 V (ratiometric ref. of channel or PS305/PS307)
         |
         ├────────── upper end of track (P1)
         |
       [  Rtot  ]
         |
         └────────── lower end of track (P2)  ─── M-  ─── Ch0 M-
         |
         wiper ────────────────────────────────→  Ch0 M+  (terminal 2)

Because the excitation is applied at the element, the cable resistance of the two end terminals does not enter the measurement. Only the wiper cable adds error, and the loading of the SM 331 (100 kΩ) on a 5 kΩ midpoint impedance is 5 %, identical to the 2-wire case but with no end-terminal cable error. A ratiometric measurement also rejects power supply drift automatically: if the 10 V drops to 9.8 V, both the excitation and the channel reference scale together.

4-wire potentiometer (true Kelvin, two for current, two for voltage)

Used only for very low resistance elements (≤ 100 Ω) or for laboratory-grade measurements. Two wires carry the excitation current, two wires sense the voltage directly at the track. The SM 331 does not provide dedicated sense terminals, so this topology is built by running the voltage sense wires back to M+ and M- of the channel while the current is injected through a separate pair.

        +10 V ── I+ ── upper end (current drive)
                    |
                  [ Rtot ]
                    |
        M-   ─── I- ── lower end (current drive)

        upper end (sense) ─────────→  Ch0 M+
        lower end (sense) ─────────→  Ch0 M-

This is the only topology that fully cancels cable resistance on both end and wiper conductors. For SM 331 it is rarely necessary because the channel input impedance is so high; reserve it for sub-ohm potentiometers or shunts.

Configuring the Measuring Range Module

Every SM 331 (except the 1PF01 RTD/TC) has a small plug-in "measuring range module" on the left side of the housing. The slot has four positions labelled A, B, C, D. The chosen range must match the position of the plug and the configuration in STEP 7 / TIA Portal.

Position Voltage ranges Current ranges RTD TC
A ±10 V, 0-10 V, ±5 V, 0-5 V, ±2.5 V, 0-2.5 V — — —
B ±1 V, 0-1 V, ±500 mV, 0-500 mV — Pt100, Pt1000, Ni —
C ±80 mV, 0-80 mV, ±50 mV, 0-50 mV ±20 mA, 0-20 mA, 4-20 mA, ±10 mA, 0-10 mA — Type B, E, J, K, L, N, R, S, T, U
D reserved / not used on 1KF02

For a potentiometer wired in 3-wire configuration with a 10 V excitation, set the measuring range module to position A and select "Voltage 0..10 V" in the hardware configuration of STEP 7 / TIA Portal. Position B with 0-1 V is also valid if you limit the excitation to 1 V, which reduces self-heating on very small potentiometers.

Converting a Potentiometer to a 4-20 mA Signal

Many S7-300 systems have only current-input channels wired in the cabinet, or the field requires a robust 4-20 mA loop with a 250 Ω receiver. Three methods are practical.

Method 1: Passive current loop with 24 V supply and series resistor

The simplest path. Connect the potentiometer as a 2-wire rheostat in series with a 24 V supply and a precision 250 Ω burden resistor. The wiper voltage drives the current through the loop. This requires the burden resistor to be mounted at the analog input terminal, not at the potentiometer.

        +24 V
         |
         R1 (250 Ω, 0.1 %)
         |
         ├─────────→  Ch0 M+  (channel set to 4-20 mA)
         |              |
         |            [ SM 331 input, ~50 Ω ]
         |              |
         └─────────  Ch0 M-
         |
       [ Pot 1 kΩ ]   ← rheostat, wiper shorted to one end
         |
        M- (24 V GND)

Current range: I = 24 V / (R1 + Rpot + Rshunt). With R1 = 250 Ω and Rpot sweeping 0-1 kΩ, the loop current is 24 V / 250 Ω to 24 V / 1250 Ω = 96 mA to 19.2 mA. This is too large for a 4-20 mA range. Adjust R1 to get the desired span: for a 4-20 mA loop with 0-1 kΩ wiper, R1 should be 24 V / 0.020 A − 1000 Ω = 200 Ω. Add a series resistor of 1.2 kΩ to set the 4 mA offset.

Method 2: V/I converter (XYR or SITRANS I)

For longer cable runs or noise-sensitive applications, use a dedicated voltage-to-current converter. Siemens SITRANS I 7NG412 or Phoenix Contact MINI MCR-UI-I modules accept 0-10 V at the input and output 4-20 mA. The potentiometer is wired to the converter input in 3-wire mode; the converter is mounted on a DIN rail and powered with 24 V. The 4-20 mA output is then wired directly to the SM 331 channel configured as 4-20 mA.

Galvanic isolation. The 7NG412 and MINI MCR variants are 3-way isolated (input, output, supply). This is the preferred method when the potentiometer and the S7-300 cabinet are on different ground potentials.

Method 3: Active 4-20 mA transmitter

For process-grade accuracy and integral EMI protection, mount a loop-powered transmitter such as the SITRANS P series or a third-party "potentiometer-to-current" transmitter. The transmitter is supplied from the loop, draws 4 mA, and modulates the current based on the wiper ratio. The S7-300 sees only a 4-20 mA source and a 2-wire loop.

Wiring Procedure (3-Wire, 0-10 V)

  1. Power off the S7-300 rack. Open the front door of the SM 331 by releasing the four captive screws.
  2. Remove the measuring range module by pulling it straight out of the side slot. Mark the channel groups 0-3 and 4-7.
  3. Reposition the plug to slot A for the channel group that will read the potentiometer. Reinsert the module firmly; the housing is keyed so the plug fits only one way.
  4. Close the front door and torque the four screws to 0.3-0.5 N·m. Power on the rack.
  5. In HW Config (STEP 7 V5.5) or the device view (TIA Portal V14+), open the SM 331 properties. Set channel 0 to "Voltage 0..10 V", integration time to 20 ms, and enable diagnostic interrupt if wire break detection is required.
  6. Wire the upper end of the potentiometer to the +24 V sensor supply (terminal 1 or 11 on the 1KF02 front connector). Wire the lower end to M- (terminal 3 or 13). Wire the wiper to M+ of channel 0 (terminal 2 or 12).
  7. Use shielded, twisted-pair cable (e.g. LiYCY 3 x 0.34 mm²). Ground the shield at the cabinet end only, on the shield bar of the front connector. Leave the shield floating at the potentiometer end.
  8. Verify the wiring with a multimeter between M+ and M-: the reading should track the wiper position smoothly between 0 V and 10 V with no dead spots. A jumpy reading usually means the wiper is worn or the track has debris.
  9. Download the hardware configuration to the CPU and go online. Open a VAT on PIW 288 (the input word for channel 0 of slot 4) and turn the potentiometer from end to end. The integer should swing from 0 (0 %) to 27648 (100 %).

STEP 7 Classic Scaling (FC105 "SCALE")

FC105 converts the raw 0-27648 value to a real number in engineering units. For a position transducer with 0-10 V = 0-100 %:

       CALL  FC    105
         IN     :=IW288            // raw value from SM 331 channel 0
         HI_LIM :=1.000000e+002    // engineering max = 100.0 %
         LO_LIM :=0.000000e+000    // engineering min = 0.0 %
         BIPOLAR:=FALSE            // unipolar 0..10 V
         RET_VAL:=MW200            // return code (0 = no error)
         OUT    :=MD204            // scaled value as REAL, e.g. 47.3

For a bipolar range (e.g. -10 V to +10 V for a center-zero valve positioner), set BIPOLAR := TRUE and use the full ±27648 range. FC105 automatically maps -27648 to LO_LIM and +27648 to HI_LIM.

TIA Portal Scaling (NORM_X and SCALE_X)

In TIA Portal V14 and later, the equivalent of FC105 is the pair NORM_X and SCALE_X from the "Basic instructions" palette. They are both IEC 61131-3 compliant and run on any S7-300/400/1200/1500 CPU. Example SCL code in a function block:

// "ScalePotFB"
#rNorm := NORM_X(MIN := 0,           // raw min  (corresponds to 0 V)
                 VALUE := %IW288,     // raw input from channel 0
                 MAX := 27648.0);     // raw max  (corresponds to 10 V)

#rPercent := SCALE_X(MIN := 0.0,      // engineering min 0 %
                     VALUE := #rNorm, // normalized 0.0..1.0
                     MAX := 100.0);   // engineering max 100 %

The advantage of the two-step NORM_X / SCALE_X is that the normalized intermediate value can be reused for two different ranges (for example, both % and mm) without re-reading the input word.

STEP 7 Wiring Plan (SVG schematic)

The following is a logical wiring plan for SM 331 6ES7331-1KF02 in slot 4 of an S7-300 rack, with the potentiometer in 3-wire topology on channel 0:

SM 331 (Slot 4) 6ES7331-1KF02-0AB0 1 +24 V (sensor supply) 2 Ch0 M+ (input) 3 Ch0 M- 11 +24 V (ch 4-7) 12 Ch4 M+ 13 Ch4 M- Potentiometer 10 kΩ, 0.5 W P1 P2 wiper to 24 V to M-

Hardware Configuration in TIA Portal (S7-300, CPU 315-2 PN/DP)

  1. Open the TIA Portal project and the device view of the S7-300 station.
  2. From the hardware catalog, drag AI 8 x 13 Bit (6ES7331-1KF02-0AB0) into slot 4.
  3. Open the module properties → "Analog inputs" → select channel 0.
  4. Set Measurement type = Voltage, Range = 0..10 V, Integration time = 20 ms (50 Hz rejection, recommended for Europe).
  5. Enable Diagnostic interrupt if you want the CPU to call OB82 on overflow, underflow, or wire break.
  6. Compile and download the hardware configuration. The CPU now writes the channel 0 value to %IW288 in the process image (assuming slot 4 with input address range starting at 288).
Address offset. SM 331 modules in slot 4 of an S7-300 start at input address 288 (slot 1 = IB0, slot 2 = PB4, slot 3 = 256, slot 4 = 288). Always double-check with the module's "Addresses" tab in HW Config, because the offset can change with different CPU types or expansion racks.

Diagnostic Events and Error Codes

SM 331 raises a diagnostic interrupt (OB82) for the following events when the diagnostic interrupt is enabled in the hardware configuration:

Event class Trigger condition Channel LED (SF) Recommended action
0x0001 Wire break (live zero mode only, current ranges) red, flashing Check 4-20 mA loop; verify burden resistor and supply
0x0002 Short circuit to M (current ranges) red, steady Check field cable insulation
0x0004 Overrange (value above +32511) — Reduce input or move measuring range module
0x0008 Underrange (value below -32512 bipolar / below -1 unipolar) — Check wiring, polarity, sensor supply
0x0010 Lost external sensor supply (L+ missing) red, flashing Check PS305/PS307 24 V to terminals 1, 11
0x0100 Measuring range module position mismatch red, flashing Re-seat the measuring range module
0x0200 Module parameterization error red, steady Recompile HW Config; check firmware compatibility

Voltage ranges do not raise a wire-break diagnostic, because the SM 331 cannot distinguish a broken wire from a 0 V signal. If wire-break detection is required on a potentiometer loop, convert the signal to 4-20 mA with an offset (4 mA = wiper at one end) using Method 2 or 3 above.

Troubleshooting Matrix

Symptom Probable cause Verification Corrective action
PIW = 0 even when wiper is at 100 % Wiper connected to M-, end terminal connected to M+ Measure voltage between Ch0 M+ and Ch0 M- with DMM Swap wiper and end-terminal wiring
PIW = 27648 even when wiper is at 0 % End terminal shorted to +24 V instead of M- Verify +24 V and M- on the front connector Move end terminal to M- (terminal 3 or 13)
PIW reads correctly at endpoints, but drifts 1-2 % in the middle Source impedance too high, 50/60 Hz pickup Reduce Rtot to 2.2 kΩ; check shielding Use shielded cable grounded at cabinet end only
PIW jumps in 100-200 LSB steps Integration time too short (2.5 ms) for noisy environment Change integration time to 20 ms Set HW Config → Integration = 20 ms
PIW negative even though hardware is unipolar Measuring range module still in position C (current) instead of A (voltage) Open the front door and re-seat the module to A Re-seat module, recompile HW Config
CPU goes to SF; OB82 called with event 0x0010 Sensor supply fuse blown or 24 V not applied to terminals 1/11 Measure 24 V DC at front connector terminals 1 and 11 Restore 24 V supply or replace fuse
PIW latched at +32767 (overflow) Wiper wire open circuit; module sees full 10 V Check wiper continuity with ohmmeter Repair wiper wire; tighten terminal screw

Field Commissioning Checklist

  • Confirm the 24 V sensor supply on the SM 331 is present at terminals 1/11 (≥ 20.4 V).
  • Verify the measuring range module is in slot A (or B for 0-1 V) and that the front door is closed.
  • Move the wiper to the mechanical end-stop and confirm the multimeter reads 0 V (or 10 V at the other end).
  • Use a VAT on the input word to confirm the raw value spans 0 to 27648 across the full mechanical travel.
  • Verify FC105 / SCALE_X output at 0 %, 50 %, 100 % of the mechanical range. Tolerance: ±2 % is normal for a conductive-plastic element.
  • If the application is safety-relevant, add a watchdog that checks for the input word being stuck at 0 or 27648 for more than 10 s, which indicates a broken wiper.
  • Document the potentiometer part number, the channel used, the engineering range, and the calibration date in the loop drawing or the equipment file.

Safety and EMC Considerations

Potentiometers in the field are often subject to vibration, temperature, and contamination. A few field rules keep the loop reliable for years.

  • Use a sealed potentiometer (IP65) if the environment is wet or dusty. Sealed conductive-plastic elements (e.g. ALPS RK271, Bourns 6539) are rated for 1 Mcycle and 85 °C.
  • Route the potentiometer cable in its own conduit, at least 200 mm away from VFD output cables and 100 mm from 480 V power. The wiper signal is high-impedance and therefore a good antenna for common-mode noise.
  • Apply strain relief to the potentiometer shaft. Side load on the shaft is the leading cause of premature wear.
  • For applications in EX zone 2, use a certified potentiometer with a maximum input power of 1.2 W and connect it through a Zener barrier or use the SM 331 in intrinsically safe mode with a 6ES7331-7RD00-0AB0 (Ex i) module.
  • If the loop must survive a 4 kV surge (IEEE 587 / IEC 61000-4-5), add a TVS diode (e.g. P6KE10CA) across the analog input and a gas discharge tube on the cable shield.

Related Documentation and Manuals

FAQ

Which SM 331 variant is best for a potentiometer input?

The 6ES7331-1KF02-0AB0 (8 AI, 13-bit) is the most common choice. It supports the 0-10 V range with 100 kΩ input impedance and handles 0-27648 raw values. For higher resolution, use the 6ES7331-7NF00-0AB0 (16-bit).

Do I need the 3-wire topology if the potentiometer is mounted directly on the cabinet?

For short cable runs (≤ 2 m) inside the cabinet, 2-wire is acceptable. For anything routed through conduit or near noise sources, use 3-wire ratiometric with the wiper as the only signal conductor.

Why does my PIW read 0 when the wiper is at 100 %?

The most common cause is reversed wiring: the wiper is on M- and the end terminal is on M+. Measure the voltage between Ch0 M+ and Ch0 M- with a DMM; if it reads 0 V at the wrong end of the travel, swap the wiper and end wires.

Can I detect a broken potentiometer wiper with the SM 331?

No, in the 0-10 V configuration the module cannot distinguish a broken wire from a 0 V signal. Convert the signal to 4-20 mA with a transmitter, or add a software watchdog that flags PIW = 0 for more than 10 s.

What is the maximum cable length for a potentiometer to SM 331?

For a 10 kΩ potentiometer with 100 kΩ input impedance, the RC filter formed by the cable capacitance and the source impedance limits the bandwidth. With LiYCY 3 x 0.34 mm² cable (≈ 100 pF/m), keep the run below 50 m to stay within the 20 ms integration time. For longer runs, lower the potentiometer value to 2.2 kΩ or use a 4-20 mA transmitter.

Back to blog