A phototransistor is a light-sensitive bipolar junction transistor (BJT) where incident photons on the base-collector junction generate base current, amplifying the optical signal into a usable collector current. If you are asking what is a phototransistor in practical terms: it is an optical switch or analog light sensor that provides internal current gain (typically 100x to 1000x). Unlike a raw photodiode, which outputs microamps of current and requires a transimpedance amplifier, a phototransistor outputs milliamps, allowing it to interface directly with microcontroller GPIO pins, logic gates, or relay drivers.
What Is a Phototransistor and How Does It Actually Work?
On a schematic, the phototransistor symbol looks like a standard NPN BJT, but the base lead is replaced by two inward-pointing arrows representing incident light. In a standard 3mm or 5mm through-hole epoxy package, the pinout is straightforward: the shorter lead is the Emitter (E) and the longer lead is the Collector (C). The base is usually left unconnected internally, though some specialized packages bring it out as a third pin to allow for electrical bias offset.
When light (usually infrared) strikes the reverse-biased base-collector junction, it excites electrons, creating electron-hole pairs. This photocurrent acts exactly like a traditional base current ($I_B$). The transistor then amplifies this current by its DC current gain ($h_{FE}$ or $\beta$), yielding a much larger collector current ($I_C$). This internal gain is why phototransistors are vastly more sensitive than photodiodes, though they trade off switching speed to get it. While a photodiode can switch in nanoseconds, a standard phototransistor typically switches in microseconds—plenty fast for slot sensors, encoders, and limit switches, but too slow for high-speed IR remote data decoding.
Operation Regions and Biasing for Real Circuits
To use this component effectively, you must bias it correctly for your desired operation region. Phototransistors are almost exclusively used in the common-emitter configuration (Emitter to GND, Collector pulled up to $V_{CC}$ via a load resistor) for digital switching, or common-collector (Emitter follower) for analog sensing.
| Region | Light State | $V_{CE}$ (Collector-Emitter Voltage) | $I_C$ (Collector Current) | Primary Use Case |
|---|---|---|---|---|
| Cutoff | Dark (No illumination) | $\approx V_{CC}$ (e.g., 5.0V) | $I_{CEO}$ (Dark current, typically < 100nA) | Digital HIGH state, open slot sensor |
| Active | Partial illumination | Between $V_{CE(sat)}$ and $V_{CC}$ | Proportional to light intensity ($\mu$A to low mA) | Analog lux sensing, smoke detectors |
| Saturation | Fully illuminated | $V_{CE(sat)}$ (typically 0.2V to 0.4V) | Limited by external load resistor ($I_{C(sat)}$) | Digital LOW state, closed slot sensor |
The load resistor ($R_L$) dictates your saturation current. If $R_L$ is too high (e.g., 100k$\Omega$), the transistor might not pull the voltage all the way down to a valid logic LOW because the tiny dark/leakage current creates a voltage drop across the resistor. If $R_L$ is too low (e.g., 100$\Omega$), the phototransistor may not be able to source enough current to saturate, leaving $V_{CE}$ stuck in the active region. A 4.7k$\Omega$ to 10k$\Omega$ pull-up is the sweet spot for 5V and 3.3V logic.
The Go-To Application Circuit: 5V Digital Optical Interrupter
Let us build a reliable, noise-immune optical interrupter (break-beam sensor) for a 5V Arduino or ESP32. This circuit uses an IR LED as the emitter and a phototransistor as the receiver. When an object breaks the beam, the GPIO pin reads HIGH; when the beam is unbroken, it reads LOW.
Component List
- Emitter: TSAL6200 (940nm IR LED, $V_F = 1.2V$, max $I_F = 100mA$)
- Receiver: LTR-3208E (Side-looking NPN phototransistor)
- $R_1$ (LED Current Limit): 220$\Omega$ (1/4W)
- $R_2$ (Pull-up Load): 4.7k$\Omega$ (1/4W)
- $C_1$ (Decoupling): 100nF ceramic capacitor
Wiring Steps
- Emitter Side: Connect the anode (long lead) of the TSAL6200 to $V_{CC}$ (5V) through the 220$\Omega$ resistor. This limits the forward current to roughly 17mA ($I = (5V - 1.2V) / 220\Omega$), well within safe limits and bright enough to saturate the receiver across a 10mm gap.
- Emitter Ground: Connect the cathode (short lead) of the IR LED directly to GND.
- Receiver Side: Connect the Collector (long lead) of the LTR-3208E to $V_{CC}$ (5V) through the 4.7k$\Omega$ pull-up resistor.
- Receiver Ground: Connect the Emitter (short lead) directly to GND.
- Signal Output: Connect your microcontroller GPIO to the junction of the Collector and the 4.7k$\Omega$ resistor. Configure the GPIO as a standard
INPUT(the 4.7k resistor acts as the pull-up, so internal pull-ups are unnecessary). - Decoupling: Place the 100nF capacitor physically close to the phototransistor across the 5V and GND rails to filter out high-frequency EMI that can cause false triggers in long wire runs.
Decision Tree: Which Phototransistor Should You Buy?
Do not just grab the first opto-device you find on DigiKey. Match the component to the physics of your application using this decision path.
| If your application requires... | Then you should select... | Concrete Part Pick |
|---|---|---|
| High-speed data reception (e.g., decoding NEC/Sony IR remote protocols at 38kHz) | An integrated IR receiver module with an internal AGC and bandpass filter. Raw phototransistors are too slow and lack noise rejection. | TSOP38238 (Vishay) |
| Precise analog ambient light sensing (lux measurement for display backlighting) | A dedicated Ambient Light Sensor (ALS) IC with an I2C interface, or a photodiode with a transimpedance op-amp. Phototransistors have non-linear temperature drift. | OPT3001 (Texas Instruments) |
| A digital slot sensor, encoder wheel, or limit switch (object detection) | A raw NPN phototransistor. Side-looking packages are best for PCB-mounted slot gaps; top-looking are best for reflective surface sensing. | LTR-3208E (Side-looking) or PT334-6C (Top-looking) |
Failure Modes and Multimeter Testing
Phototransistors are rugged, but they do fail. The most common failure mode on the bench is epoxy yellowing and micro-cracking from prolonged UV exposure or thermal cycling during wave soldering, which attenuates IR transmission. The second is lead fatigue at the epoxy-to-metal seal, causing intermittent open circuits. Catastrophic thermal runaway is rare unless you accidentally wire the collector to a low-impedance voltage source without a load resistor.
You can verify a phototransistor on the bench in 60 seconds using a standard digital multimeter (DMM) and an IR source (like a TV remote or IR flashlight).
Step-by-Step DMM Test
- Set your DMM to Diode Test mode.
- Identify the leads: Longer is Collector (C), shorter is Emitter (E).
- Place the Red probe on the Collector and the Black probe on the Emitter. This reverse-biases the junction.
- Cover the lens with your finger to block ambient light. The DMM should read "OL" (Open Loop), indicating the dark current is too low to register.
- Uncover the lens and shine a bright IR flashlight (or press a button on an IR remote) directly at the epoxy dome.
- The DMM reading should immediately drop to a voltage between 0.3V and 1.5V, indicating the junction is conducting photocurrent. If it stays "OL" under bright IR, the junction is dead or the internal bond wire has snapped.
Safe Default Part Numbers and Spec Sheet Data
When you need to populate a BOM for a generic optical switch and do not have time to simulate edge cases, rely on these industry-standard defaults. They are widely available, cheap (under $0.15 in volume), and have well-documented footprint libraries in KiCad and Altium.
| Part Number | Manufacturer | Package / Viewing Angle | $V_{CEO(max)}$ | $I_{C(max)}$ | Peak Wavelength | Dark Current ($I_{CEO}$) |
|---|---|---|---|---|---|---|
| PT334-6C | Everlight | 5mm Round / Top-looking (25°) | 30V | 20mA | 940nm | 100nA (max) |
| LTR-3208E | Lite-On | 3mm Rectangular / Side-looking | 30V | 20mA | 940nm | 100nA (max) |
| TEFT4300 | Vishay | 3mm Round / Top-looking (50°) | 70V | 50mA | 920nm | 200nA (max) |
For deeper theoretical modeling of junction capacitance and rise/fall times, refer to the Electronics Tutorials guide on phototransistors. If you are designing for harsh industrial environments, review Vishay's optical sensor application notes for derating curves at elevated ambient temperatures. For practical breadboarding and mechanical alignment tips for break-beam sensors, the Adafruit IR Breakbeam Sensor tutorial remains an excellent bench reference.
Stop guessing with optocouplers and photodiodes when a simple optical switch is all you need. Buy the LTR-3208E for your next PCB slot sensor, use a 4.7k$\Omega$ pull-up, and your microcontroller will read a clean, bounce-free digital signal every time.






