Bench note

Optocoupler bandwidth when your signal actually moves

The datasheet number you won't see

Optocouplers promise isolation and a clean logic handoff, but the 2 µs rise time in the datasheet assumes conditions you probably didn't build. Add a weak pull-up or a long trace, and that edge stretches into something your control loop will notice. If you're switching a relay based on a comparator trip or passing encoder ticks across a barrier, the delay compounds fast.

Most of the time, you pick an optocoupler for its isolation voltage and forget that the phototransistor on the output side is just a current sink with capacitance. Your pull-up resistor fights that capacitance every edge, and if you went conservative—say, 10 kΩ because it's "safe"—you've just turned a 2 µs part into a 10 µs part.

Pull-up math that fits the board

The output capacitance is usually buried in the datasheet's test conditions, often 15–50 pF plus whatever your trace adds. A 10 kΩ pull-up into 30 pF gives you an RC time constant around 300 ns, which sounds fine until you remember that's just one time constant. A clean logic transition takes three to five, so you're looking at 1–2 µs even before the phototransistor's own switching delay.

Drop the pull-up to 1 kΩ and that RC shrinks to 30 ns—now the edge is limited by the LED drive and transistor storage time, not your passives. The trade-off is current: a 1 kΩ pull-up into 5 V draws 5 mA when the output is low. If you're powering the isolated side from a linear regulator with headroom to spare, that's trivial. If you're running off a coin cell, it's a budget problem.

I usually land around 2.2–4.7 kΩ: fast enough that my 10 kHz loop doesn't see phase lag, light enough that the DC load stays under a milliamp per channel. Measure the edge with a scope if you're uncertain—most logic analyzers sample too slowly to catch the real shape.

When the delay still matters

Even with a tight pull-up, the optocoupler adds latency. If you're reading quadrature encoder pulses or trying to synchronize a PWM gate drive, that few-microsecond lag can skew your position estimate or let shoot-through sneak in. Some designs solve this by using high-speed optocouplers (the ones with integrated output buffers), but those cost more and still aren't as fast as a differential pair or a digital isolator.

The honest answer: if your signal moves faster than a few kilohertz and timing matters, an optocoupler is the wrong part. Use it for the slow stuff—fault flags, relay coils, UI button presses—and save the fast edges for isolators that were designed for speed. The 6N137 and similar high-speed types are better, but they're still optocouplers: you're trading photons for electrons, and that costs time.

Current transfer ratio and why it drifts

The CTR—current transfer ratio—tells you how much output current you get per milliamp of LED drive. A typical part might spec 50–200%, meaning 1 mA in gives you 0.5–2 mA out. That's a huge range, and it narrows as the LED ages or if you run it hot. If your circuit assumes the high end of that range and you got a part from the low bin, your pull-up might not pull down hard enough to register as logic low.

I always design assuming the minimum CTR and then verify with the actual part on the bench. Drive the LED with 5–10 mA if you can afford it; that keeps you comfortably above the threshold even as the part ages. If you're trying to squeeze by with 1 mA because you're counting microamps elsewhere, expect trouble. Optocouplers aren't precision parts—they're isolation first, signal fidelity second.

More on the power budgeting side of this in the LDO headroom post; the same drift that moves your rail can push your LED drive out of spec.

Test it under load, not just at turn-on

The other failure mode: your optocoupler works fine on the bench, then stops switching cleanly when the rest of the board draws current. Either your isolated supply sags under load and the pull-up can't finish the edge, or your ground reference shifts enough that the logic thresholds move. Both are subtle, and both show up as intermittent glitches that you'll chase for an afternoon.

I add a bulk cap on the isolated side—22–47 µF if there's room—and measure the rail during a full-load cycle. If it dips more than 100 mV, the pull-up resistor calculation changes. Sometimes the fix is a smaller pull-up, sometimes it's a stiffer supply. Either way, you want to know before the board ships or before you've soldered ten of them.

The edge shape also tells you whether your decoupling caps are close enough. If the rising edge has a staircase or a sag in the middle, the supply isn't keeping up with the pull-up's transient demand.

When to skip the optocoupler entirely

If you don't actually need kilovolts of isolation—maybe you're just breaking a ground loop or separating a noisy motor driver from your logic—consider a digital isolator instead. They're faster, more consistent, and easier to lay out. The cost delta is shrinking, and you won't spend an hour tweaking pull-up values.

But if you do need the isolation and the signal is slow enough, an optocoupler with a properly sized pull-up and adequate LED drive will work for years. Just don't assume the datasheet edge rate applies to your board, and measure the actual transition before you commit to the rest of the timing budget.

← Full log