Wiring a Photo Interrupter to an Omron G3VM-2 Solid State Relay

James Nishida14 min read
OmronSensor IntegrationTutorial / 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

A slotted photo interrupter (also called a photomicrosensor, opto interrupter, or photo switch) is one of the simplest ways to detect the presence, position, or speed of a moving part. Pairing it with an Omron G3VM-series MOSFET-output solid state relay turns the optical event into a clean, bounce-free switching action for a DC load. The G3VM series is Omron's portfolio of photo-MOSFET relays; the part number "G3VM-2" is shorthand for the 2 A load-current family, with common catalog numbers such as G3VM-21AR (60 V load), G3VM-21BR (350 V load), and G3VM-21ER1 (400 V load). The following guidance applies across that family.

The challenge is that a slotted photo interrupter is not a digital sensor by default. Most catalog parts include an IR LED and a phototransistor, and the phototransistor's collector is left as an exposed analog node. Driving a MOSFET relay input LED from that node is a common source of frustration: the signal is weak, the pull-up resistor interacts with the switching speed, and the SSR either never turns on or turns on too slowly. This article walks through the correct part selection, the LED current-limiting math for a 15.5 V measured rail, the buffer stage that is usually needed between the sensor and the SSR, and the verification procedure that proves the design works.

Important ambiguity: the source post does not give the full Omron suffix on the G3VM-2 (for example, AR, BR, ER1, GR1) or the full photomicrosensor catalog number. Confirm the suffix against the load voltage and current you actually need before ordering parts.

Prerequisites

Before starting the build, gather the following parts and information:

  • Slotted photo interrupter with a Schmitt-trigger logic output (not a bare phototransistor). See the Omron EE-SX photomicrosensor family for representative parts.
  • Omron G3VM-2 series MOSFET relay. The 2 A family covers 60 V to 400 V loads and uses an input LED with a 1.0–1.5 V forward drop and a 5–25 mA typical trigger current.
  • DC power supply that will power the sensor LED. The post measures this rail at 15.5 V, which is a typical 12 V AC-adapter loaded value. The math below uses 15.5 V.
  • Current-limiting resistors sized to the formulas in the sections below.
  • Buffer stage (single NPN transistor such as 2N2222 / BC547, or a non-inverting logic buffer such as 74HC07) only if the photo interrupter's logic output cannot source 10 mA.
  • Multimeter with diode-test mode, oscilloscope or logic probe, and a variable DC load for verification.

How a Slotted Photo Interrupter Works

A slotted photo interrupter contains two components facing each other across a 3–5 mm air gap:

  1. An infrared LED (typically 940 nm, VF ≈ 1.2 V at 20 mA) on one side.
  2. A photodetector on the other side — usually a phototransistor in cheaper parts, or a photodiode feeding a Schmitt-trigger comparator in smarter parts.

When the slot is empty, light from the LED strikes the photodetector and the output transistor (or logic gate) is activated. When a flag, blade, or encoder wheel enters the slot, light is blocked, the photodetector turns off, and the output returns to its inactive state.

The first design decision — and the most important one — is which output topology you choose. The wrong choice is the source of 90 % of the headaches described in the field report.

Output Topologies: Phototransistor vs. Schmitt Trigger Logic

Parameter Bare Phototransistor Output (e.g. EE-SX1046) Schmitt Trigger Logic Output (e.g. EE-SX1081, EE-SX4070)
Output pin Open collector of phototransistor Logic-level high/low, push-pull or open-collector
Output voltage swing 0.3 V to VCC (depending on pull-up) Rail-to-rail (0 V to VCC)
Sink / source current 0.3–2 mA typical, very dependent on LED drive Several mA, often 5–10 mA
Switching speed 15 µs at 1 kΩ load; degrades ~20× as pull-up increases Fixed by internal comparator; typically 3–5 µs
Hysteresis None — analog transition Built-in (0.3–0.6 V typical)
Direct drive to G3VM-2 input LED? Marginal at best, often not possible Yes, with a current-limit resistor; or via a buffer
Recommended use Precision analog front-ends, encoders where you control the pull-up Digital I/O, PLC inputs, SSR drive circuits

For any application where the output drives an SSR, PLC input, or microcontroller, use the Schmitt-trigger variant. The analog design work that the field report warns about — picking a 20 kΩ pull-up, accepting 0.3 V swings, watching delay rise from 15 µs to ~300 µs — is entirely sidestepped.

The Analog Photo-Transistor Pitfall

The field report illustrates the math problem clearly. A representative slotted photo interrupter (phototransistor output) is specified at IF = 20 mA into the LED, with IC = 0.3 mA out of the phototransistor. That is a current transfer ratio of 1.5 % — very low. Two follow-on numbers make the analog design awkward:

  • With a 1 kΩ pull-up: output voltage swing = IC × RLOAD = 0.3 mA × 1 kΩ = 0.3 V. That is well below the G3VM-2 input LED's forward voltage of 1.2 V, so the SSR never turns on.
  • With a 20 kΩ pull-up: output voltage swing = 0.3 mA × 20 kΩ = 6 V (a reasonable logic swing), but the propagation delay rises roughly proportionally with R × C of the load. With the standard 15 µs at 1 kΩ baseline, the delay becomes ~15 µs × (20 kΩ / 1 kΩ) ≈ 300 µs. A 300 µs propagation delay is too slow for most position-sensing applications, and is exactly the speed degradation the field report warns about.

The conclusion is unambiguous: do not use a phototransistor-output photo interrupter to drive a G3VM-2. Pick the Schmitt-trigger output variant instead, and the rest of the design becomes a textbook digital-to-LED interface.

Sizing the LED Current-Limiting Resistor

The LED inside the photo interrupter has a forward voltage VF ≈ 1.2 V (range 1.0–1.5 V) at the recommended forward current of 20 mA. With a 15.5 V measured rail, a current-limiting resistor is mandatory:

RLED = (VRAIL − VF) / IF

VRAIL VF IF target RLED calculated Nearest E12 standard Power dissipation
15.5 V (measured) 1.2 V 20 mA 715 Ω 680 Ω 0.30 W (use 0.5 W or larger)
12.0 V (nominal) 1.2 V 20 mA 540 Ω 560 Ω 0.22 W
5.0 V (logic rail) 1.2 V 20 mA 190 Ω 180 Ω or 220 Ω 0.08 W
3.3 V (logic rail) 1.2 V 15 mA 140 Ω 150 Ω 0.03 W
Power dissipation check. P = IF2 × R = (0.020 A)2 × 680 Ω ≈ 0.27 W. A standard 1/4 W resistor will run hot and derate aggressively above 70 °C. Use a 1/2 W or larger part, especially if the photo interrupter sits inside an enclosure with the SSR.

Always re-measure the rail voltage under load before sizing the resistor. A nominal 12 V supply can swing from 11.4 V at full load to 15.5 V at no load (the measured value in the source post), and that variation moves the LED current significantly:

  • At 15.5 V rail: IF = (15.5 − 1.2) / 680 = 21.0 mA
  • At 11.4 V rail: IF = (11.4 − 1.2) / 680 = 15.0 mA

Both are inside the photo interrupter LED's safe operating area (typically 30–50 mA absolute max), so the design has good margin across the supply range.

Driving the G3VM-2 SSR Input

The G3VM-2 series input is an infrared LED similar in character to the photo interrupter's own LED. Representative specifications for the 2 A family:

Parameter Symbol Min Typ Max
Input forward voltage VF 1.0 V 1.5 V
Input trigger current IFT 1–5 mA
Input forward current (continuous) IF 10–25 mA 50 mA
Input reverse voltage VR 5 V

To turn the output MOSFET fully on, drive the input LED at 10–20 mA. Anything below IFT leaves the output in its high-RDS(on) region, which can over-dissipate the part under load.

Now consider the source side. Most Schmitt-trigger-output photo interrupters can sink or source only 5–10 mA. That is enough for a logic-level MCU but marginal for a G3VM-2 input LED that wants 15–20 mA. The cleanest solution is a small buffer stage between the photo interrupter output and the SSR input LED.

Adding a Buffer Stage (When Required)

Two buffer options are commonly used:

Option A — NPN transistor (low-side switch)

The photo interrupter output drives the base of a small NPN (2N2222, BC547, MMBT3904). The NPN collector pulls one end of the G3VM-2 input LED to ground; the LED's anode is tied through RG3VM to the 5 V logic rail or the 15.5 V rail. The collector current is roughly IC ≈ (VCC − VF(G3VM)) / RG3VM. For 5 V rail, VF = 1.0 V, IF = 15 mA: RG3VM = (5 − 1.0) / 0.015 ≈ 270 Ω.

Base resistor sizing: with hFE ≈ 100, base current of 0.15 mA is enough to saturate the transistor at 15 mA collector. A 10 kΩ base resistor from a 5 V logic output is more than sufficient.

Option B — Non-inverting logic buffer (74HC07)

The 74HC07 is an open-drain hex non-inverting buffer with 25 mA sink capability. Tie its output to the G3VM-2 input LED through RG3VM; pull the open-drain output up to 5 V or 12 V. This is the cleanest approach when the photo interrupter output is push-pull but only rated for 5 mA.

Buffer choice When to use RG3VM (for 15 mA IF) Parts
Direct (no buffer) Photo interrupter logic output is rated ≥ 20 mA 270 Ω (from 5 V) or 680 Ω (from 15.5 V)
NPN low-side switch Photo interrupter is open-collector, or output current is < 10 mA 270 Ω (5 V) or 967 Ω ≈ 1 kΩ (15.5 V) 2N2222, BC547, MMBT3904
74HC07 open-drain buffer Multiple loads, or want isolation between sensor and SSR 270 Ω (5 V) or 1 kΩ (15.5 V) 74HC07, ULN2003 (Darlington version)

Wiring Topology

The complete wiring diagram below shows the recommended Schmitt-trigger photo interrupter driving a 2N2222 buffer, which in turn switches the G3VM-2 input LED. The G3VM-2 output MOSFET then switches the DC load.

+15.5 V GND (0 V) R_LED 680 Ω, 0.5 W Photo Interrupter (EE-SX...) IR LED (Vf ≈ 1.2 V @ 20 mA) Photodetector + Schmitt trigger Vcc OUT (logic) R_BASE 10 kΩ 2N2222 +5 V (logic) R_G3VM 270 Ω G3VM-2 input G3VM-2 (MOSFET SSR) LOAD V+ +24 V (or load rail) Drain MOSFET Source LOAD to load return

Step-by-Step Build Procedure

  1. Confirm the parts. Verify the G3VM-2 suffix on the Omron datasheet. Confirm the photo interrupter is a Schmitt-trigger logic-output variant — not a phototransistor variant. Mark the anode (A) and cathode (K) of both internal LEDs using the manufacturer pinout.
  2. Wire the photo interrupter supply. Tie VCC of the photo interrupter to the 5 V logic rail (or 15.5 V rail if the part supports wide VCC). Tie GND to the common ground.
  3. Install R_LED for the IR LED inside the photo interrupter. For a 15.5 V rail and IF = 20 mA target, use R_LED = 680 Ω, 0.5 W. Place it in series with the anode of the photo interrupter LED; tie the cathode to ground.
  4. Wire the photo interrupter output. Connect the OUT pin to the base of the 2N2222 buffer through R_BASE = 10 kΩ. Tie the emitter to ground.
  5. Wire the G3VM-2 input LED. Tie the G3VM-2 input LED anode (pin 2 on a DIP-4 G3VM-2) through R_G3VM = 270 Ω to the 5 V logic rail. Tie the G3VM-2 input LED cathode (pin 3) to the collector of the 2N2222.
  6. Wire the load. Tie the G3VM-2 output (pins 4 and 6 on a DIP-4 G3VM-2) in series with the load. Respect the load polarity — the G3VM-2 is polarity-sensitive on DC outputs because of the internal MOSFET body diode.
  7. Power up the logic rail first. Before connecting the load rail, measure VCE(sat) on the 2N2222 with the slot clear (target ≈ 0.1–0.2 V). Measure VF on the G3VM-2 input LED (target ≈ 1.0–1.3 V).
  8. Block the slot. Confirm OUT goes to the opposite logic state, VCE on the 2N2222 rises toward VCC, and the G3VM-2 input LED current falls to zero.
  9. Energize the load rail. Confirm the load energizes when the slot is clear and de-energizes when the slot is blocked. Touch-test the G3VM-2 case for unexpected warmth.

Commissioning Verification

Check Test instrument Expected result Pass criterion
Photo interrupter LED current Inline ammeter or shunt resistor 15–22 mA Inside 10–30 mA SOA
Photo interrupter OUT high (slot clear) Multimeter / scope VOH (per datasheet, typically VCC) Above 0.7 × VCC
Photo interrupter OUT low (slot blocked) Multimeter / scope VOL < 0.4 V Below 0.4 V at rated sink current
2N2222 VCE(sat) (slot clear) Multimeter 0.1–0.2 V Below 0.3 V
G3VM-2 input LED forward current Inline ammeter or scope shunt 15 mA ± 20 % Above IFT, below 50 mA
G3VM-2 RDS(on) DMM across output terminals (load de-energized) 0.1–1 Ω (part-dependent) Below 2 Ω
Load voltage drop in ON state Scope or DMM at load VLOAD ≈ VRAIL − I × RDS(on) Drop < 5 % of rail
Turn-on delay (slot clear → load on) Scope: photo OUT and load voltage < 1 ms (digital path) Meets application timing
Turn-off delay (slot blocked → load off) Scope: photo OUT and load voltage < 1 ms Meets application timing

Compare the measured turn-on and turn-off delays to the analog-phototransistor estimate of 300 µs. The digital path will typically come in well below 100 µs total because the Schmitt-trigger comparator has internal hysteresis and the G3VM-2 is a fast photo-MOSFET relay.

Troubleshooting Matrix

Symptom Likely root cause Fix
G3VM-2 never turns on, no input LED light Photo interrupter LED under-driven because R_LED is too large for the 15.5 V rail, or LED wired reversed Recompute R_LED for actual VRAIL = 15.5 V and 20 mA target; confirm polarity with diode-test
G3VM-2 never turns on, input LED faintly lit Photo interrupter output current is below G3VM-2 IFT (analog phototransistor output) Replace with Schmitt-trigger logic-output variant; add 2N2222 buffer
G3VM-2 chatter / oscillation at slot edge Phototransistor-output sensor without hysteresis; flag grazing the slot edge Switch to Schmitt-trigger sensor; add RC debounce on buffer base if needed
Slow turn-off (~300 µs or more) Phototransistor sensor with 20 kΩ pull-up; R × C delay Switch to Schmitt-trigger sensor; remove large pull-up
G3VM-2 output MOSFET stuck on Buffer transistor shorted collector-emitter, or input LED driven from wrong rail Remove base drive and confirm output turns off; replace transistor; recheck G3VM-2 input polarity
Photo interrupter LED smokes on first power-up LED wired without R_LED, or R_LED too small for 15.5 V Install R_LED = 680 Ω, 0.5 W; verify IF < 30 mA
G3VM-2 case very hot in ON state Output RDS(on) too high because IF is below IFT; or load current exceeds 2 A Measure G3VM-2 input current, raise to 15–25 mA; confirm load current < 2 A continuous
Load only operates in one direction DC load wired across G3VM-2 with reverse polarity; internal body diode blocks reverse current Reverse load wiring; respect the polarity marking on the G3VM-2 datasheet
G3VM-2 input LED works, but load chatters on power-up Logic rail rises before photo interrupter OUT stabilizes; insufficient hysteresis Add 100 ms power-on delay in PLC or firmware; verify sensor has Schmitt-trigger output
DC load switching note. Unlike a triac-output SSR, a MOSFET-output G3VM-2 has an internal body diode. When switching inductive DC loads, add a freewheeling diode across the load (cathode to the more positive side). For solenoid or relay coils, a 1N4004 in reverse bias across the coil is the minimum protection. For higher-frequency PWM operation, a TVS or RC snubber sized to the coil time constant is recommended. Consult the Omron G3VM MOSFET relay catalog page for the application notes covering DC inductive loads.

Why does my photo interrupter output voltage look low when I put a meter on it?

You are probably using a phototransistor-output variant and measuring the open-collector node through a 1 kΩ pull-up. With a 0.3 mA collector current the swing is only 0.3 V. Switch to a Schmitt-trigger logic-output photo interrupter (e.g. Omron EE-SX1081 or equivalent), which drives a clean logic level without an external pull-up.

Can I drive the Omron G3VM-2 directly from a 3.3 V or 5 V logic output without a buffer?

Yes if the logic pin can source 10–20 mA and the rail is above 2.5 V. With a 5 V rail and VF(G3VM) = 1.2 V, R_G3VM ≈ 270 Ω gives ~14 mA into the SSR input LED. With a 3.3 V rail, target 8–10 mA to stay inside the logic pin's source rating, so R_G3VM ≈ 270 Ω again. Below that, add a 2N2222 low-side buffer.

What is the correct LED current-limiting resistor for a 15 V rail and a slotted photo interrupter?

For 20 mA target and VF = 1.2 V: R_LED = (15.5 − 1.2) / 0.020 = 715 Ω. Use the nearest E12 standard of 680 Ω, rated at 0.5 W or larger to keep the part cool. The exact value can swing 700–750 Ω depending on the photomicrosensor's VF tolerance.

Why does the propagation delay of a phototransistor output get worse as I increase the pull-up resistor?

The photo-transistor and its load resistor form an RC network. The rise time scales with R × C of the load. At 1 kΩ the typical delay is ~15 µs; raising the resistor to 20 kΩ to get a usable logic swing stretches the delay roughly 20× to ~300 µs. The Schmitt-trigger-output photo interrupter eliminates this trade-off by using an internal comparator with a fixed switching speed.

Does the G3VM-2 need a freewheeling diode when switching a DC load?

Yes. The G3VM-2 is a photo-MOSFET relay and includes a body diode, but that diode is oriented to conduct load current in one direction only — not to clamp inductive kickback. When switching a solenoid, relay coil, motor, or any inductive DC load, install a flyback diode (1N4004 or similar) directly across the inductive load, cathode to the positive terminal. Without it, the inductive kickback can exceed the G3VM-2's output voltage rating and destroy the part.

Back to blog