Tool 07 · Transistor Guide · Bipolar

CE

Phototransistor and optocoupler

An NPN whose collector-base junction is a photodiode: light makes a small current in the base, and the transistor multiplies it like a base current.

Controlled by
Light on the collector-base junction
With no drive
Off: it conducts only when driven
Fully on
A small fixed drop like the NPN's, at most 0.5 V in a 4N25 (2 mA, IFI_F = 50 mA)
Terminals
C collector, E emitter, B base (on some parts only)
Used for
Ambient-light sensing; Detecting an infrared LED or beam; Isolated signals, inside an optocoupler
01

How it works

A phototransistor is an NPN built so that light reaches its collector-base junction, which is made large and sits under a lens or a clear window. That junction is reverse biased, so it works as a photodiode: a photon absorbed in or near it creates an electron and a hole, and the junction's field sweeps the hole into the base and the electron into the collector. Those holes are exactly what a base current would bring. The photocurrent IphI_{ph} forward-biases the base-emitter junction, and the transistor multiplies it as the NPN multiplies a base current.

The standard device model, which the datasheets do not print, treats the photocurrent as a base current:

IC≈(β+1) Iph+ICEOI_C \approx (\beta + 1)\, I_{ph} + I_{CEO}

IphI_{ph} flows from the collector into the base, so the collector carries it plus β\beta times it, hence β+1\beta + 1. ICEOI_{CEO} is the dark current. The leakage ICBOI_{CBO} of the same junction enters the base the same way and is multiplied the same way, so ICEO≈(β+1) ICBOI_{CEO} \approx (\beta + 1)\, I_{CBO}. In practice a datasheet specifies the collector current at a stated light level, the light current, and a design works from that number: 15 to 70 µA at 20 lx for a TEPT4400 (sold in three sensitivity bins), about 200 µA typical at 100 lx. The lux (lx) measures light weighted by the eye's sensitivity; infrared parts are specified in mW/cm² instead.

Two leads or three

The TEPT4400 and the TEFT4300 bring out only the collector and the emitter: the base floats, and light is its only drive. The BPV11 brings the base out on a third lead, and the 4N25 optocoupler on pin 6. A resistor RBER_{BE} from that base to the emitter takes part of the photocurrent before the transistor gets any, about VBE/RBEV_{BE} / R_{BE}, so 6 µA for 100 kΩ. It costs sensitivity and buys speed, because the charge stored in the base now has a way out through RBER_{BE}; without it, that charge can only recombine or leave through the base-emitter junction. The leakage takes the same path, so the dark current is no longer multiplied.

Two ways to connect it

Like any transistor it needs a resistor RLR_L to turn its current into a voltage. In the common-emitter connection RLR_L runs from the supply to the collector, the emitter goes to ground, and the output is the collector: it falls as the light grows. In the common-collector connection the collector goes to the supply, RLR_L runs from the emitter to ground, and the output is the emitter: it rises with the light.

Both outputs follow from the drop across the resistor, until the transistor saturates:

CE: Vout=VCC−ICRLCC: Vout=ICRL\text{CE: } V_{out} = V_{CC} - I_C R_L \qquad \text{CC: } V_{out} = I_C R_L

Either way, enough light saturates it: the collector current can no longer grow, VCEV_{CE} sits at VCE(sat)V_{CE(sat)} and the output stops moving. A small RLR_L keeps it in the linear part, for a sensor that measures light. A large one makes it a light-operated switch.

Regions of operation

RegionLightWhat happensCommon-emitter outputUsed as
Dark (cutoff)noneonly the dark current ICEOI_{CEO} flows, nanoampsat VCCV_{CC}off state of a switch
Linear (active)moderateICI_C roughly in proportion to the light, set by the light and not by RLR_LVCC−ICRLV_{CC} - I_C R_L, follows the lightlight meter, analog link
Fully on (saturation)strongVCEV_{CE} down to VCE(sat)V_{CE(sat)}, ICI_C set by RLR_La few tenths of a voltlight switch, digital optocoupler

"Linear" here means the output follows the light in proportion: the BJT's active region. It has nothing to do with the MOSFET's "linear region", which is its fully-on, resistor-like state. And the "light current" of a datasheet is the collector current under light, not the photocurrent IphI_{ph}, which is β+1\beta + 1 times smaller.

Speed against sensitivity

Speed is where the phototransistor pays for its gain. Its collector-base junction is large to catch light, so its capacitance CCBC_{CB} is large: 19 pF (CCBOC_{CBO}) on the BPV11. In the common-emitter connection that capacitance sits between the output and the base, and the output moves many times more than the base does, so the base sees it multiplied: the Miller effect. Only the small photocurrent charges it, and with nothing else on the base, only the base-emitter junction discharges it. A bigger base area catches more light and adds more capacitance, so sensitivity and speed trade against each other.

The two Vishay infrared parts fit the pattern. Under the same test (5 V, ICI_C = 5 mA, RLR_L = 100 Ω) the TEFT4300, 0.8 to 3.2 mA at 1 mW/cm², turns on in 2 µs and off in 2.3 µs. The BPV11, 3 to 10 mA at 1 mW/cm², takes 6 µs and 5 µs. A 100 Ω load is chosen for speed: at 5 mA it gives only 0.5 V of output swing.

The optocoupler

An optocoupler puts an infrared LED and a phototransistor face to face in one package, separated by a clear insulator. Light is the only link: the input and the output share no conductor, so they can sit at very different voltages. That separation is galvanic isolation, rated 5000 V RMS for the 4N25. The input is an LED, driven through a series resistor like any LED. The output is a phototransistor, and everything above applies to it.

Its gain is the current transfer ratio, the collector current over the LED forward current IFI_F:

CTR=ICIF×100 %\text{CTR} = \frac{I_C}{I_F} \times 100\ \%

The 4N25 guarantees a CTR of at least 20 % at IFI_F = 10 mA and VCEV_{CE} = 10 V, typically 50 %: at least 2 mA out, typically 5 mA, for 10 mA in. The CTR lumps together the LED's efficiency, the share of its light that reaches the base and the transistor's gain, and it moves with IFI_F, VCEV_{CE} and temperature. The LED also dims as it ages, so the CTR falls over the years. Like β\beta, it is a minimum to design to, never a typical value to count on.

The simulator further down has no phototransistor, so light enters it as what it amounts to: a current into the base of an ordinary NPN (β=300\beta = 300), fed from the Light slider through 1 MΩ. Each volt above the 0.55 V or so the base sits at gives 1 µA, and about 1.6 µA saturates the transistor under its 10 kΩ pull-up. In the real part the photocurrent also flows in at the collector, hence β+1\beta + 1 instead of β\beta, a difference of 0.3 % here.

Dark current, temperature and colour

The dark current sets the faintest light a circuit can read. The TEPT4400 specifies 3 nA typical and 50 nA maximum at 5 V, against at least 15 µA at 20 lx: a ratio of 300 even for the least sensitive part with the worst leakage. The dark current rises with temperature and the light current drifts with it too (the datasheet's Figs. 2 and 3), so a sensor that must read faint light when hot is checked on both curves at its highest temperature.

Each part also has its own colour. The TEPT4400 peaks at 570 nm, close to the eye's response, which suits an ambient-light sensor. The TEFT4300 peaks at 925 nm and the BPV11 at 850 nm, in the infrared, to match infrared emitters.

Relatives

A photo-Darlington follows the phototransistor with a second transistor, as in the Darlington pair: the gain multiplies again, and so do the Darlington's faults, a saturation voltage of a VBEV_{BE} plus a VCE(sat)V_{CE(sat)} and a slower turn-off.

A photodiode is the light-sensing junction on its own, without the transistor: its current is the bare photocurrent, β+1\beta + 1 times smaller, and the Miller effect does not slow it. On a part with a base lead, using only the collector and the base turns the phototransistor into one.

02

The curves

interactive

The NPN's output curves, with the base current read as photocurrent: on a phototransistor each curve is one level of light. The model has β=150\beta = 150. The red line is the load line of RLR_L on the supply, and more light walks the point from dark, through the linear part, into saturation.

active: V_CE = 3.43 V, I_C = 1.57 mA, V_BE = 0.665 V, I_C / I_B = 157, P = 5.4 mW

The base current picks a curve and the curve is nearly flat: ICI_C is about βIB\beta I_B (β\beta about 150 here) whatever VCEV_{CE} does. The resistor turns that current into a voltage, which is how the transistor amplifies.

03

Circuits to try

Falstad's simulator, one at a time

Each circuit runs in Paul Falstad's CircuitJS, loaded only on request. The sliders are in the panel on the right of the simulator, switches toggle with a click, and hovering a part shows its voltages, currents and state at the bottom right.

Simulation

Phototransistor with a pull-up resistor

The simulator has no phototransistor, so the light is what it amounts to: a small current into the base, fed from the Light level slider through 1 MΩ: about 1 µA for each volt above the 0.55 V the base needs, so up to about 4.5 µA. A 10 kΩ pull-up on 5 V turns the collector current into an output voltage.

  1. Start in the dark (Light at 0) and read the output: 5 V.
  2. Raise Light slowly and watch the output fall, then hit the bottom.

What to see. In the dark only leakage flows and the output sits at the supply. Light makes base current that the transistor multiplies by β\beta, about 300 here, and the drop across 10 kΩ pulls the output down until the transistor saturates near 0.1 V. The bigger the pull-up, the less light it takes, and the slower the output, because the junction capacitance charges through it.

Open in the full simulator CircuitJS by Paul Falstad, loaded from falstad.com
04

Design rules

The load resistor decides: linear sensor or switch

The output stays linear as long as the strongest light cannot pull the transistor into saturation. It switches cleanly if the weakest light that must count as "on" already does.

linear: RL<VCC−VCE(sat)IC,maxswitch: RL>VCC−VCE(sat)IC,min\text{linear: } R_L < \frac{V_{CC} - V_{CE(sat)}}{I_{C,max}} \qquad \text{switch: } R_L > \frac{V_{CC} - V_{CE(sat)}}{I_{C,min}}

A TEPT4400 on 5 V, with VCE(sat)V_{CE(sat)} taken as 0.3 V. As a light meter up to 100 lx (200 µA typical): RL<4.7 V/200 μA=23.5R_L < 4.7\ \text{V} / 200\ \mu\text{A} = 23.5 kΩ, and 10 kΩ leaves room for a part 2.35 times more sensitive than typical. As a switch that must trip at 20 lx for every bin (15 µA at least): RL>4.7 V/15 μA=313R_L > 4.7\ \text{V} / 15\ \mu\text{A} = 313 kΩ, so 330 kΩ. In the dark, 50 nA of leakage drops only 16.5 mV across it. The same spread moves the threshold: a part from the most sensitive bin, 70 µA at 20 lx, already draws the 14 µA that saturates it near 4 lx, if its current scales with the light. A switch that must trip at a set light level needs parts from one bin, or a trimmer in place of the fixed resistor.

Speed costs sensitivity

Vishay's application note on faster couplers ranks what sets the switching time of a phototransistor, from the strongest effect to the weakest:

  1. The load resistor: smaller is faster.
  2. A base-emitter resistor RBER_{BE}, on parts with a base lead: it speeds the part up and costs sensitivity.
  3. The gain hFEh_{FE}.
  4. The junction capacitance.
  5. The connection: common-collector escapes the Miller effect, but only when the base has its own path to ground, such as 100 kΩ from the base pin. With the base open, both connections switch at the same speed.
  6. The speed of the LED, which hardly matters.

The load resistor matters most because the output swing, ICRLI_C R_L, is a swing of VCBV_{CB} too, and the photocurrent, β+1\beta + 1 times smaller than ICI_C, must move the charge of CCBC_{CB} through all of it. The time constant τ\tau grows in step with RLR_L and does not depend on the light:

τ≈(β+1) RL CCB\tau \approx (\beta + 1)\, R_L\, C_{CB}

For a BPV11 (β\beta about 450, CCBOC_{CBO} = 19 pF) this term alone gives 0.86 µs at 100 Ω, where the datasheet measures 6 µs, and 86 µs at 10 kΩ. The datasheet times come from a 100 Ω load: about 2 µs for the rise and fall of a 4N25. A 4N25 that delivers 2 mA and must swing 4.5 V for a logic input needs RLR_L = 2.25 kΩ at least, more than 20 times the test load, and its edges come out slower than the table says. When speed matters, RBER_{BE} on the base pin buys some of it back. The common-collector connection helps only with a resistor from the base pin to ground; on a two-lead part, or with the base open, it changes nothing.

An optocoupler is designed to its minimum CTR, with margin

IC,min=CTRmin IFRL≥VCC−VCE(sat)IC,minI_{C,min} = \text{CTR}_{min}\, I_F \qquad R_L \ge \frac{V_{CC} - V_{CE(sat)}}{I_{C,min}}

A 4N25 at IFI_F = 10 mA: the minimum CTR of 20 % guarantees 2 mA on a new part, where the typical 50 % suggests 5 mA. A design that needs 5 mA works on the bench and fails on the next part. The LED dims with age and the CTR moves with temperature, so the design also keeps a margin under the 2 mA. Planning on half of it, 1 mA, a 5 V pull-up needs RL≥(5−0.5) V/1 mA=4.5R_L \ge (5 - 0.5)\ \text{V} / 1\ \text{mA} = 4.5 kΩ, so 4.7 kΩ or more.

A worked optocoupler input: LED resistor and pull-up

A 0 to 15 V signal from the lab supply has to reach a 5 V logic input, isolated. The LED gets about 10 mA, the current the CTR is specified at.

RF=Vin−VFIF=15−1.210 mA=1.38 kΩR_F = \frac{V_{in} - V_F}{I_F} = \frac{15 - 1.2}{10\ \text{mA}} = 1.38\ \text{k}\Omega

VFV_F is taken as 1.2 V for the infrared LED (the exact value is on the datasheet): against 15 V, an error of 0.3 V moves IFI_F by only 2 %. The E12 value 1.2 kΩ gives 11.5 mA. On the output side, a 10 kΩ pull-up to 5 V needs (5−0.5) V/10 kΩ=0.45(5 - 0.5)\ \text{V} / 10\ \text{k}\Omega = 0.45 mA to bring the output under 0.5 V. That is a CTR of 3.9 %, close to the 4 % (2 mA for 50 mA) at which the datasheet guarantees the 0.5 V, and the 2 mA a new part guarantees is 4.4 times what it needs: room for years of ageing. The output is low when the input is high: the stage inverts. A signal that can swing negative, such as a TL082 output on ±15 V, would reverse-bias the LED far past the few volts it tolerates (the figure is on the datasheet). A 1N4148 across the LED, its cathode on the LED's anode, clamps the reverse voltage near 0.7 V, and the same series resistor limits its current.

The TEPT4400 survives only 6 V

In the dark the transistor is off and the whole supply sits across it, so the supply must stay below VCEOV_{CEO}. The TEPT4400's VCEOV_{CEO} is 6 V: it belongs on 5 V. On the lab's 15 V rail it would see 2.5 times its rating, where the TEFT4300 and the BPV11 are rated 70 V. The TEPT4400 also allows only 1.5 V in reverse (VECOV_{ECO}), 20 mA and 100 mW.

The supply limit, and the most power a load resistor lets into the part, at VCE=VCC/2V_{CE} = V_{CC} / 2:

VCC<VCEOPmax=VCC24RLV_{CC} < V_{CEO} \qquad P_{max} = \frac{V_{CC}^2}{4 R_L}

With RLR_L = 1 kΩ on 5 V the transistor never dissipates more than 6.25 mW and never carries more than VCC/RLV_{CC} / R_L = 5 mA, well inside 100 mW and 20 mA.

05

Real parts and their datasheets

Pinouts as seen from the front, legs down. Every value comes with the condition it is measured at: a number from a datasheet means nothing without it.

T-1 (3 mm)
Two leads, collector and emitter. The base has no lead: light is its only drive.

The package drawing puts E over the longer lead and C over the shorter one. It is not stated in words, so check before powering; reversed, the part survives only 1.5 V.

TEPT4400

NPN phototransistor, ambient light

Vishay, T-1 (3 mm), two leads. Datasheet (PDF), vishay.com

LineValueMeasured at
Light current, IPCEI_{PCE}15 to 70 µAEv=20E_v = 20 lx, CIE illuminant A, VCE=5V_{CE} = 5 V; bins A 15 to 28.4, B 23.5 to 44.6, C 36.9 to 70 µA
Light current, IPCEI_{PCE}200 µA typEv=100E_v = 100 lx, CIE illuminant A, VCE=5V_{CE} = 5 V
Dark current, ICEOI_{CEO}50 nA max (3 typ)VCE=5V_{CE} = 5 V, no light
VCEOV_{CEO}6 V maxabsolute maximum
VECOV_{ECO}1.5 V maxreverse, emitter to collector
ICI_C20 mA maxabsolute maximum
PVP_V100 mW maxTamb≤55T_{amb} \le 55 °C, absolute maximum
RthJAR_{thJA}300 K/Wjunction to ambient; TjT_j 100 °C max
λp\lambda_p570 nmpeak sensitivity, close to the eye

What to read first. The light current at 20 lx first: the three bins span 15 to 70 µA, so a design works from 15 µA. Then VCEOV_{CEO}, only 6 V: the part belongs on 5 V, never across the 15 V rail.

DIP-6
Top view, pin 1 at the dot. LED side: 1 anode, 2 cathode, 3 not connected. Transistor side: 4 emitter, 5 collector, 6 base.

Pin 6 is usually left open; a resistor to pin 4 trades sensitivity for speed.

4N25

Optocoupler, phototransistor output

Vishay, DIP-6. Datasheet (PDF), vishay.com

LineValueMeasured at
CTR20 % min (50 typ)IF=10I_F = 10 mA, VCE=10V_{CE} = 10 V
VCE(sat)V_{CE(sat)}0.5 V maxIC=2I_C = 2 mA, IF=50I_F = 50 mA
trt_r, tft_f2 µs typVCE=10V_{CE} = 10 V, IF=10I_F = 10 mA, RL=100R_L = 100 Ω
BVCEOBV_{CEO}30 V minIC=1I_C = 1 mA (the absolute maximum table says 70 V)
IFI_F60 mA maxLED, absolute maximum
VFV_F1.5 V max (1.3 typ)LED, IF=50I_F = 50 mA
Dark current, ICEOI_{CEO}50 nA max (5 typ)VCE=10V_{CE} = 10 V, base open, LED off
VISOV_{ISO}5000 V RMSinput to output, Vishay isolation test (JEDEC registered value: 2500 V)

What to read first. The CTR first: 20 % is the guaranteed minimum at 10 mA and 10 V, 50 % only typical, and it shifts with temperature and drops in saturation (Figs. 2 to 5). Then the tested BVCEOBV_{CEO} of 30 V, which is the output voltage to design to, not the 70 V of the absolute maximum table.

06

On the bench

Meter check. On a part with a base lead the transistor reads like an NPN on the diode range: red lead on the base (pin 6 of the 4N25), about 0.6 to 0.7 V to the emitter (pin 4) and to the collector (pin 5), nothing with the leads swapped. The 4N25's LED, anode on pin 1 and cathode on pin 2, reads a forward drop with the red lead on pin 1 and nothing the other way. A two-lead part has no junction the meter can reach alone, and the TEPT4400 allows only 1.5 V in reverse, so it stays off the diode range: the datasheet drawing is the only reference for its leads.

First build. A TEPT4400 with a 10 kΩ pull-up on 5 V, emitter to ground, the meter from collector to ground. Expected, from the datasheet light currents: close to 5 V with the window covered, 4.3 to 4.85 V at 20 lx depending on the bin, about 3 V at 100 lx for a typical part, and a few tenths of a volt when a lamp close by saturates it.

Then the optocoupler. The worked input above: a 4N25 with 1.2 kΩ from the 15 V input to the LED anode (pin 1), the LED cathode (pin 2) to the input's ground, 10 kΩ from 5 V to the collector (pin 5) and the emitter (pin 4) to the output's ground; pin 3 is not connected. With the input at 15 V the output reads under 0.5 V and the LED takes about 11.5 mA; at 0 V the output reads 5 V. With the pull-up replaced by the meter on its mA range, the reading is ICI_C at VCEV_{CE} = 5 V, and IC/IFI_C / I_F is the part's CTR: at least 20 % and typically about 50 % for a new part, figures specified at 10 mA and 10 V.

07

Common traps

  • The light powers the output current.

    The light only makes a small current in the base. The collector current comes from the supply through RLR_L, enabled by that base current, as in the NPN.

  • The typical light current or CTR is the value to design with.

    Both spread widely: the TEPT4400 is sold in three bins from 15 to 70 µA at 20 lx, and a 4N25's CTR is at least 20 % but typically 50 %. The CTR also falls as the LED ages. A design uses the minimum, with margin.

  • The switching time on the datasheet holds in any circuit.

    It is measured with a 100 Ω load. The load resistor is the biggest factor in the speed, and a 10 kΩ pull-up makes the same part slower.

  • The spare base pin of an optocoupler should be grounded like an unused input.

    Tying the base to the emitter shunts the photocurrent past the base-emitter junction: the transistor never turns on, and only the bare photocurrent, β+1\beta + 1 times smaller, reaches the output. Left open, the base gives the most sensitivity; a resistor RBER_{BE} to the emitter trades some of it for speed.

  • A phototransistor sees the light the eye sees.

    Only parts like the TEPT4400 (peak at 570 nm) follow the eye. The TEFT4300 (925 nm) and the BPV11 (850 nm) peak in the infrared, made for infrared emitters.

  • In the dark the output sits exactly at the supply.

    The dark current still flows, up to 50 nA at 5 V for a TEPT4400, and more when hot. Across a large pull-up it becomes a measurable drop: 16.5 mV across 330 kΩ, more as the part warms.

08

Check yourself

answers fold out
  1. A TEPT4400 has a 10 kΩ pull-up on 5 V. What does the output read at 20 lx, for a part from any of the three bins?

    Answer

    The light current is 15 to 70 µA at 20 lx, so the drop across 10 kΩ is 0.15 to 0.7 V and the output reads 4.3 to 4.85 V. That is almost a factor of five between parts: a sensor that must read lux accurately needs a calibration, or parts from one bin.

  2. A 4N25 runs at IFI_F = 10 mA into a 2.2 kΩ pull-up on 5 V. Is a low output under 0.5 V guaranteed?

    Answer

    No. Pulling the output down to 0.5 V takes (5−0.5) V/2.2 kΩ=2.05(5 - 0.5)\ \text{V} / 2.2\ \text{k}\Omega = 2.05 mA, and the minimum CTR of 20 % guarantees only 2 mA, on a new part, before any ageing. A 10 kΩ pull-up needs only 0.45 mA and leaves a fourfold margin.

  3. A phototransistor has its collector on 5 V and 10 kΩ from its emitter to ground. Which way does the output move with light, and what does it read at ICI_C = 200 µA?

    Answer

    This is the common-collector connection: the output is the emitter and rises with light, Vout=ICRL=200 μA×10 kΩ=2V_{out} = I_C R_L = 200\ \mu\text{A} \times 10\ \text{k}\Omega = 2 V. It tops out near 5 V−VCE(sat)5\ \text{V} - V_{CE(sat)}. It is no faster than the common-emitter connection: with the base open, the same current flows around the same loop of supply, transistor and resistor, and only the node taken as the output changes. Vishay's Application Note 41 measures the two at the same speed with the base open (Fig. 26).