LOGO! 8 0BA8 Water Flow Sensor: Wiring and Pulse Counting Setup

David Krause16 min read
I/O ModulesSiemensTutorial / 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: Water Flow Sensing with Siemens LOGO! 8 (0BA8)

Hall-effect water flow sensors output a digital pulse train whose frequency is proportional to instantaneous flow. Siemens LOGO! 8 (generation 0BA8) controllers can count these pulses and convert them into engineering units such as liters per minute and totalized volume, but only when the sensor is wired to one of the four dedicated high-speed digital inputs I3, I4, I5, or I6. Standard inputs I1, I2, I7, and I8 are debounced to 4 Hz and will silently miss any pulse train above that rate, which is the most common commissioning failure on this platform. The LOGO! 8 system manual (07/2016 edition, document A5E33039675) explicitly notes that the fast counter inputs function only operates when the input is connected directly to the counter or threshold-switch input with no intervening logic gates.

This reference covers the end-to-end commissioning of a typical 24 V Hall-effect flow sensor (the example used here produces 263 pulses per liter with a maximum output frequency of 110 Hz) on a LOGO! 12/24 RCE, LOGO! 12/24 RCEo, or LOGO! 12/14 RCEo base unit. It includes the pull-up resistor selection, the wiring diagram, the LOGO! Soft Comfort program topology, the K-factor flow calculation, and a troubleshooting matrix for the most common field issues.

Prerequisites and Compatible Hardware

Item Specification Notes
LOGO! base unit 0BA8 generation: 12/24 RCE, 12/24 RCEo, or 12/14 RCEo Only 0BA8 provides the high-speed counter inputs on I3-I6; verify the device label.
Power supply 10.8 to 28.8 V DC (12/24 RCE variants) Document A5E33039675, chapter on supply voltage.
LOGO! Soft Comfort Version 8.0 or later Required for the 0BA8 function block library.
Flow sensor Hall-effect, NPN open-collector or push-pull output, 2.4 to 26 V supply Sensor supply must remain within its rated range; 24 V DC is the typical operating point.
Pull-up resistor 2.2 to 2.4 kΩ, ≥ 0.25 W (0.5 W preferred) Mounted between +24 V and the signal input at the LOGO! terminal.
Wire Shielded 3-conductor, 22-24 AWG Shield grounded at the LOGO! end only.
Critical: A 0BA6 or 0BA7 LOGO! does not have the high-speed counter inputs on I3-I6 the same way. Always confirm the device label reads 0BA8 before assuming I3-I6 will count above 4 Hz.

LOGO! 8 0BA8 Input Architecture and High-Speed Counters

The 0BA8 base unit exposes eight digital inputs on the terminal block. Siemens partitions these by purpose rather than by hardware filter alone:

Input Type Maximum pulse frequency Usable function blocks
I1, I2 Standard digital 4 Hz General logic, threshold switch (level)
I3, I4, I5, I6 High-speed counter 5 kHz Up/Down counter, Threshold trigger (frequency), High-speed counter
I7, I8 Standard digital (analog-capable on RCE/RCEo) 4 Hz General logic, analog input on AI1/AI2

The 4 Hz ceiling on the standard inputs is enforced by the LOGO! input filter, not by the sensor. Even a perfect 1 kHz square wave applied to I1 will be sampled as a constant level. A 110 Hz flow sensor therefore must be wired to I3, I4, I5, or I6.

The fast counter function is also gating-sensitive: any logic gate, NOT, AND, OR, or contact between the I3-I6 terminal and the counter or threshold-switch input disables the fast path. The wire must be a direct connection in the function block diagram.

Sensor Selection and Electrical Interface

The example sensor is a three-wire Hall-effect flow meter with a brown (V+), black (signal), and blue (GND) lead. Its electrical envelope, per the manufacturer datasheet, is:

Parameter Value
Supply voltage 2.4 to 26 V DC
Output type NPN open-collector (sinking)
Output low current ≤ 25 mA (typical 10 mA)
K-factor 263 pulses / liter (example)
Maximum output frequency 110 Hz (≈ 25 L/min)
Output saturation voltage ≤ 0.5 V at 10 mA

Because the output is open-collector, the signal line idles high-impedance when the transistor is OFF. Without a pull-up, the LOGO! input will float and count noise. The pull-up establishes the high logic level when the transistor releases the line.

Polarity check: Before applying power, confirm the brown wire is +V and the blue wire is GND with a multimeter. A common commissioning error is to swap the supply leads on a Chinese-market sensor, which results in a permanently low output and zero counts. An oscilloscope or logic probe on the signal lead should show a clean 0-24 V square wave; if the scope shows a negative voltage (e.g., -14 V), the supply is reversed or the sensor is mis-wired.

Pull-Up Resistor Selection and Calculation

For an NPN open-collector sensor at 24 V DC, the pull-up resistor RPU sets two things: the logic-high voltage at the LOGO! input, and the sink current through the sensor's output transistor. The trade-off is straightforward:

  • Smaller R → faster rising edges, higher noise immunity, higher sink current (heats the sensor output transistor).
  • Larger R → lower current, slower edges, more susceptible to capacitive coupling and EMI.

The minimum resistance is set by the sensor's maximum sink current rating. The maximum resistance is set by the LOGO! input's bias current and the desired switching speed. A practical compromise for a 24 V supply with a 10 mA-class sensor output:

RPU Sink current at VOL ≤ 0.5 V Power dissipation Recommended rating
1.0 kΩ ≈ 24 mA 0.58 W 1 W
2.2 kΩ ≈ 10.7 mA 0.26 W 0.5 W (preferred)
2.4 kΩ ≈ 9.8 mA 0.24 W 0.5 W
4.7 kΩ ≈ 5.0 mA 0.12 W 0.25 W
10 kΩ ≈ 2.4 mA 0.06 W 0.25 W

Power dissipation in the resistor is P = V² / R = 24² / 2200 = 0.262 W at the worst case (sensor OFF, full 24 V across R). A 0.5 W part gives a 2× derating margin and is the right choice. A 0.25 W part is acceptable in cool enclosures but derates to about 0.15 W above 70 °C, so it is the lower bound.

The accepted field value for this sensor class is 2.2 kΩ to 2.4 kΩ at 0.5 W. This produces roughly 10 mA of sink current, well below the 25 mA sensor limit, and a 24 V high level at the LOGO! input (the LOGO! 24 V input threshold is typically 11-12 V for a guaranteed high).

Wiring the Sensor to High-Speed Inputs

Connect the sensor as follows. Use one of I3, I4, I5, or I6; I6 is conventional because it is the rightmost input and keeps the wiring short.

LOGO! 8 0BA8 base +24V 0V I1 I2 I3..I6 (Hi-Spd) I6 (used) I7 I8 Pull-up R 2.2 kΩ / 0.5 W Flow sensor brown V+ black sig blue GND +24V from LOGO! power terminal — pull-up to signal — signal to I6 — sensor GND to LOGO! 0V.

Wire list:

  1. Brown (V+) → LOGO! +24 V supply terminal.
  2. Blue (GND) → LOGO! 0 V supply terminal.
  3. Black (signal) → LOGO! input I6.
  4. Pull-up resistor 2.2 kΩ → between LOGO! +24 V and I6 terminal, mounted as close to the LOGO! terminals as practical.
Shielding: For runs longer than 2 m, use a shielded 3-conductor cable with the shield bonded to the LOGO! 0 V at the LOGO! end only. Leave the sensor-end shield floating. This prevents ground loops while still shunting capacitive noise.

Configuring the Counter and Threshold Trigger in LOGO! Soft Comfort

Open LOGO! Soft Comfort and build the program in FBD. The canonical topology for flow measurement is:

I6 Hi-Spd Threshold Trigger (f) Up Counter B001 Arithmetic x60/263 Display / AQ Sensor Level detect Totalize Scale to L/min

Block-by-block configuration:

  1. Threshold trigger (frequency mode) — Place from the Special → Threshold trigger library. Set the switching threshold On to a value just below the sensor minimum frequency, e.g. f_on = 1 Hz for a 1 L/min minimum. Set Off to 0 Hz. The block output goes high when the measured frequency exceeds the on-threshold and is useful both as a "flow present" flag and to drive the counter enable.
  2. Up/Down counter — Place from Special → Counter. Wire the threshold-trigger output to the counter Enable input, and wire I6 directly to the counter Cnt input with no logic in between. Set the threshold value to a high number (e.g. 999999) so the counter does not roll over; you will reset it from the LOGO! display or a digital input. The counter output QV is the live pulse count.
  3. On-delay / Off-delay for rate calculation — To convert pulses-per-window into pulses-per-minute, the program samples the counter every Δt = 1 s and computes the delta, then multiplies by 60. A common pattern is a 1 s pulse generator (using the asynchronous pulse generator Special → Asynchronous pulse generator) wired to latch and read the counter.
  4. Arithmetic block — Place from Special → Arithmetic. Apply the formula Flow [L/min] = (Δpulses / Δt [s]) × 60 / 263. The arithmetic block accepts constants and operands; the constant 60/263 ≈ 0.2281 is entered as a single gain G, and the divisor Δt is entered separately if Δpulses is in pulses/sec.
  5. Analog amplifier — Optional, used to scale the per-minute value into a 0-1000 display range or to convert it to a 0-10 V analog output on AQ for an external meter.

The full download-ready project is conventionally named flow_V3 on the Siemens support forum reference project and is a useful starting point, but the program must be adapted to the local K-factor (263 pulses/L in this example).

Flow Rate Calculation with K-Factor

The K-factor of a flow sensor is the number of pulses it produces per unit volume, expressed in pulses per liter (pulses/L) or pulses per gallon. For the example sensor:

K = 263 pulses/L

The instantaneous flow rate Q in L/min is related to the pulse frequency f in Hz (pulses/second) by:

Q [L/min] = f [Hz] × 60 / K

For K = 263:

Q [L/min] = f × 0.2281

Some reference points:

Flow Q (L/min) Frequency f (Hz) Period T (ms)
0.5 2.19 456.0
1.0 4.38 228.0
5.0 21.9 45.6
10.0 43.8 22.8
20.0 87.7 11.4
25.1 110.0 (max) 9.1

The 110 Hz maximum corresponds to about 25.1 L/min for this sensor. The LOGO! high-speed inputs can count to 5 kHz, so the sensor (not the LOGO!) is the limiting element.

For totalization, the LOGO! counter B001 accumulates the raw pulse count. The volume V in liters is simply:

V [L] = B001 / 263

If B001 is implemented as a 32-bit counter (which is the default in LOGO! 8 for the high-speed counter function), the totalizer wraps at 2,147,483,647 pulses, which is 8.16 million liters — adequate for any practical installation. For higher total ranges, scale the K-factor in the arithmetic block or use the LOGO!'s retentive memory to preserve the count across power cycles.

Totalizer and Engineering Unit Scaling

The counter's raw value is dimensionless. Two derivations are needed in practice:

  1. Instantaneous rate for trend or control — converted from pulses-per-second to L/min via the arithmetic block above.
  2. Totalized volume for billing or batch — the counter itself can be read directly; the LOGO! display or a connected HMI divides by 263 to show liters.

For a remote HMI (LOGO! TDE or a Modbus master), expose the counter value and the computed rate on the network. The LOGO! 8 with the Ethernet port (RCE and RCEo variants) supports Modbus TCP server on port 502. Map the following variables:

Modbus register LOGO! variable Type Scale
40001 B001 (raw pulse count) UINT32 1 pulse = 1 / 263 L
40003 Flow rate computed value INT16 1 unit = 0.1 L/min
40004 Flow present flag BOOL 1 = flow above threshold
40005 Sensor fault flag BOOL 1 = timeout (no pulses for > 60 s while pump running)

Verification and Field Commissioning

Follow this verification sequence on first power-up:

  1. Scope check. With the sensor wired and the LOGO! unpowered or in stop mode, attach an oscilloscope or logic probe to the I6 terminal. Run a known flow and confirm a clean 0-24 V square wave with the expected frequency. If the scope shows a negative excursion (e.g. -14 V), the sensor supply is reversed.
  2. Threshold trigger test. Run the LOGO! in online mode and monitor the threshold trigger (frequency) block. With a known flow of 10 L/min, the block should report f ≈ 43.8 Hz.
  3. Counter test. Monitor B001 for 60 seconds at a known constant flow. The delta in B001 divided by 60 should equal the expected pulse frequency. For 10 L/min, expect 2630 pulses per minute.
  4. Rate calculation test. Verify the arithmetic block output against a reference flow meter at three points: low (≈ 1 L/min), mid (≈ 10 L/min), and high (≈ 20 L/min). The reading should be within the sensor's stated accuracy (typically ±5% for Hall-effect flow sensors in this class).
  5. Retentivity test. Power-cycle the LOGO! and confirm that the totalizer value is preserved. If the counter resets to zero, the block parameter "Retentive" is not set; enable it in the block properties dialog.
  6. Long-run drift test. Run a known volume (e.g. 10 L from a graduated container) through the sensor and confirm the totalizer increment matches within sensor tolerance. This catches K-factor misentries and air-bubble errors in one step.

Troubleshooting Matrix

Symptom Likely cause Diagnostic Corrective action
Counter reads zero, no pulses counted Sensor wired to I1, I2, I7, or I8 Check terminal assignment Move signal lead to I3, I4, I5, or I6
Counter reads zero, no pulses counted Pull-up resistor missing Measure signal lead with meter; should sit at 24 V when idle Install 2.2 kΩ pull-up between +24 V and signal
Counter reads zero, no pulses counted Logic between I6 and counter Cnt input Inspect FBD in Soft Comfort Remove any NOT, AND, OR, or contact between I6 and the counter Cnt input
Counter reads 0 or random when no flow Floating input, no pull-up Voltage on signal lead at rest Install pull-up; check shield ground
Counter increments at exactly half the expected rate Counter wired to I1-I2 with debounce filter Check input assignment Move to I3-I6
Counter increments but reading is too low by a constant factor K-factor mis-entered Compare LOGO! gain to sensor datasheet K Correct arithmetic gain; for K=263 use 60/263 ≈ 0.2281
Counter drifts upward even with no flow EMI pickup on long unshielded cable Inspect cable routing next to VFD or contactor Replace with shielded cable; bond shield to LOGO! 0 V only
Counter resets on power cycle Retentivity not enabled on counter block Inspect block properties Set "Retentive = On" on the counter parameter set
Scope shows -14 V on signal lead Sensor supply reversed (brown and blue swapped) Check brown = V+, blue = GND with meter Swap supply leads
Reading oscillates ±10% at constant flow Sampling window too short in rate calculation Inspect arithmetic block input Increase averaging time to 5-10 s
Counter saturates or wraps unexpectedly 32-bit overflow on very long runs Check B001 value At 100 L/min continuous, wrap occurs after ≈ 56 years; usually not the issue, but verify K-factor scaling
Display shows "--- " or block reports invalid LOGO! 0BA7 or older firmware in use Read device label Replace with 0BA8; high-speed counters require 0BA8 firmware

Field-Notes and Caveats

  • Do not place logic between the input terminal and the counter. This is the single most common reason a high-speed counter "doesn't work" on the LOGO! 8. The fast path is hardware and is broken by any contact or gate in the FBD. This is explicitly called out in the LOGO! 8 system manual chapter on counters.
  • Logo! 12/14 RCEo is the 0BA8 part number used in the reference build. It has relay outputs, so be aware that the analog output AQ is not available; use Modbus or the on-board display for indication.
  • Sensor supply must stay within the sensor's rated range (typically 2.4 to 26 V DC for the example Hall-effect meter). The LOGO! 12/24 RCE supply is rated 10.8 to 28.8 V DC, so the LOGO! rail is well within the sensor's envelope and no separate regulator is needed.
  • K-factor accuracy — Hall-effect flow sensors in this class are typically ±5% to ±10% out of the box. For custody-transfer or billing, calibrate against a reference meter and store the calibrated K-factor in the LOGO! as a constant. The 263 pulses/L value is nominal and should be verified for the specific sensor in use.
  • Bubble sensitivity — Air in the line will cause the impeller to spin faster than the water flow warrants, producing a high reading. Install the sensor in a vertical pipe with upward flow to keep air from collecting in the measurement chamber, or use a de-bubble strategy in software (e.g. clamp the rate to a maximum).

Related Siemens Documentation

For deeper background, the following official Siemens documents are the authoritative references for the topics in this article:

  • LOGO! 8 (0BA8) System Manual, 07/2016 edition, A5E33039675 — the canonical reference for input architecture, supply ratings, and the high-speed counter restrictions discussed here. Page 328 (in the cited edition) covers the supply voltage range of 10.8 to 28.8 V DC for the 12/24 RCE variants and the sensor supply limits of 2.4 to 26 V DC.
  • Siemens LOGO! product page — current part numbers, 0BA8 vs 0BA9 differences, and ordering information for the LOGO! 12/24 RCE, 12/24 RCEo, and 12/14 RCEo base units.
  • Siemens Industry Online Support — for firmware updates to LOGO! Soft Comfort and the LOGO! base unit; some 0BA8 behavior changed between firmware 8.0 and 8.3, so confirm the firmware version on the device label before applying program changes.
  • Analog Devices Pulse Counter reference — a manufacturer-published primer on the general theory of pulse counting and time-base gating, useful for engineers new to the technique.

Frequently Asked Questions

Why are my pulses not being counted on the LOGO! 8 0BA8 even though the sensor has power?

The most common cause is that the sensor signal is wired to I1, I2, I7, or I8, which are debounced to 4 Hz on the 0BA8. Move the signal lead to I3, I4, I5, or I6. The second most common cause is a missing or wrong-value pull-up resistor on the open-collector output, or any logic block placed between the input and the counter Cnt input — the high-speed path requires a direct connection.

What value of pull-up resistor should I use for a 24 V Hall-effect flow sensor?

Use 2.2 kΩ to 2.4 kΩ at 0.5 W. This produces about 10 mA of sink current at the sensor output (well below the typical 25 mA rating) and a clean 24 V high level at the LOGO! input. Smaller values (1 kΩ) work but waste power; larger values (10 kΩ) slow the rising edge and make the input more susceptible to noise.

Can I use a standard digital input (I1, I2, I7, I8) for a flow sensor that pulses slowly?

Only if the pulse rate stays below 4 Hz, which corresponds to about 0.9 L/min with a 263 pulses/L sensor. For any practical flow measurement above 1 L/min, you must use I3, I4, I5, or I6, which can count to 5 kHz on the 0BA8.

How do I convert 263 pulses per liter to a flow rate in L/min?

Use Q [L/min] = f [Hz] × 60 / 263, where f is the measured pulse frequency in pulses per second. Equivalently, Q = f × 0.2281. For totalized volume, divide the raw counter value B001 by 263. If your sampling window is Δt seconds, the arithmetic block computes (ΔB001 / Δt) × 60 / 263.

My totalizer resets every time the LOGO! powers down. How do I keep the count?

Open the counter block properties in LOGO! Soft Comfort and set Retentive = On. The LOGO! 8 stores retentive values in non-volatile memory, so the totalizer is preserved across power cycles. The maximum count is 2,147,483,647 pulses, which is over 8 million liters at 263 pulses/L.

My flow reading drifts by ±10% even at constant flow. How do I improve the accuracy?

Three things to check: (1) extend the averaging time in the rate calculation to 5-10 seconds; (2) confirm the K-factor matches the specific sensor, not a nominal value from a generic datasheet; (3) verify the sensor is full of water with no air bubbles, which is the most common cause of high-frequency reading oscillation in Hall-effect meters.

Back to blog