Phototransistor: Preparation, Placement and Process Control
A phototransistor is a photodiode with a built in current gain, which makes it far easier to use than a plain photodiode and slower than one. The interface is a load resistor and often an amplifier, and the choice of that resistor sets the sensitivity, the speed and the dynamic range at once.
How the Device Behaves
Light absorbed in the base region generates a photocurrent, and the transistor amplifies it by its current gain. The result is a collector current between a hundred and a thousand times larger than the photocurrent of the same area in a diode.
That internal gain costs speed. The base region stores charge, and the stored charge has to be removed before the device turns off, which makes the turn off slower than the turn on and worsens as the device saturates.
The two terminal version has no base connection, and the three terminal version exposes the base so that it can be biased or used as a photodiode. The three terminal form is useful when the speed matters or when the sensitivity has to be reduced.
The load resistor and Its Effect
The load resistor converts the collector current into a voltage, and its value sets the sensitivity: a larger resistor gives a larger signal for the same light. It also sets the bandwidth, because the resistor and the output capacitance form the dominant time constant.
A useful approximation for an active load circuit is that the bandwidth is the gain bandwidth product of the device divided by the voltage gain of the stage. Making the signal larger with a bigger resistor therefore makes the response slower in proportion.
The resistor also sets the saturation point. With a large resistor and bright light, the transistor saturates, the collector voltage falls to near zero and the output stops changing, which limits the dynamic range at the top end.

Saturation and Recovery
Once the device is saturated, the stored base charge has to be removed before the collector voltage can rise. The recovery takes a time that depends on the resistor and on the amount of overdrive, and it can be hundreds of times longer than the rise.
In a digital application such as a light barrier this shows as a delay after the light is removed, and the delay grows if the light is bright. The remedy is to reduce the load resistor, to reduce the light with an aperture, or to use a photodiode with an amplifier instead.
Where the device is driven into saturation deliberately, a small base resistor or a Schottky clamp between the base and the collector prevents the charge from building up. The clamp costs sensitivity and restores the speed.
dark current and Its Meaning
dark current is the collector current with no light, and it behaves like the leakage of any transistor. It doubles roughly every ten degrees, which matters in a sensor that has to detect a small signal in a warm environment.
The dark current adds to the signal, so it appears as an offset. In a threshold application it shifts the switching point, and in an analog application it is removed by measuring the reading with the source off.
A dark current that is much larger than the datasheet value indicates either a high temperature or a damaged device. It is worth measuring with the light blocked and the device at its expected operating temperature, because that measurement separates a device fault from an optical one.

Using It as a Switch
In a digital application the phototransistor drives a comparator or a logic input, and the design is a matter of setting the threshold with enough margin. A resistor from the collector to the supply and a comparator with hysteresis is the whole circuit.
The threshold should be set from the two states measured under the actual illumination: the collector voltage with the beam clear and with it blocked. The midpoint of the two, with hysteresis of a fraction of the difference, is the reliable choice.
A Schmitt trigger input removes the need for an external comparator where the logic device has one. The hysteresis in the input stage is often enough to reject the noise from a long cable.
Ambient Light and Modulation
A phototransistor used as a proximity or beam sensor responds to the ambient as well as to its own source. In sunlight the ambient can be far larger than the signal, and the device saturates on the ambient alone.
Modulating the source and using a band pass amplifier removes the ambient, because a steady level produces no output. The modulation frequency should be chosen away from the mains and from the switching frequency of any converter nearby.
An optical filter over the device is the other measure. A filter that passes the wavelength of the source and blocks the visible band reduces the ambient by a large factor at the cost of some of the signal.
Layout and Shielding
Keep the load resistor close to the device and the trace to the amplifier short. The node is a high impedance point when the light is low, and a long trace picks up the electric field of everything nearby.
A guard ring around that node, or at least a ground trace beside it, reduces the coupling. The dark reading is the best indicator of a layout problem, and it should be checked with the source off and the board in its final state.
Where the device is at the end of a cable, the capacitance of the cable adds to the load capacitance and slows the response. A buffer amplifier at the device, or a photodiode with a transimpedance amplifier at the instrument, is the answer for a long connection. The general treatment of such a node is described in our guide to mixed signal board design.
Verification and Faults
Verify the device by measuring the collector voltage with the source on and off, at the intended distance and under the intended ambient. Those two numbers define the margin of the design and are the ones to record.
Check the response time with a fast light source such as an LED driven by a pulse generator. The rise and fall times measured at the collector show the effect of the load resistor and reveal saturation.
A sensor that works slowly and reliably in the laboratory and fails in a bright environment is usually saturating on the ambient. The release checks that keep such a sensor consistent are collected in our PCB design release checklist, the assembly points in judging PCB quality, and the measures that reduce interference in our guide to EMI suppression design principles.
FAQ
Why is the turn off slower than the turn on? Stored base charge. The device saturates and the charge has to be removed before the collector rises, so a smaller load resistor speeds it up.
How do I make a phototransistor faster? Reduce the load resistor, avoid saturation and use the three terminal device with a base resistor or a clamp.
Why does my sensor trigger in daylight? The ambient is larger than the signal and the device saturates. Modulate the source and add an optical filter.



