Problem Overview
The application is a coin-operated kWh dispenser built around a Siemens LOGO! 230RC logic module. The intended operating sequence is:
- User inserts a coin (digital input
I1). - User presses a start button (digital input
I3), which energises outputQ2to close a contactor feeding the load. - A single-phase electricity meter downstream of the contactor produces a pulse on its S0 output for every fraction of a kWh consumed.
- The pulse is wired to digital input
I8of the LOGO!. An Up/Down Counter function blockB030accumulates these pulses. - When the count reaches the preset threshold, the counter resets,
Q2de-energises, and the supply to the load is disconnected.
Fault symptom: the program runs correctly in LOGO! Soft Comfort simulation, but on the real 230RC hardware the counter never increments. I8 measures a clean 27 V DC pulse train with a multimeter, yet the B030 counter CV (current value) tag stays at zero and Q2 never releases. The simulation tab shows the counter advancing normally when I8 is toggled, which makes the issue appear to be a programming error and is why it is so commonly reported.
Root Cause: Input Voltage-Level Mismatch
The Siemens LOGO! 230RC is designed for 230 V AC control circuits. Its digital inputs are conditioned to recognise an "OFF" state for voltages below a low threshold (around 40 V AC) and an "ON" state only when the input voltage exceeds the high threshold (79 V AC and above, up to 264 V AC, 47 - 63 Hz). The pulse output of the electricity meter, however, is a 27 V DC signal conforming to the S0 interface specification. Twenty-seven volts is below the 230RC's guaranteed "ON" threshold, so the input never registers a transition and the counter never increments.
The 230RC inputs are not a logic-level interface. They are AC mains-rated inputs with substantial hysteresis for noise rejection on long field wiring. The 27 V DC signal from the meter pulse is, in effect, treated as a floating or stuck-low input.
This is not a programming error and not a hardware fault on the LOGO! itself. The program, when downloaded, is exactly what was simulated. The fault is in the selection of the controller variant for the input signal level that is actually present at the terminal: a 24 V DC logic pulse cannot drive a 230 V AC input, regardless of how cleanly the program is written.
LOGO! 230RC vs LOGO! 12/24RC Specification Comparison
| Parameter | LOGO! 230RC | LOGO! 12/24RC / 24RC |
|---|---|---|
| Power supply | 115 / 230 V AC | 12 / 24 V DC (12/24RC) or 24 V DC (24RC) |
| Digital input type | 230 V AC, bi-directional | 24 V DC, sourcing (positive switching) |
| Input "1" threshold (typ.) | ≥ 79 V AC | ≥ 12 V DC (12/24RC) / ≥ 14 V DC (24RC) |
| Input "0" threshold (typ.) | ≤ 40 V AC | ≤ 5 V DC |
| Max input voltage | 264 V AC | 28.8 V DC |
| Switching frequency (typical) | ≤ 4 Hz at 230 V AC | ≤ 5 kHz at 24 V DC (high-speed on I7, I8) |
| Outputs | Relay, 10 A, AC-15 2 000 VA | Relay, 10 A, AC-15 2 000 VA (R variants) |
| Typical catalog (LOGO! 8) | 6ED1052-1FB08-0BA1 (230RCE) | 6ED1052-1MD08-0BA1 (12/24RCE), 6ED1052-1HB08-0BA1 (24RCE) |
| Compatible with 27 V meter pulse | No | Yes |
Refer to the Siemens Industry Online Support entry for the LOGO! 8 system manual (search for 6ED1050-1xx08) for the full input electrical specifications, including any derating that applies at temperatures outside the 0 - 55 °C operating range. The Siemens LOGO! product page lists the current 12/24V and 230V catalog variants and their part numbers.
Understanding the S0 Pulse Output Interface
Most modern kWh electricity meters expose a passive pulse output compliant with the S0 interface. S0 is defined in IEC 62053-31 and the older German DIN 43864 standard. The interface consists of a volt-free contact (or an open-collector transistor) that closes (or pulls low) for the pulse duration. The receiving device must provide the pull-up voltage and a current-limiting resistor; the meter itself does not source the line voltage.
Key parameters of a typical S0 output for a residential single-phase kWh meter:
| Parameter | Class A (low current) | Class B (high current) |
|---|---|---|
| Pulse rate (common) | 1 000 pulses / kWh | 100 pulses / kWh |
| Pulse duration | 30 - 90 ms (typ. 50 ms) | 30 - 90 ms (typ. 50 ms) |
| External pull-up voltage | ≤ 24 V DC | 3 - 35 V DC |
| Required sink current | ≤ 10 mA | 10 - 27 mA |
| Output type | Optocoupler or MOSFET, polarity-marked | Optocoupler or MOSFET, polarity-marked |
The 27 V DC measured at the meter output is the meter's stated maximum open-circuit voltage or an internally biased rail. Many Class B meters expose a 24 V DC internal pull-up that reads as 24 - 27 V on a high-impedance multimeter. The 24 V DC signal is fully compatible with a 24 V DC logic input on the LOGO! 12/24RC or 24RC, but is well below the 79 V AC threshold required by the 230RC's AC input stage.
+ (or k) terminal to the LOGO! I8 terminal and the meter's − (or l) to the LOGO! M (common / ground) terminal. Reversed polarity will not damage the meter but will not produce a countable pulse.Pulse Timing and Dispense Math
The interval between two S0 pulses is a direct function of load power and meter pulse rate:
T_pulse = 3 600 / (P_load_kW × imp_per_kWh) seconds
For a 1 kW load and a 1 000 imp/kWh meter: T = 3.6 s. For the same load on a 100 imp/kWh meter: T = 36 s. Required dispense count for N kWh: N × imp_per_kWh. Time to dispense N kWh at constant load P: T = 3 600 × N / P seconds. These formulas are the basis of the threshold setting on the LOGO! counter block.
Why Simulation Works but Real Hardware Fails
LOGO! Soft Comfort's simulation engine treats every digital input as a software toggle. There is no analog voltage-level model, no Schmitt-trigger input conditioning, and no EMC input filter. Toggling I8 in the simulator injects a clean, debounced logic transition directly into the program scan, which is why the B030 counter increments correctly in simulation. On real hardware, the 27 V DC pulse must first pass through the LOGO!'s input protection network, optical isolation, rectifier (for AC variants), and threshold comparator before being presented to the CPU. The 27 V DC signal cannot pass the 230RC's high-voltage AC threshold comparator and is rejected. This is the single most common reason a LOGO! program passes simulation but fails on the bench.
Diagnostic Procedure: Verifying the Pulse Signal
Before changing hardware, confirm that the pulse signal is actually arriving at the LOGO! terminal and that it is shaped correctly. Use the following bench sequence.
- With the load OFF and the meter powered, set a multimeter to DC volts and measure between
I8andMon the LOGO!. The reading should be 24 - 27 V DC in the idle (no-pulse) state. If the reading is 0 V, the meter output is not biased up - check that the meter's S0 output requires a 24 V DC external supply and that it is connected. - Apply a small known load (e.g. a 100 W lamp) to the metered output. The DC voltage should drop briefly to near 0 V every few seconds as the pulse fires, then return to 24 - 27 V DC. This is the pulse train.
- If a scope is available, trigger on the falling edge. The pulse should be 30 - 90 ms wide with clean edges (rise time < 5 ms). A slow rise time (> 10 ms) suggests a pull-up resistor that is too large for the cable capacitance, or a long untwisted cable run.
- On the LOGO!, the
I8status LED should flash in time with the pulse. If the LED does not flash but the scope shows clean pulses at the terminal, the input has either failed or the controller variant's input thresholds are too high for the present signal level - this is the current fault. - From the LOGO! display or LOGO! Soft Comfort online view, navigate to the B030 block and read the CV (current value) tag. It should increment by 1 with every detected pulse. If CV stays at 0 while the LED never lights, the input stage is rejecting the signal.
Solution 1: Replace the LOGO! 230RC with a LOGO! 12/24RC
Required hardware:
- LOGO! 12/24RC (or 24RC / 24RCE for Ethernet). The 12/24RC accepts both 12 V DC and 24 V DC supply, making it the most flexible option for a panel with an existing 24 V DC rail. The 24RCE variant adds an Ethernet port for LOGO! Soft Comfort V8.4 networking and remote access.
- 24 V DC power supply sized for the LOGO!, the meter's S0 pull-up, and any 24 V DC I/O. A DIN-rail 30 - 60 W switch-mode supply is typical. A Siemens SITOP LOGO!Power 6EP3310-6SB00 (24 V / 1.3 A) is a direct match for the LOGO! footprint. If a step-down transformer feeding a bridge rectifier and reservoir cap is used instead, size the secondary for 24 V AC nominal, with a DC output of 24 - 28 V DC under load.
- Pull-up resistor (1 - 10 kΩ, typically 2.2 kΩ at 0.25 W) if the meter is a pure open-collector S0 output without internal biasing.
Wiring changes from the 230RC to the 12/24RC variant:
- Replace the LOGO! base module. The program transfers across via the LOGO! Soft Comfort project (Tools > Transfer > PC → LOGO!). All block addresses (B001 - Bnnn) and I/O references remain valid as long as the new module is in the same family (LOGO! 7 to LOGO! 7, LOGO! 8 to LOGO! 8).
- Rewire the 230 V AC supply (L, N) from the LOGO! terminals to a 24 V DC source on the new module: L+ at terminal 1, M at terminal 2.
- Move the meter pulse wiring from
I8 / Mon the 230RC (AC input) to the equivalentI8 / Mon the 12/24RC (DC input, polarity-sensitive). Add the 2.2 kΩ pull-up if not already present. - All other 230 V AC inputs (I1, I3, I6 if used as discrete) must be re-sourced - they cannot be fed with 230 V AC on a 24 V DC input. If the start and coin buttons are 24 V devices, no change is needed. If they are 230 V AC devices, move them to a different interface or wire them through interposing 24 V DC relays.
- The relay outputs (Q1 - Q4) are nominally 10 A on both variants, but verify the contact rating for the contactor coil VA. A 230 V AC contactor coil at 10 - 30 VA inrush is well within the 10 A / 2 000 VA AC-15 rating of the LOGO! R output.
After wiring, download the project to the new LOGO!, switch to RUN, and repeat the diagnostic above. The I8 LED should now flash with every meter pulse, and the B030 CV value should increment by 1 for each flash.
Solution 2: Add an Interface Relay or Optocoupler to Keep the LOGO! 230RC
If the 230 V AC coin / start buttons in the panel are extensive and the cost of rewiring them is high, the 230RC can be retained and the pulse signal level-translated with an interposing relay or optocoupler.
Option A: 24 V DC interposing relay. The meter's S0 output drives a 24 V DC relay coil (DPDT, e.g. Finder 55.34 or Phoenix Contact REL-MR-24DC/21). One of the relay's 230 V AC-rated contacts is wired between L and the 230RC's I8 input. The LOGO! 230RC's built-in 20 ms input filter will reject the contact bounce of a typical miniature relay without further debounce logic. Use a 1N4007 flyback diode across the 24 V DC coil, cathode to +.
Option B: Optocoupler. A logic-output optocoupler (e.g. Vishay VO615A or LiteOn LTV-817) with a 1 kΩ input resistor translates the 27 V DC pulse to a 230 V AC pulse using a pull-up to L and a dropper resistor sized for 5 - 10 mA LED current. This is faster and bounce-free but requires a small PCB or DIN-rail mount.
| Solution | Cost | Wiring impact | Reliability | Recommendation |
|---|---|---|---|---|
| Replace 230RC with 12/24RC | ~ 1 module cost | Full panel rewire of inputs and supply | Highest (no extra parts) | Preferred for new builds |
| Add 24 V interposing relay | ~ 1 relay + socket | Add relay, rewire I8 only | High (relay bounce up to 1 ms) | Preferred for retrofit |
| Add optocoupler | ~ 1 opto + resistors | Add small PCB, rewire I8 only | Highest (no moving parts) | For OEM retrofits with PCB space |
Counter Program Structure: B030 Up/Down Counter
The trimmed program uses the LOGO!'s built-in Up/Down Counter function block, referenced as B030 in the working project. The block accumulates pulses on its count input and clears when its reset input is asserted. The threshold - the count at which the block's Q output transitions - is set to the value of the analog onboard potentiometer (I6 reference) rather than a fixed constant, which allows the operator to dial in the kWh-per-coin ratio without reprogramming.
The working program contains the following functional blocks:
-
B030 (Up/Down Counter) - count input driven by
I8, threshold reference set to the onboard poti atI6, reset input driven by a negated coin-insert signal fromI1. Block Q output drives the contactor release. -
B001 (Text message block) - "Insert coin" prompt, triggered by
I1going high. -
B002 (Text message block) - "Dispensing" prompt with remaining count, triggered by
I3going high. -
Output Q2 - contactor coil driver, energised while
I3is high AND the B030 count is below the poti threshold.
Earlier revisions of the program contained B015 and B016 (a redundant AND/OR pair), B002 (an on-delay that was merged into a threshold change from 5 to 10), and B032 (a duplicate reset path that was merged into a single negated R on B030). These edits affect the internal block structure and the count threshold only - they do not change the I/O mapping or the controller variant requirement.
Threshold setting: the onboard poti on the LOGO! provides an analog value 0 - 1000. When the B030 count exceeds the poti value, the block's Q output transitions, Q2 is released, and the dispense ends. For a 1 000 imp/kWh meter, a poti setting of 1000 dispenses 1 kWh per coin. For a 100 imp/kWh meter, a poti setting of 100 dispenses 1 kWh per coin.
Wiring Schematic and Terminal Layout
The following SVG shows the corrected wiring for a LOGO! 12/24RC, following the LOGO! 8 base module pinout (the wiring principle is identical for LOGO! 7, only the terminal numbering differs).
On the LOGO! 12/24RC the digital inputs I1 - I8 share a common M (ground) return. The S0 output of the meter is polarity-sensitive: the meter's + (or k) terminal connects to the LOGO! I8 input, and the meter's − (or l) connects to the LOGO! M terminal. If the meter's S0 output is not internally biased, a 2.2 kΩ pull-up resistor from I8 to the 24 V DC rail is required to hold the line high between pulses.
Commissioning and Verification
Use the following bench test sequence after the controller swap to confirm correct operation.
- Power on the new 12/24RC. The green RDY LED should be solid; the red SF LED should be off.
- Press the coin switch
I1. The text message "Insert coin" or "Credit available" should appear on the LOGO! display (or HMI if connected). - Press the start button
I3. The display should switch to "Dispensing" andQ2should close, energising the contactor. - Apply a known load (e.g. 1 kW heater) to the metered output. Watch the LOGO!
I8LED - it should flash once per pulse, with a 3.6 s period at 1 000 imp/kWh / 1 kW. - Watch the B030 counter value on the LOGO! display (Param > B030 > CV) - it should increment by 1 per flash.
- When the count reaches the poti value (visible as the TH parameter of B030),
Q2should drop out, the contactor should open, and the display should return to the "Credit" or "Insert coin" state. - Verify a second dispense cycle from step 2 to confirm consistent operation, and check that the contactor does not chatter at the threshold.
- If a 100 W reference load is available, time the dispense: at 1 000 imp/kWh and a 1 kWh threshold the dispense should end 3 600 s after start. At 100 imp/kWh, the same 1 kWh threshold should end after 36 000 s on the same 100 W load (since the energy needed is the same but pulses come ten times slower).
Troubleshooting Matrix
| Symptom | Likely cause | Action |
|---|---|---|
| Counter does not increment in simulation OR hardware | B030 R input held high; wrong input wired to count | Check B030 inputs in the program; confirm I8 wired to count input, not reset |
| Counter increments in simulation only | Input voltage below controller's ON threshold (present fault) | Replace 230RC with 12/24RC, or add 24 V interface relay |
| Counter increments erratically (random counts) | EMI on S0 wiring; floating pull-up | Add 2.2 kΩ pull-up to 24 V, twist pair, route away from mains |
| Counter increments but Q2 does not drop out at threshold | B030 threshold set as fixed constant, not poti | Set On = I6 (poti reference) in the block parameters |
| Counter resets unexpectedly mid-dispense | Duplicate reset block still active; I1 bouncing | Remove redundant reset block, debounce I1 with on-delay or schmitt input filter |
| LOGO! SF (red) LED on after download | Program syntax error or I/O address out of range | Check LOGO! Soft Comfort compile errors, confirm program size < 8 400 bytes |
| 27 V measured at meter, 0 V at LOGO! I8 terminal | Open circuit in S0 wiring, broken conductor or loose terminal | Inspect terminals, tug-test conductors, re-terminate |
| 27 V measured at meter, 27 V at LOGO! I8 terminal, LED off | Pull-up missing; meter output is open-collector only | Add 2.2 kΩ pull-up from I8 to 24 V L+ |
| Counter increments but at 2x or 0.5x expected rate | Count input not debounced; pulse rate assumption wrong | Verify meter pulse rate (100 vs 1 000 imp/kWh) and check the poti scaling |
| Contactor chatters on threshold | Threshold set to the same value as the count after a pulse edge | Add 1-count hysteresis or use the B030 On / Off parameters to set a deadband |
FAQ
Why does my LOGO! 230RC not count the 27 V pulse from the electricity meter?
The LOGO! 230RC's digital inputs are designed for 230 V AC signals and only register an ON state when the input voltage exceeds approximately 79 V AC. A 27 V DC pulse from an S0 meter output is well below this threshold, so the input never sees a transition and the B030 counter never increments. The program itself is correct - simulation passes because the LOGO! Soft Comfort simulator does not model analog input thresholds.
What is the standard voltage for an S0 pulse output from a kWh meter?
The S0 interface per IEC 62053-31 specifies a passive contact (or open-collector transistor) that the receiving device biases through a pull-up resistor. Most residential Class B meters accept an external 3 - 35 V DC pull-up and sink 10 - 27 mA when the pulse is active. A "27 V meter" typically means the meter is internally biased to 24 - 27 V DC and outputs a switch-to-ground pulse train, which is fully compatible with a 24 V DC logic input on a LOGO! 12/24RC or 24RC.
Can I keep the LOGO! 230RC and add a relay to step up the pulse to 230 V AC?
Yes. Wire the meter's S0 output to a 24 V DC relay coil (DPDT, 10 mA pick-up, e.g. Finder 55.34) and wire one of the relay's 230 V AC-rated contacts between L and the LOGO!'s I8 input. The LOGO! 230RC's built-in 20 ms input filter will reject the contact bounce of a typical miniature relay. An optocoupler gives the same translation with no moving parts and no contact bounce, at the cost of a small PCB.
How many pulses per kWh should I expect from a typical single-phase meter?
Common rates are 1 000 pulses / kWh (modern electronic meters) and 100 pulses / kWh (older or low-cost meters). At 1 kW of load, a 1 000 imp/kWh meter produces one pulse every 3.6 seconds; a 100 imp/kWh meter produces one pulse every 36 seconds. The LOGO! Up/Down Counter block counts correctly down to about 50 ms minimum pulse period, so any S0 rate up to about 20 pulses / second is well within the LOGO!'s 5 kHz fast-input capability on I7 / I8.
Do I also need a step-down transformer for the LOGO! 12/24RC power supply?
Yes, but only for the supply rail - not for the pulse input. The LOGO! 12/24RC and 24RC need a 12 V DC or 24 V DC source, which can be provided by a 230 V AC to 24 V DC switch-mode power supply (e.g. Siemens SITOP LOGO!Power 6EP3310-6SB00, 24 V / 1.3 A) or a conventional 230 V to 24 V transformer plus bridge rectifier and smoothing capacitor. The meter's 27 V pulse is wired directly to I8 - no transformer is needed on the signal path once the controller is the 24 V variant.