Conditioning Inductive Sensor Signals for High-Speed PLC Counting Inputs
Counting flywheel teeth, encoder pulses, or shaft events at production line rates exposes a recurring problem in industrial control panels: the field device does not produce a signal that cleanly crosses the PLC's digital input thresholds. An inductive proximity sensor that swings between 12 V and 9 V on target detection looks digital on a multimeter, but a Siemens LOGO! 12/24 RCE high-speed input will never see a valid low level because the voltage never drops below the 5 V OFF threshold. The result is a counter that toggles slowly, misses events, or freezes entirely.
This article documents the root cause of that failure, the published Siemens LOGO! 12/24 RC / RCE and DM16 input specifications, the signal conditioning techniques that restore a usable pulse train, and the analog-threshold fallback that rescues installations where the sensor cannot be physically replaced. The same signal-chain analysis applies to CompactLogix, S7-1200, Click PLC, Productivity, and any other controller that exposes a finite list of high-speed inputs.
1. Problem Definition: 12 V to 9 V Swing on a 24 V High-Speed Input
The reported scenario:
- Sensor: 3-wire PNP inductive proximity sensor, normally 12 V output, drops to 9 V when a flywheel tooth enters the sensing field.
- Wiring: Sensor 12 V supply taken from the LOGO! 24 V rail. Signal wire routed to terminal I3.
- Controller: Siemens LOGO! 12/24 RC base module plus DM16 digital expansion (sixteen 24 V inputs).
- Behavior: I3 toggles, but the on-board high-speed counter undercounts the flywheel teeth. Hand-cranking the flywheel advances the counter, but at any meaningful shaft speed the count stalls.
The symptom is misleading because the input LED on the LOGO! does illuminate, so the technician concludes the wiring is sound and that the issue must be firmware, scan time, or a counter configuration bug. In practice the input LED is reacting to the residual noise or leakage rather than to a clean low transition, and the input filter on the LOGO! high-speed counter is rejecting the events it cannot fully debounce.
2. Root Cause Analysis
2.1 Why the LED Lights but the Counter Misses
The Siemens LOGO! 12/24 RC and 12/24 RCE datasheet, available from the Siemens Industry Online Support portal, defines the digital input thresholds for the 12/24 V variants as follows:
| Parameter | Symbol | Minimum | Typical | Maximum | Unit |
|---|---|---|---|---|---|
| OFF-state voltage (signal 0) | VIL | — | — | 5.0 | V DC |
| ON-state voltage (signal 1) | VIH | 12.0 | — | — | V DC |
| Sensor supply (out) | VSENS | — | 24 | — | V DC |
| Input current at 24 V | Iin | — | 5 | — | mA |
An inductive sensor that switches between 9 V and 12 V violates both edges of the spec. The voltage never falls below the 5 V VIL ceiling, so the LOGO! input conditioning circuit never discharges to a true logic 0. Depending on the internal hysteresis of the input Schmitt trigger, the input either sits in the indeterminate band, toggling on noise, or refuses to register at all.
2.2 High-Speed Counter Frequency Limits
The Siemens LOGO! high-speed counter is documented in the LOGO! Soft Comfort help system and in the LOGO! manual chapter on the high-speed counter function block. The base 12/24 RC and 12/24 RCE units expose four high-speed inputs (I3, I4, I5, I6) that can be used for the high-speed counter or frequency-counter function blocks. The published maximum counting frequency is:
| Input Group | Maximum Count Frequency | Filter Behavior |
|---|---|---|
| I1, I2 (analog / digital) | 4 Hz typical, 5 Hz max with typical filter | Heavy debounce, designed for pushbutton inputs |
| I3, I4 (high-speed, on base) | 3 kHz | Reduced debounce; cannot be removed entirely |
| I5, I6 (high-speed, on base) | 3 kHz | Same as I3/I4 |
| I7…I12 on DM8 / DM16 expansion | Normal filtered, 5 Hz typical | Not usable for HSC |
These limits are hardware-implemented inside the LOGO! ASIC and cannot be increased by configuration. Even a perfect square wave at 5 kHz will undercount on a LOGO! high-speed input because the counter logic simply cannot resolve the transitions.
2.3 Why an Analog Input Does Not Solve It Directly
LOGO! 12/24 RC and RCE base modules expose I1 and I2 as dual-function inputs that can be configured as 0–10 V analog inputs. The temptation is to wire the inductive sensor into I1 or I2, configure an analog threshold trigger, and call the counter a software construct. This works in theory, but the analog channel sample rate on the LOGO! is in the low kilohertz range at best, the comparator introduces additional latency, and the analog threshold function block does not generate the same kind of hysteresis-debounced event the high-speed counter needs. The correct place for the analog approach is a controller with a dedicated high-speed analog-to-digital converter such as the Omron NX-HAD[][][] high-speed analog input unit (product page) or a National Instruments NI-9238 / NI-9239 C-series module (NI catalog).
3. Solution Architecture
There are three viable paths to recover reliable counting. They are listed in order of preference for typical field service work.
3.1 Path A — Replace the Sensor with a True Push-Pull Output
The cleanest fix is to install a 3-wire PNP inductive sensor whose output swings rail-to-rail (for example, between 0 V and 24 V). Common industrial part numbers such as the Sick IME12 series, the Balluff BES M12 series, the Pepperl+Fuchs NBB2-12GM50-E2, or the Turck BI4-M12 will all toggle a LOGO! high-speed input cleanly when correctly wired. Verify on the sensor data sheet:
- Output type: PNP normally-open, voltage switching (not current sinking, not 2-wire AC).
- Load current rating: at least 50 mA to drive the LOGO! input plus any indicator LED.
- Switching frequency: 1 kHz or higher for flywheel tooth counting.
- Voltage drop at rated load: 2.5 V or less (so VOL ≤ 2.5 V is well below the LOGO! 5 V threshold).
3.2 Path B — Add an Inverting Signal Conditioner
If the existing inductive sensor cannot be replaced, install an isolating amplifier or a discrete inverting stage between the sensor and the LOGO! input. The forum report that initiated this article describes exactly this approach, using a Weidmuller WAVESERIES universal isolating amplifier to convert the 9 V–12 V swing into a clean 0 V–24 V push-pull signal. RS-Online part number 499-740 is one example; equivalent devices include Phoenix Contact MINI MCR, Wago 857, and Siemens 3RS17 signal converters.
A discrete alternative uses a single NPN transistor with a 10 kΩ pull-up to 24 V on the collector and a base network sized from the sensor output:
+24 V ----[ 10 kΩ ]----+---- PLC input I3
|
C (NPN, e.g. BC547)
|
E ---- GND (LOGO! ground)
Sensor output --[ 47 kΩ ]-- B
When the sensor is at 12 V (idle), the base-emitter junction is reverse-biased and the transistor is off, so the PLC input is pulled to 24 V (logic 1). When the sensor drops to 9 V (tooth present), the base is still above the emitter by enough to keep the transistor saturated, so the PLC input is pulled to ~0.2 V (logic 0). The transition is sharp, fully rail-to-rail, and well within the LOGO! 5 V / 12 V thresholds.
3.3 Path C — Analog Threshold with a Faster Controller
If the application demands an analog-input approach because the sensor is fundamentally a variable-reluctance device (VR sensor) that outputs a sine wave rather than a square wave, upgrade to a controller that supports high-speed analog acquisition. Options include:
- Omron NX-HAD[][][] high-speed analog input unit, 8 channels, 50 kS/s/ch (Omron catalog).
- National Instruments NI-9238 (±500 mV, 50 kS/s/ch, 24-bit) or NI-9239 (±10 V, 50 kS/s/ch) C-series modules (NI catalog).
- Texas Instruments ADS868x-based analog input front-end, suitable for PLC backplanes, 500 kS/s, integrated multiplexer (TI SLOA288 reference design).
These platforms all support a software-defined threshold trigger with sample-by-sample comparison, which produces a deterministic, low-latency counting event without depending on a digital Schmitt trigger at the I/O terminal.
4. Siemens LOGO! HSC Implementation Reference
Once the signal is properly conditioned, configure the high-speed counter in LOGO! Soft Comfort. The HSC function block lives in the Special Functions library.
4.1 Function Block Parameters
| Parameter | Description | Typical Value for Flywheel Counting |
|---|---|---|
| Input | Count source | I3 (high-speed input) |
| Direction | Count-up or count-down gate | Count-up only |
| Reset | Edge-triggered reset | M1 (manual reset pushbutton) |
| On threshold | Output Q turns on at count | Set to number of teeth per revolution, e.g. 30 |
| Off threshold | Output Q turns off | Set to 0 (output stays on until reset) |
| Start value | Initial counter value | 0 |
4.2 Sample Ladder Logic Snippet
| I3 (high-speed) ----[ HSC ]--- ( Q1 )
| |
| +--- to RPM scaling block
|
| B001 (reset pulse) ---[ R ]---| HSC.RESET |
To convert the tooth count into RPM, divide by the number of teeth per revolution and then by the gate time. A 1-second gate gives RPM directly:
RPM = ( HscValue * 60 ) / Teeth_per_rev / GateTime_seconds
5. Step-by-Step Commissioning Procedure
- Disconnect the inductive sensor from the LOGO! input terminal.
- Connect an oscilloscope or a logic analyzer to the sensor output. Confirm the actual peak-to-peak voltage swing at the sensor output under no-load and loaded conditions. Record the rise and fall times.
- If the swing is less than 10 V or the low level is above 5 V, the sensor is not suitable for direct connection. Stop here and proceed to step 4.
- Install a signal conditioner (Path B) or replace the sensor with a rail-to-rail output device (Path A). Repeat the measurement at the LOGO! input terminal to confirm a clean 0 V to 24 V swing.
- Download a minimal LOGO! program to the controller that wires I3 directly to a high-speed counter block and to a free output (Q1) so the LED indicates every detected tooth.
- Crank the flywheel by hand at approximately 1 rev/s. Confirm the counter increments by exactly the number of teeth per revolution per second. Use a thumb on a separate reference input to validate the count visually.
- Drive the flywheel with a calibrated motor at known RPM. Compare the LOGO! display to a handheld tachometer. Acceptable error is ±1 count per gate interval.
- Document the wiring diagram, sensor part number, signal conditioner part number, and the verified maximum RPM on the panel schematic.
6. Verification and Acceptance Test
The installation is accepted only after the following checks pass:
| Check | Expected Result | Pass Criterion |
|---|---|---|
| Sensor output voltage, idle | 24 V (or within 0.5 V of supply) | ≥ 22 V |
| Sensor output voltage, tooth present | ≤ 2 V DC | ≤ 5 V (LOGO! VIL) |
| Edge rise time at LOGO! terminal | ≤ 10 µs | ≪ 1 / max count frequency |
| Edge fall time at LOGO! terminal | ≤ 10 µs | Same |
| LOGO! input LED indicator | Tracks sensor output 1:1 at hand speed | Visible blink on every tooth |
| HSC count at 60 RPM, 30-tooth wheel | 30 counts per second | 30 ± 1 / s |
| HSC count at 1500 RPM, 30-tooth wheel | 750 counts per second | 750 ± 5 / s |
| HSC count at 3000 RPM, 30-tooth wheel | 1500 counts per second | 1500 ± 10 / s (must stay below 3000 Hz limit) |
7. Troubleshooting Matrix
| Symptom | Likely Cause | Diagnostic Action | Corrective Action |
|---|---|---|---|
| Input LED never lights | Sensor wired to wrong terminal, sensor supply missing | Measure supply voltage at sensor terminal | Restore 24 V supply to sensor V+ terminal |
| Input LED on solid, no count | Sensor stuck at logic 1, no transition | Measure sensor output while passing a target | Verify sensor has voltage drop on detection |
| Input LED flickers, count undercounts | Voltage swing too small (12 V → 9 V) | Scope sensor output under load | Install signal conditioner or replace sensor |
| Count correct at hand speed, wrong at motor speed | Frequency above 3 kHz LOGO! limit | Compute events/sec from RPM × teeth | Reduce tooth count, gear ratio, or upgrade controller |
| Count correct, RPM calculation wrong | Gate time, scaling constant mis-set | Compare displayed RPM to handheld tach | Apply RPM = (Count × 60) / Teeth / GateTime |
| Counter resets spontaneously | Wiring noise on reset input | Scope reset input | Add RC filter, shielded cable, or debounce |
| Count drifts on long runs | EMI from VFD on sensor cable | Disconnect VFD and re-test | Use shielded twisted pair, ground shield one end |
8. Frequency Math Worked Example
Given a flywheel with 30 teeth rotating at 1800 RPM:
Events per second = (1800 / 60) × 30 = 900 Hz
This is well below the 3 kHz high-speed counter limit of the LOGO! and within the 5 Hz–500 kS/s range of typical analog input cards. For a higher-speed spindle at 12000 RPM with 60 teeth:
Events per second = (12000 / 60) × 60 = 12000 Hz = 12 kHz
This exceeds the LOGO! 3 kHz ceiling. The application must use either a faster controller (S7-1200 HSC supports up to 200 kHz on the SB1221 HSC board, see the Siemens S7-1200 system manual), a dedicated signal conditioner with frequency divider, or a coarser gear ratio so that events per second falls inside the controller envelope.
9. Cross-Platform Reference Table
| Controller | HSC Inputs | Max HSC Frequency | Analog Input Sample Rate |
|---|---|---|---|
| Siemens LOGO! 12/24 RCE | I3, I4, I5, I6 | 3 kHz | 1 kS/s on I1, I2 |
| Siemens S7-1200 + SB1221 | DI a, DI b, DI c | 200 kHz | 100 kS/s on SM 1231 |
| Allen-Bradley MicroLogix 1400 | I0-3, I0-4, I0-5 | 100 kHz | — (no analog inputs on CPU) |
| Allen-Bradley CompactLogix 5380 | Any DI on local rack | Configurable to 1 MHz with DI modules | 5069-IF8 has 1 kS/s |
| AutomationDirect Productivity 2000 | First 4 DIs | 100 kHz (with HSC module) | 50 kS/s on analog module |
| Click PLC (AutomationDirect) | X1-X6 high-speed | 100 kHz | 10 kS/s on analog module |
| Omron NX-HAD[][][] | Analog only, no HSC | N/A | 50 kS/s/ch, 8 ch, 16-bit |
| National Instruments NI-9238 | 4-ch voltage | N/A | 50 kS/s/ch, 24-bit, ±500 mV |
| Texas Instruments ADS868x-based module | 8-ch voltage | N/A | 500 kS/s aggregate |
10. Field-Proven Caveats
11. Glossary
- PNP (sourcing) sensor: Switches the load to the positive supply rail when active. Compatible with PLC inputs that source current into the input terminal.
- NPN (sinking) sensor: Switches the load to ground when active. Compatible with PLC inputs that sink current to ground.
- HSC (high-speed counter): A counter function block in the PLC firmware that bypasses the normal scan-time input filtering and resolves edges in hardware.
- VR (variable reluctance) sensor: Magnetic sensor that produces a sine wave whose amplitude varies with tooth position; requires a signal conditioner with a comparator or a high-speed ADC.
- Isolating amplifier: A signal conditioner with galvanic isolation between input and output, typically 1.5 kV to 4 kV AC, used to break ground loops and to convert voltage ranges.
What voltage swing does a Siemens LOGO! 12/24 RC digital input require?
The 24 V variants require a signal 0 below 5 V DC and a signal 1 above 12 V DC. An inductive sensor that switches between 12 V and 9 V never crosses the 5 V low threshold, so the input never registers a true off state and the high-speed counter cannot debounce the events.
What is the maximum counting frequency of the LOGO! high-speed inputs?
The I3, I4, I5, and I6 high-speed inputs on the LOGO! 12/24 RC and 12/24 RCE base modules are rated for 3 kHz maximum. Normal I1, I2, and expansion inputs are limited to 5 Hz because of their input filtering. For higher frequencies use an S7-1200 with the SB1221 high-speed counter board (up to 200 kHz) or a dedicated counter module.
Can I use an analog input on the LOGO! to count flywheel teeth instead?
Technically yes, by configuring I1 or I2 as a 0–10 V analog input and using an analog threshold trigger, but the LOGO! analog sample rate is too low to reliably debounce high-frequency edges. The analog-threshold approach is only practical on controllers that expose high-speed ADC channels, such as the Omron NX-HAD[][][] at 50 kS/s/ch or the National Instruments NI-9238 at 50 kS/s/ch.
Why does the LOGO! input LED illuminate even when the counter misses pulses?
The LED is driven from the input conditioning circuit with reduced hysteresis compared with the counter logic. When the sensor signal sits in the indeterminate band between VIL and VIH, the LED reacts to noise and stray coupling, but the high-speed counter logic correctly rejects the events because they fail the debounce check. The LED is not a reliable indicator of usable counting edges.
What is the simplest signal conditioner for a 9 V to 12 V inductive sensor output?
A single NPN transistor (BC547 or equivalent) with a 10 kΩ pull-up to 24 V on the collector and a 47 kΩ base resistor from the sensor output converts the 9 V–12 V swing into a clean 0.2 V–24 V push-pull signal. For galvanic isolation use a commercial module such as the Weidmuller WAVESERIES or Phoenix Contact MINI MCR universal isolating amplifier instead of a discrete transistor stage.