December 5, 2026

Optocoupler Explained: Isolation, Current Transfer Ratio and the Pull-Up Resistor Most Circuits Get Wrong

A six-pin optocoupler bridging two separate circuits on a breadboard

A 4N25 optocoupler with 10 milliamps flowing through its LED is guaranteed to pass only 2 milliamps on its output side, and that guarantee is for a brand-new part at room temperature. Choose an output pull-up resistor sized for the typical figure instead, and the circuit works on the bench and fails years later, after the LED inside has dimmed. The fix is a few lines of arithmetic using the datasheet’s minimum, and this post walks through it, along with what the isolation rating on the same datasheet actually promises.

Video: Takim Mallick on YouTube

Light across a gap

What’s inside

An optocoupler puts an infrared LED and a light-sensitive transistor in one sealed package, facing each other across a transparent insulating gap. Current through the LED makes light; light reaching the transistor’s base lets current flow on the other side. No wire connects the two halves. Vishay’s optocoupler FAQ describes the parts as optoisolators “providing an isolated galvanic barrier,” meaning no direct electrical path between input and output.

Why that matters

The two sides can sit at completely different voltages. A microcontroller running from 3.3 volts can signal across to a circuit referenced to a mains-powered supply, a noisy motor driver or a long cable run with its own ground. Faults, spikes and ground differences on one side stay there, at least up to the part’s rated limits.

A green circuit board with a central blue microchip

The datasheet numbers

The 4N25 family

Vishay’s 4N25 datasheet (document 83725, rev. 1.8) covers the 4N25 through 4N28. The figures that matter for design:

Parameter 4N25 Conditions
Current transfer ratio, minimum 20% VCE = 10 V, IF = 10 mA
Current transfer ratio, typical 50% same
Isolation test voltage 5000 VRMS
LED forward voltage 1.3 V typ, 1.5 V max IF = 50 mA
Output saturation voltage 0.5 V IC = 2 mA, IF = 50 mA
Rise and fall time 2 µs VCE = 10 V, IF = 10 mA, RL = 100 Ω
Maximum LED current 60 mA

The 4N27 and 4N28 have a lower minimum, 10 percent. Same package, same pinout, half the guaranteed transfer.

Current transfer ratio

The FAQ defines CTR as the output current “obtained by dividing the output current of the transistor by the forward current of the emitting diode,” expressed as a percentage. It’s the optocoupler’s gain, and it is small: 10 mA in, typically 5 mA out, guaranteed only 2 mA.

Sizing the output pull-up

The common circuit

The usual digital connection puts a pull-up resistor from the output side’s supply to the phototransistor’s collector, with the emitter grounded. When the LED is off, the output sits high. When it’s on, the transistor should pull the output down near 0.5 volts. For that to happen, the transistor has to be able to carry all the current the pull-up resistor tries to push through it.

The arithmetic

The current through the pull-up when the output is low is the supply voltage minus the saturation voltage, divided by the resistance. That has to be less than the current the phototransistor can deliver, which is the LED current times the CTR. Turned around, the pull-up must be at least (supply − 0.5 V) divided by (LED current × CTR). For a 5 V output side:

LED current CTR used Available output current Minimum pull-up
10 mA 50% (typical) 5.0 mA 0.90 kΩ
10 mA 20% (guaranteed) 2.0 mA 2.25 kΩ
10 mA 10% (aged margin) 1.0 mA 4.50 kΩ
5 mA 20% 1.0 mA 4.50 kΩ
5 mA 10% 0.5 mA 9.00 kΩ

A 1 kΩ pull-up, sized from the typical figure, needs 4.5 mA. A part delivering its guaranteed minimum of 2 mA can’t pull the output low enough, and the “low” level floats somewhere in the middle, where logic inputs may read it either way.

Why design for half the minimum

Two things push the real CTR below the datasheet’s minimum during a product’s life. The FAQ refers to graphs showing CTR changing with forward current and temperature, and at lower LED currents than the 10 mA test point, CTR generally falls. The second is aging. Renesas’s application note on optocoupler lifetime explains that the LED’s efficiency “will decrease over time due to current and temperature stress at the PN junction,” and that a design’s lifetime can be estimated by “designing how much the CTR can drop from the initial value.” Treating 10 percent as the working CTR for a 4N25, half its minimum, is a common way to leave that room.

Black and white LED light

The input side

LED resistor from a 3.3 V pin

The LED is driven like any LED, through a series resistor. From a 3.3 V microcontroller pin, 10 mA needs about 180 to 210 Ω, depending on where the forward voltage sits between 1.2 and 1.5 V. Many small microcontrollers prefer to source less than that per pin. A 330 Ω resistor gives about 5.5 to 6.4 mA, which with the 10 percent working CTR leaves roughly 0.6 mA on the output side, enough for a 10 kΩ pull-up on 5 V.

Don’t skip the resistor

The LED inside an optocoupler has no current limiting of its own. The 4N25’s absolute maximum LED current is 60 mA, and a GPIO pin wired straight to the LED would try to push whatever its driver allows. A resistor costs nothing and keeps both the pin and the LED inside their ratings, and its value is the main knob for trading output current against how hard the pin works.

Reverse protection

Infrared LEDs tolerate only a small reverse voltage. When the input signal can swing negative, as with an AC signal or a long cable picking up interference, a small diode across the LED, pointed the opposite way, clamps it.

Speed

The 2 µs figure

The datasheet’s 2 µs rise and fall times are measured with a 100 Ω load. That’s far lower than the kilohm pull-ups that the CTR arithmetic calls for. Larger pull-ups charge the phototransistor’s internal capacitance more slowly, so real switching is slower than the headline figure, which is why basic phototransistor couplers are mostly used for signals in the kilohertz range rather than fast data.

The base pin

The 4N25 brings out the phototransistor’s base on a sixth pin. Vishay’s FAQ says connecting it can “speed up the turn-off time by creating an external conducting path for the base charge.” A resistor from base to emitter drains stored charge faster, at the cost of some sensitivity. If the base isn’t used, the FAQ advises tying it down “with a high value resistance” to keep noise from switching the transistor.

Faster parts

For serial data or PWM above the tens-of-kilohertz range, high-speed optocouplers with built-in logic outputs, or digital isolator chips that use capacitive or magnetic coupling instead of light, are the better fit. Texas Instruments’ guidance on isolator aging notes that LED light output in optocouplers degrades over time and that CTR is where that aging shows most clearly, one reason those alternatives are common in new designs.

Black fpv soldering pcb practice board

What 5000 VRMS means

A test, not a working rating

The datasheet lists 5000 VRMS as the isolation test voltage: the level a part withstands briefly during a test. It isn’t a promise that the barrier will hold that voltage continuously for years. Continuous working-voltage ratings, creepage distances on the circuit board and the safety standards a product must meet are separate questions.

The board counts too

An optocoupler’s insulation is only as good as the gap around it. Copper traces from the input and output sides running close together under or beside the package can create a path the part itself was designed to block. Keeping a clear gap on the board under the chip, from one side’s pins to the other’s, is part of the isolation.

Not a safety certificate

For hobby projects separating a microcontroller from a 12 or 24 volt circuit, a generic optocoupler is plenty. Anything that crosses from mains voltage to something a person can touch needs parts rated and certified for that job, and a design that follows the applicable safety standard. That’s a job for a qualified engineer, not a parts drawer.

Parts for an experiment

As an Amazon Associate I earn from qualifying purchases. A commission may be earned if you buy through this link, at no extra cost to you.

Sources

  • Vishay, 4N25/4N26/4N27/4N28 datasheet, document 83725, rev. 1.8: https://www.vishay.com/docs/83725/4n25.pdf
  • Vishay, Transistor Output Optocouplers FAQs: https://www.vishay.com/docs/84360/optocouplersfaqs.pdf
  • Renesas, “Lifetime of Optocoupler/Photocoupler,” application note R08AN0015EJ0100: https://renesas.com/en/document/apn/lifetime-optocouplerphotocoupler
  • Texas Instruments, isolation aging note (SLLA526C): https://www.ti.com/document-viewer/ja-jp/lit/html/SLLA526C/GUID-78AB31F6-806C-4D7F-A4A5-2E1F7B37583E

920 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *