Siemens LOGO! 8 Water Circuit: Sensor Scaling & Valve Logic

David Krause12 min read
Sensor IntegrationSiemensTutorial / 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

Siemens LOGO! 8 Water Circuit: Sensor Scaling & Valve Logic

1. Application Overview

This reference documents a fill/vent control loop implemented on a Siemens LOGO! 8.2 logic relay. A single digital output drives a normally-closed water inlet valve. The output is forced OPEN when any of three conditions is detected:

  • Low pressure in the circuit (pressure transmitter below the trip point).
  • High temperature in the circuit (temperature transmitter above the trip point).
  • Low tank level (two conductive level switches report an empty / partially empty tank).

A second indicator output drives an alarm lamp that is energized whenever any of the three trips is active. The application also exposes a custom HMI screen through the LOGO! integrated extended web server so the operator can monitor tank level, scaled pressure and temperature values, and reset the alarm from a browser.

The hardware target is the LOGO! 8.2 base module 6ED1052-1MD08-0BA0 (LOGO! 24CE with display) expanded by an AM2 analog input module 6ED1055-1MA00-0BA2. Programming is performed with LOGO! Soft Comfort V8.x.

2. Prerequisites

  • LOGO! Soft Comfort V8.2 or later (Siemens Support: LOGO! Soft Comfort V8.2 download).
  • LOGO! 8.2 firmware V8.2.0 or later on the base module (LOGO! 8.2 firmware update (V1.0.1)).
  • Two-wire pressure transmitter, 4–20 mA output, range covering at least 0–1.5 bar.
  • Two-wire temperature transmitter, 4–20 mA output, range covering at least 0–50 °C.
  • Two conductive (or float) level switches labelled L˅ (low) and L˄ (high). Contacts are volt-free and read by the LOGO! 24 V DC inputs.
  • 24 V DC power supply sized for the LOGO!, the two transmitters, the valve coil, and the alarm lamp.
  • PC with Ethernet port for the Web Editor upload.

3. Hardware Configuration and Wiring

The base module 6ED1052-1MD08-0BA0 provides eight 24 V DC digital inputs (I1–I8) and four relay outputs (Q1–Q4). The on-board AI1–AI4 terminals accept 0–10 V natively. The AM2 expansion adds AI5 and AI6, which are switch-selectable between 0–10 V and 0/4–20 mA. Set the AM2 DIP switches to the current position for the two transmitters.

Signal Sensor type LOGO! terminal Range Notes
Pressure transmitter 4–20 mA Two-wire AI5 (AM2) 0–? bar (see §4) Loop powered from 24 V; 250 Ω sense resistor optional
Temperature transmitter 4–20 mA Two-wire AI6 (AM2) 0–? °C (see §4) Loop powered from 24 V
Level switch L˅ (low) Volt-free contact I1 24 V DC Wire as sourcing input; enable P-pull-up filter
Level switch L˄ (high) Volt-free contact I2 24 V DC Same wiring as L˅
Water valve (NC solenoid) 24 V DC coil Q1 24 V DC Valve is normally closed; energized = OPEN
Alarm lamp 24 V DC LED Q2 24 V DC Driven by OR of all three trip flags
Wire the AM2 current loop with the transmitter positive to the +24 V rail, the transmitter negative to the AIx terminal, and the AM2 ground reference to the supply common. The AM2 internal shunt converts 4–20 mA to 0–2 V which the analog block normalises to 0–1000.

4. Analog Signal Scaling

The AM2 module reports current loops as the raw integer 0–1000 representing 0–20 mA, not 4–20 mA. You must subtract the 4 mA zero before applying the engineering-range gain.

Use the LOGO! Analog Amplifier (block B025) and Analog Threshold Trigger (block B009) to convert raw counts to engineering units and to set the trip thresholds. The general conversion formula is:

ENG = (RAW − ZERO_RAW) × GAIN + ENG_MIN

where:

  • RAW = 0–1000 from the AI block.
  • ZERO_RAW = (4 mA / 20 mA) × 1000 = 200.
  • ENG_MIN = engineering value at 4 mA (e.g. 0 bar, 0 °C).
  • GAIN = (ENG_MAX − ENG_MIN) / (1000 − 200) = (ENG_MAX − ENG_MIN) / 800.

4.1 Pressure Scaling Example

From the field data: 7 mA corresponds to 1.1 bar. If the transmitter range is 0–10 bar, then GAIN = 10 / 800 = 0.0125 bar per count. A trip threshold of 1.1 bar converts to:

RAW_TRIP = (1.1 − 0) / 0.0125 + 200 = 88 + 200 = 288

The trip flag P_LOW = 1 whenever raw AI5 < 288 (i.e. pressure below 1.1 bar). At 7 mA exactly the flag is 0; above 7 mA it remains 0; below 7 mA (down to 4 mA) it is 1.

4.2 Temperature Scaling Example

From the field data: 6.5 mA corresponds to 12.5 °C. If the transmitter range is 0–100 °C, then GAIN = 100 / 800 = 0.125 °C per count. The trip threshold 12.5 °C converts to:

RAW_TRIP = (12.5 − 0) / 0.125 + 200 = 100 + 200 = 300

The trip flag T_HIGH = 1 whenever raw AI6 > 300 (i.e. temperature above 12.5 °C). At 6.5 mA exactly the flag is 0; above 6.5 mA it becomes 1.

If your transmitters use a different range, substitute the proper ENG_MAX. Re-derive RAW_TRIP rather than trusting the values above. The principle is identical; only the constants change.

4.3 Threshold Trigger Block Parameters

Block parameter P_LOW (B009) T_HIGH (B009)
On threshold (A) 288 300
Off threshold (B) 285 (3-count hysteresis) 297 (3-count hysteresis)
Gain (G) 1 1
Sensor (S) AI5 AI6
Output inversion Yes (low = 1) No (high = 1)

5. Level Switch Logic

Two conductive probes are installed vertically inside the tank. The lower probe L˅ closes its contact when immersed. The upper probe L˄ closes its contact when the tank reaches its high level. The convention used here is:

  • Contact closed (immersed) → LOGO! input reads 1.
  • Contact open (dry) → LOGO! input reads 0.

The source description originally labelled these as "1 = no water, 0 = water" which is the inverse convention; for the LOGO! implementation we adopt the standard sourcing-input convention (1 = contact closed, water present). Reverse the polarity in the wiring if your probes behave oppositely.

5.1 Truth Table

L˅ (I1) L˄ (I2) Tank state Output L_OPEN Alarm L_ALM
0 0 Tank empty (both probes dry) 1 1
1 0 Water above L˅ only — fill in progress 1 1
1 1 Tank full (both probes immersed) 0 0
0 1 Transient / probe fault — fail-safe open 1 1

The output L_OPEN is implemented as a single FBD/AND-OR block:

L_OPEN = (NOT I1 AND NOT I2) OR (I1 AND NOT I2) OR (NOT I1 AND I2)

which simplifies to:

L_OPEN = NOT (I1 AND I2)

so a single NAND gate (block B012) or an AND gate followed by a NOT edge produces the flag. The alarm L_ALM is identical to L_OPEN.

6. Combined Valve Logic

The valve coil is energised (valve OPEN) when any of the three trip flags is active. The alarm lamp tracks the same condition.

Q1 (valve) = P_LOW OR T_HIGH OR L_OPEN

Q2 (alarm) = P_LOW OR T_HIGH OR L_OPEN

6.1 Ladder Equivalent (RSLogix-style mental model)

|  P_LOW   T_HIGH   L_OPEN            |
|──┤ ├─────┤ ├─────┤ ├────────( Q1 )──┤
|                                     |
|  P_LOW   T_HIGH   L_OPEN            |
|──┤ ├─────┤ ├─────┤ ├────────( Q2 )──┤

6.2 FBD Implementation in LOGO! Soft Comfort

  1. Insert three Analog Threshold Trigger blocks (B009) — one per sensor — wired to AI5, AI6 and the level inputs.
  2. Insert two OR blocks (B001) to combine the three flags into the valve and alarm rails.
  3. Route the OR outputs to Q1 and Q2.
  4. Place a self-latching RS flip-flop on the alarm rail if a manual acknowledge is required; reset with an HMI button mapped to a digital input or a network variable.

7. Web Server / LOGO! Web Editor

LOGO! 8.2 ships with two integrated web servers. The standard server mirrors the LOGO! display and allows cursor / F-key operation through virtual keys. The extended server lets you design your own screens with the LOGO! Web Editor tool and host them inside the LOGO! (see LOGO! 8.2 system manual, Section "Web server").

7.1 Enable the Web Server

  1. From LOGO! Soft Comfort: Tools → Ethernet Connections and assign the base module a static IP, e.g. 192.168.0.10, subnet 255.255.255.0.
  2. On the LOGO! display, navigate to Network → Web Server Access and enable Web server. Set the read/write password if required.
  3. Open a browser and enter http://192.168.0.10. The standard web server loads.

7.2 Build a Custom Screen

  1. Launch LOGO! Web Editor (separate installer included with LOGO! Soft Comfort V8.2).
  2. Create a new project; drag widgets onto the canvas: a numeric display bound to the scaled pressure value, another for temperature, and two status icons bound to L_OPEN and the combined alarm.
  3. Add three virtual lamps coloured green/red, one for each trip flag (P_LOW, T_HIGH, L_OPEN).
  4. Add a button widget bound to a flag M_ALM_ACK for alarm acknowledgement.
  5. Compile the project and upload it to the LOGO! over HTTP.

7.3 Operator Screens (Suggested Layout)

Widget Bound variable Function
Numeric readout, 1 decimal Pressure (scaled AI5) Live bar value
Numeric readout, 1 decimal Temperature (scaled AI6) Live °C value
Status icon (tank) L_OPEN Filling / full
Red beacon Q2 (alarm) Any trip active
Push-button M_ALM_ACK Acknowledge / reset latched alarm

8. Commissioning Procedure

  1. Verify wiring against the schematic; check polarity of the two current loops and confirm the AM2 DIP switches are in the 0/4–20 mA position.
  2. Apply 24 V DC; observe the LOGO! display powers up with no SF (system fault) LED.
  3. In LOGO! Soft Comfort, switch to Online → Simulation and force AI5 to 4 mA, AI6 to 4 mA; confirm Q1 and Q2 energise.
  4. Force AI5 to 8 mA (above 7 mA trip), AI6 to 4 mA; confirm Q1 drops when only the pressure trip is cleared.
  5. Dry both level probes; confirm Q1 energises. Immerse only L˅; confirm Q1 stays energised. Immerse both; confirm Q1 drops.
  6. Disconnect the LOGO! from the Soft Comfort cable and download the program to flash.
  7. Cycle power; confirm all states persist.
  8. Connect a PC to the LOGO! Ethernet port, open the standard web server at the configured IP, and verify the extended Web Editor project loads.

9. Verification Checklist

Test Acceptance criterion
Pressure = 0.5 bar (raw ≈ 240) Q1 = 1, Q2 = 1
Pressure = 1.5 bar (raw ≈ 320) Q1 follows temperature and level only
Temperature = 25 °C (raw ≈ 400) Q1 = 1, Q2 = 1
Temperature = 5 °C (raw ≈ 240) Q1 follows pressure and level only
Tank empty (both probes dry) Q1 = 1, Q2 = 1
Tank full (both probes immersed) Q1 = 0, Q2 = 0 (assuming pressure and temperature are within band)
Web editor custom screen Loads at <3 s; widgets update within 1 s of I/O change

10. Troubleshooting Matrix

Symptom Likely root cause Corrective action
Valve chatters rapidly Pressure oscillating around 7 mA; threshold hysteresis too small Increase the Off threshold gap in B009 from 3 to 8–10 counts; add a debounce timer (B014, 1 s)
Pressure reading stuck at 0 AM2 DIP switch in 0–10 V position, or loop not powered Set AM2 DIP to current; check transmitter supply and polarity
Pressure reading stuck at 1000 Input open-circuit; current loop not closed Verify the transmitter common is tied to AM2 GND; check for broken wire
L_OPEN flag stuck at 1 even with both probes immersed Wiring inverted (1 = dry convention used) Reverse the I1/I2 wiring or invert the inputs in the FBD
Web server unreachable Web server disabled in LOGO! menu, or wrong IP Re-enable Web server on the LOGO! display; ping the device; check subnet
Custom screen shows “page not found” Web Editor project not uploaded, or wrong slot Re-upload the project; verify the file is stored under the user project slot
Alarm lamp never turns off RS flip-flop latched; acknowledge flag not wired Wire M_ALM_ACK to the RS reset; add a button on the HMI
One trip ignored (e.g. temperature never trips) Threshold block wired to wrong AI or gain wrong Verify Sensor (S) parameter on B009 = AI6; check Gain (G) = 1; re-derive RAW_TRIP

11. Field-Proven Notes

  • Always include hysteresis on analog thresholds. A 3-count gap on a 12-bit signal is roughly 0.1 % of span — adequate for clean transmitters, too tight for noisy process lines. Start with 5–10 counts.
  • Use the LOGO! simulation in Soft Comfort before download. Force AI5 to integer 200, 250, 288, 300, 500, 800 and 1000 to confirm each trip flag toggles in the expected direction.
  • Fail-safe direction: because the valve is normally closed, a power loss to the LOGO! closes the valve. That is the safe state for both over-temperature and under-pressure events. Document this in the risk assessment.
  • AM2 ground reference: the AM2 isolated ground must be tied to the supply common at one point only. A floating ground produces noisy analog values, typically seen as random jumps of 5–10 counts.
  • Web server security: enable the password. The default user is LOGO; change it on first commissioning.
  • Don't overload the CPU web task: keep the custom screen under ~16 widgets; the LOGO! updates the page slowly when many widgets are bound.

12. Reference Documentation

What current loop value corresponds to the pressure trip on a 0–10 bar transmitter?

For a 0–10 bar transmitter the trip at 1.1 bar occurs at 7 mA. Convert to the LOGO! raw value with RAW = (1.1 × 800/10) + 200 = 288 counts. Set the B009 block On threshold to 288.

Why does the level logic use NOT (I1 AND I2) instead of a long OR chain?

The four states of two probes collapse to a single NAND expression because the only "valve closed" condition is both probes immersed. NOT (I1 AND I2) returns 1 for empty, partial and the impossible transient state, producing a fail-safe open output.

How do I expose scaled pressure on the LOGO! Web Editor?

Add an Analog Amplifier (B025) between AI5 and the threshold block, set Gain = 0.0125 and Offset = −2.5 (which compensates the 4 mA zero), then bind the amplifier output to a numeric widget in the Web Editor.

Can the AM2 expansion accept a 0–20 mA signal as well as 4–20 mA?

Yes. Set the AM2 DIP switch to the current position; the input is treated as 0–20 mA and the LOGO! converts it to 0–1000 raw. Use ZERO_RAW = 0 for 0–20 mA, or subtract 200 counts in software for 4–20 mA zero suppression.

What happens if the Ethernet cable is disconnected during web server operation?

The standard web server simply becomes unreachable; the LOGO! continues to execute the user program and drive Q1/Q2. The extended web editor screen does not affect control logic. Re-connect to restore monitoring.

Back to blog