AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

How-to

Wiring a 5V incremental encoder to a 5V counter module

Sensors, encoders and machine vision on the machine Published 8 min read By AutomateDirectUSA engineering team

Short answer

A 5 V counter module has no encoder supply terminal, so the encoder takes its own external regulated 5 V source with the 0 V tied to the module's signal ground. Wire A, B and signal ground, confirm the supply at the encoder terminals under load, then prove it: one shaft turn must change the count by pulses per revolution times the evaluation factor.

On this page
  1. Does the counter module feed the encoder?
  2. Which encoder signals does the module accept?
  3. Which terminals take A, B and signal ground?
  4. Where does the external supply connect?
  5. What voltage should you read at the encoder terminals?
  6. How do you configure the module and read the count?
  7. How many counts equal one shaft turn?
  8. What proves the wiring is right?
  9. Questions asked

Wire it this way: the encoder takes its own external regulated 5 V supply, the supply's return is bonded to the counter module's signal ground, and the encoder's A, B and signal ground land on the module's counter terminals. The reason sits on the terminal block: a counter module of this class, for example the ET 200S 1COUNT 5V module 6ES7 138-4DE02-0AB0, offers no encoder supply terminal at all, and its documentation restricts the connection to incremental encoders at that same level. What follows is the wiring in the order you meet it: level check, terminals, supply and common reference, configuration, the count in ladder, and the one-turn check that proves all of it.

Does the counter module feed the encoder? #

No. A counter module of this class brings the counter input and the signal reference to its terminal block but no encoder supply, so the encoder runs from a separate regulated source at its own supply level, bonded to the module ground. The input electronics are on the board; a clean rail for a cable run out to an encoder is not part of it. That differs from HTL counter setups, where the encoder draws power from dedicated supply terminals such as +Us and 0Vs, as HTL incremental encoder supply terminals shows.

Decision: order a regulated external source rated above the encoder's datasheet current, for example 300 mA for an encoder that draws 150 mA, and mount it in the cabinet beside the I/O.

Which encoder signals does the module accept? #

Only incremental signals at the encoder's supply level: two square-wave channels A and B in quadrature, about 90 electrical degrees apart, of the TTL/RS422 class; an encoder with 24 V HTL or PNP/NPN outputs does not match, and its 24 V can damage the input. Read two separate lines on the encoder datasheet: the supply voltage range and the output type. The output type decides compatibility; the supply range only decides what feeds the encoder.

Datasheet says Level arriving at the module Decision
5 V supply, TTL or RS422 outputs 5 V signals Compatible: wire it directly
10-30 V supply, HTL or PNP/NPN outputs 24 V class signals Not compatible: an RS422 encoder, a level converter, or a 24 V counter module

Check the output type before the first power-up: 24 V landed on this input can destroy the module. The same level-mismatch discipline, run in the opposite direction, is what connecting a 5V linear scale to a 9-24V counter module works through. Decision: for a new build, an RS422 encoder at the module's level is the clean fix; a level converter earns its keep only when the existing encoder must stay.

Which terminals take A, B and signal ground? #

Encoder A goes to the module's A channel, encoder B to the B channel, and the encoder's signal ground to the module's ground terminal; the exact terminal numbers come from the terminal assignment table in the module manual, because they depend on the terminal module fitted. Wire it in this order:

  1. With the I/O powered off, run a shielded twisted-pair cable from the encoder to the terminal module; give A its own pair, B its own pair, and the supply its own pair.
  2. Land A, B and signal ground using the terminal assignment table for your terminal module, for the ET 200S example the one in the SIMATIC ET 200S Technological Functions manual, entry ID 87560033.
  3. Terminate the shield exactly as that manual's wiring diagram shows, and keep the run away from motor and drive cables.
  4. Respect the signal class when planning the run: differential TTL/RS422 signals hold over far longer distances than single-ended 24 V HTL, as the comparison of HTL and TTL/RS422 encoder cable length limits sets out.

The A, B and ground pattern is the same one wiring a TTL quadrature encoder to drive encoder terminals uses at a servo drive; only the supply arrangement differs here.

Where does the external supply connect? #

Across the encoder's own supply terminals: the source's positive output to the encoder's supply input, its 0 V to the encoder's 0 V, and a jumper from that 0 V node to the module's signal ground so both sides share one reference. Without that bond the A and B levels float relative to the module's input thresholds, and the symptom is a count that is dead, erratic or drifting while the wiring looks correct; the missing reference is the classic omission, not the missing supply. Decision: one jumper from the external source's 0 V terminal to the module's signal ground terminal, with the encoder's own supply return on the same node.

What voltage should you read at the encoder terminals? #

A value inside the band printed on the encoder datasheet, measured at the encoder's own terminals with the encoder connected and powered, not at the source's output terminals, where cable drop is invisible. Calculated example, not a measurement: a source set to 5.00 V, an encoder drawing 150 mA, and a supply pair with 0.4 Ω of loop resistance. Cable drop = 0.150 A × 0.4 Ω = 0.06 V, so the encoder sees 5.00 V - 0.06 V = 4.94 V. Against an example datasheet band of 4.75 V to 5.25 V, that passes with margin.

Decisions: a low reading means a shorter or thicker supply pair, or trimming the source up within the band; and if the second check, continuity and near-zero volts between the encoder's supply return and the module signal ground, fails, fit the jumper from the previous section.

How do you configure the module and read the count? #

In the hardware configuration of the I/O station: insert the counter module at its slot, note the input and output addresses the slot receives, set the counting parameters, download, and the count becomes ordinary input data you can move into memory. For the ET 200S example:

  1. Insert the counter module at its slot in the station's hardware configuration.
  2. Record the input and output start addresses the configuration assigns to that slot.
  3. Set the counting parameters (counting mode, signal evaluation, gate and reset behavior) as the Technological Functions manual describes.
  4. Download the configuration and cycle the CPU to RUN.
  5. Clear any station or module fault in the diagnostic buffer before touching logic; a parameter or wiring fault yields no valid count no matter what the program does.

The count is plain input data, so ladder needs one move and one compare. These names are example variables, not module identifiers: MD 100, a double word holding the live count, initial value 0; MD 104, a double word holding the target, initial value 4096 from the next section's example; M 10.0, a target-reached bit, initial value 0. A MOVE copies the module's input double word, at the address recorded in step 2 (for example the area starting at input byte 256), into MD 100; a CMP >=D compares MD 100 with MD 104 and sets M 10.0. The test that proves it: watch MD 100 in the variable table while turning the shaft by hand; it must climb smoothly, and M 10.0 must go to 1 once the count passes the target.

How many counts equal one shaft turn? #

Pulses per revolution multiplied by the signal evaluation factor you configured: with the encoder's 1024 pulses per revolution and quadruple evaluation that is 1024 × 4 = 4096 counts, and one slow revolution of the shaft should move the count by exactly that. Calculated example for those inputs: pulses per revolution = 1024, a common encoder resolution; evaluation factor = 4, meaning both channels on both edges. Counts per revolution = 1024 pulses × 4 = 4096 counts. The factor is why the same encoder can legitimately show three different totals:

One turn reads Evaluation it means Decision
4096 Factor 4, quadruple Matches the example setting
2048 Factor 2, one edge per channel Set the signal evaluation to quadruple, or accept the resolution
1024 Factor 1, channel A edges only Same parameter choice; the wiring is fine

Half or quarter of the expected total is a parameter symptom. A cable fault announces itself as jumps and drift instead, which the last section separates out.

What proves the wiring is right? #

Five readings with the shaft turning and stopped: the encoder terminal voltage under load, the supply-return-to-ground bond, a steady one-direction count, the one-turn total, and no drift with the shaft at rest and the drive energized nearby. Run them in this order:

  1. Encoder terminal voltage under load: inside the datasheet band, with no sag while the shaft turns.
  2. Encoder supply return to module signal ground: continuity, which proves the shared reference.
  3. Shaft turned slowly forward while watching the count: steady movement in one direction. If it only decrements, swap the A and B wires at the terminals, or flip the direction parameter where the configuration offers one.
  4. Exactly one revolution by hand: the count changes by the previous section's total, with a small margin for judging the start and end of the turn by eye.
  5. Shaft at rest with the drive energized nearby: the count holds. Drift here means noise coupling, so recheck the shield termination and the routing away from motor cables.

Pass all five and the counter is trustworthy; each failure above carries its own fix.

Questions asked

Can the inverted outputs and the zero marker stay unconnected?

Yes, for plain counting. A, B and signal ground carry the count and the direction. The inverted outputs and the N zero marker can stay open, and an unused output must never be tied to ground, because that loads the encoder's driver stage. The manual's terminal table shows whether your terminal module evaluates N at all; wire it only when a reference pulse is needed for homing.

Does a wide-supply encoder still need the external 5 V source?

Only its outputs decide. Some encoders accept a 10-30 V supply and still emit RS422 (TTL) signals at 5 V; such an encoder matches the counter input directly and needs no separate 5 V source, only the shared signal ground. Read the supply range and the output type as two separate datasheet lines, and let the output type make the decision.

Can the 5 V come from the machine's 24 V supply?

Yes, through a small regulated step-down DC/DC converter mounted near the module, the tidiest fix on a machine with no rail at the encoder's level. Size it above the encoder's datasheet current, jumper its 0 V output to the module signal ground, and measure the voltage at the encoder terminals so the converter's own wiring drop is included.

Can two counter modules share one external 5 V supply?

Yes, when the source's current rating covers both encoder currents from their datasheets with margin. Bond each encoder's supply return to its own module's signal ground and give each encoder its own shielded twisted-pair run. Sharing a supply is safe; sharing one floating reference is what produces erratic counts.

Keep reading

  • How-to

    Connecting a 5V linear scale to a 9-24V counter module

    A 5 V linear scale cannot drive a 9-24 VDC optically isolated counter input: the input's series resistor is sized for the higher supply, so 5 V falls below guaranteed optocoupler turn-on. Raise the level with a purpose-built interface board, an isolated DIN-rail pulse conditioner, or the two-NPN, two-10 kΩ circuit from the Counter I/O manual. A resistor divider only steps voltage down, and an analog signal conditioner has no edge bandwidth.

    Sensors, encoders and machine vision on the machine

  • How-to

    Wiring a TTL quadrature encoder to drive encoder terminals

    Land the encoder's A, B, ENC+ and ENC- conductors on the drive's four encoder terminals and insulate the index wire: it has no terminal. Power the encoder from the drive's encoder supply only when its datasheet current sits under the drive's stated limit; otherwise feed it from an external five-volt supply and fit the manual's 470 ohm resistor between ENC- and ENC+, then verify counts before the drive takes power.

    Sensors, encoders and machine vision on the machine

  • Explainer

    HTL incremental encoder supply terminals +Us and 0Vs

    +Us and 0Vs on an HTL incremental encoder are its positive supply and 0 V return, not signal tracks. They power the electronics that create the A and B pulses, so they must be connected with the supply voltage documented for the exact encoder variant — 15, 25 or 30 VDC in one family's manual — whether that comes from the drive's supply feed or a separate supply, as the terminal diagram shows.

    Sensors, encoders and machine vision on the machine