Skip to content

conveyor — machine_state (stack-light-tap)

Most PLC-controlled conveyor lines already drive a 3-lamp stack light (red/yellow/ green) from existing outputs to show run/idle/fault state to operators on the floor. This recipe never writes to the PLC; it either reads the state optically, with a small colour/photo sensor aimed at the stack light lens that reports which lamp is illuminated, or electrically, with a 3-channel isolated digital-input tap on the stack light’s own low-voltage lamp wiring (reading the voltage already present at each lamp, never injecting one), either way a passive read of a signal the line’s own controls already produce (INV-4). Each lamp maps directly to a state: green = run, yellow = idle (or minor stop), red = fault/stopped. Stack-light state changes happen on the order of seconds to minutes as the line starts, stops, or faults, so a 2 Hz sample rate gives ample margin to catch a lamp change within half a second while avoiding any aliasing concern, since there is no sub-second periodic event being measured, only slow discrete state transitions.

  • Spec: colour/photo tap on the stack light lens, or 3-channel isolated digital input tap on the stack light’s own lamp wiring
  • Signal: state ({state}), range n/a
  • Banner Engineering K50L Series colour-sensing photoelectric sensor (for optical lamp read)
  • ifm electronic DI0005 opto-isolated digital input module (for electrical lamp-wiring tap, one channel per lamp)
  • Omron E3S-AD series diffuse colour-mark sensor (alternate optical lamp read)

For the optical variant, mount the colour sensor on a small bracket a few centimetres from the stack light lens, aimed squarely at the lamp face, shielded from stray ambient light and sunlight that could false-trigger a colour read. For the electrical variant, land the digital-input taps on the stack light’s own lamp supply wiring inside the tower’s junction box or the PLC output terminal block, via isolation relays, one per lamp colour; never splice into or share a terminal with the PLC’s output card itself.

Optical sensor: 3-wire DC (24 V, 0 V, signal/analog colour output) to the edge box’s I/O module. Electrical tap: each lamp’s isolation relay dry contact goes to its own digital input channel on the edge box, with the tap wiring run as a separate cable from the PLC output card’s wiring.

cycle the line operator through a scripted run -> idle -> fault -> run sequence while an observer logs timestamps and lamp colours, and compare the detector’s state transitions to the logged sequence over the same window

Expected: detector’s state matches the logged lamp colour at every transition within +/-2 s (a correctly aligned tap is a direct read of the line’s own existing state signal, so there is no learning or tuning uncertainty once installed)

  • de-energize and lock out the stack light tower’s supply circuit (LOTO) before opening its junction box to install an electrical tap; the tower wiring can originate from a live PLC output card
  • use isolation relays on any electrical tap so a wiring fault on the edge-box side can never back-feed voltage into the PLC’s output terminals
  • mount an optical sensor and its bracket so it does not obstruct the stack light’s visibility to operators and pedestrians on the floor, which is a safety signal in its own right

35–140 USD, difficulty 2/5, ~25 min install downtime.