If you need to measure light intensity, detect a laser beam break, or build an optical encoder, the photodiode is your primary transducer. Unlike photoresistors (which are slow and temperature-dependent) or phototransistors (which have high gain but poor linearity and speed), a photodiode offers exceptional linearity, microsecond-level response times, and predictable temperature characteristics.

The short answer for 90% of hobbyist and prototyping builds: buy the Vishay BPW34. It costs roughly $0.60, covers visible to near-infrared (NIR) light, and has a large active area that forgives optical alignment errors. If you need high-speed data reception (like IRDA or remote controls), switch to the Osram SFH203 ($1.20). If you need extreme low-light sensitivity and don't care about speed, use the BPX65 ($2.50).

Bench Tip: Never use a photodiode in series with a simple pull-up resistor for precision work. The diode's junction capacitance changes with the voltage across it, causing severe non-linearity. Always use a transimpedance amplifier (TIA) to hold the diode at a constant voltage.

Symbol, Pinout, and How to Identify Terminals

A photodiode is a standard PN junction designed with a transparent window or lens. In circuit schematics, the symbol is identical to a regular diode (a triangle pointing at a vertical line), but with two small arrows pointing inward toward the junction, indicating incoming photons.

Physically, you will encounter three main package types:

  • Epoxy/Through-Hole (e.g., 5mm LED style): The longer lead is the Anode (A). The shorter lead is the Cathode (K). The Cathode side usually has a flat spot on the plastic rim.
  • TO-18 / TO-5 Metal Can (e.g., BPW34): Looking at the bottom, the case tab or the lead closest to the tab is the Cathode (K). The opposite lead is the Anode (A).
  • Surface Mount (SMD): Look for a silkscreen dot, a notch, or a green band on the package. This marker always designates the Cathode (K).

Because a photodiode generates current when light hits it, you must wire it correctly. In almost all readout circuits, you will reverse-bias the diode or hold it at zero bias, meaning the Cathode connects to the higher potential (or the op-amp's inverting input) and the Anode connects to the lower potential (or ground).

Biasing Modes: Photovoltaic vs. Photoconductive vs. Avalanche

How you bias the diode dictates its speed, noise floor, and dark current. Here is the operational breakdown to help you choose the right mode for your circuit.

Operation Mode Bias Voltage Current Range Speed (Bandwidth) Noise & Dark Current Best Application
Photovoltaic 0V (Zero Bias) pA to low nA Slow (Hz to low kHz) Lowest noise, zero dark current Precision light metering, spectrophotometry
Photoconductive -1V to -50V (Reverse) nA to µA Fast (kHz to MHz) Moderate noise, low dark current IR receivers, optical encoders, pulse oximeters
Avalanche (APD) -50V to -200V (High Reverse) µA to mA Ultra-fast (GHz) High noise, requires temp compensation LIDAR, single-photon counting, fiber optics

For standard DIY and embedded projects, photoconductive mode is the default. Applying a reverse voltage (e.g., 5V) widens the depletion region, which drastically reduces the diode's junction capacitance. Lower capacitance means the RC time constant of your readout circuit drops, allowing you to detect fast light pulses without smearing the signal.

Designing the Readout: A Complete Transimpedance Amplifier (TIA) Circuit

To convert the photodiode's microamp output into a usable voltage for an Arduino or ESP32 ADC, you need a Transimpedance Amplifier. Below is a complete, bench-tested design using the TI OPA380, an op-amp specifically optimized for low-noise, high-speed TIA applications.

Circuit Specifications & Component Values

  • Photodiode: Vishay BPW34 (or equivalent broadband Si diode)
  • Op-Amp: OPA380 (Single supply, 5V capable, low input bias current)
  • Bias Voltage: 5V applied to the Cathode
  • Feedback Resistor ($R_f$): 1 MΩ (Sets the gain: 1V output per 1µA of light current)
  • Feedback Capacitor ($C_f$): 2 pF (Critical for stability; compensates for the BPW34's ~60pF junction capacitance)
  • Reference Voltage ($V_{ref}$): 2.5V (Created via a 10kΩ/10kΩ voltage divider from the 5V rail, buffered by a spare op-amp channel if available, or decoupled with a 100nF cap)

Wiring the TIA

  1. Connect the BPW34 Cathode to the 5V rail.
  2. Connect the BPW34 Anode to the Inverting Input (-) of the OPA380.
  3. Connect the Non-Inverting Input (+) to your 2.5V $V_{ref}$.
  4. Place the 1 MΩ $R_f$ between the Inverting Input and the Output pin.
  5. Place the 2 pF $C_f$ in parallel with the 1 MΩ resistor.
  6. Connect the Op-Amp Output to your microcontroller's ADC pin.
Stability Warning: Do not skip the 2 pF feedback capacitor. A photodiode acts like a large capacitor in parallel with a current source. Without $C_f$ to introduce a zero in the feedback loop, the op-amp's phase margin will collapse, and your circuit will oscillate at high frequencies, pegging the output at the supply rail. For a deeper mathematical breakdown of pole-zero compensation, refer to All About Circuits' semiconductor guide.

How it works: In the dark, the BPW34 leaks about 2 nA (dark current). The output sits at roughly 2.5V - (2nA * 1MΩ) = 2.498V. When a bright light hits the diode, it generates 3 µA of current. The op-amp pulls its output low to keep the inverting input at 2.5V. The new output is 2.5V - (3µA * 1MΩ) = -0.5V. Since the OPA380 is on a single 5V supply, it will clip near 0V. If you need bidirectional swing, use a dual-supply op-amp or lower the $V_{ref}$ to 1.0V.

Bench Testing: How to Verify a Photodiode with a Multimeter

Photodiodes rarely fail unless subjected to extreme heat during soldering or overvoltage that punches through the junction. When they do fail, they typically short out or develop high leakage. Here is how to test one on the bench using a standard digital multimeter (DMM).

Test 1: The Diode Check (Forward Bias)

  1. Set your DMM to the Diode Test mode (the symbol with an arrow and a line).
  2. Place the red probe on the Anode and the black probe on the Cathode.
  3. Expected Reading: A visible-light silicon diode will read between 0.450V and 0.650V. An IR-optimized diode (like the SFH203) will read lower, typically 0.300V to 0.450V, due to its narrower bandgap.
  4. Reverse the probes (Red on Cathode, Black on Anode). It should read OL (Overload/Open).

Test 2: The Photo-Current Check (Reverse Bias)

  1. Set your DMM to the µA (microamp) current measurement range.
  2. Place the red probe on the Cathode and the black probe on the Anode (reverse biasing the diode through the meter's internal shunt).
  3. Cover the diode with your finger. The reading should drop to near zero (the dark current, usually <10 nA, which most DMMs can't resolve on the µA scale).
  4. Shine a bright LED flashlight or your phone's camera flash directly onto the diode.
  5. Expected Reading: The current should immediately jump into the 5 µA to 50 µA range, depending on the light intensity and the diode's active area.

Failure Modes: If the diode reads 0.000V in both directions during the diode test, the junction is shorted (throw it away). If it reads OL in both directions, it is open. If it reads a valid forward voltage but shows high current (>50 µA) in the dark during the reverse bias test, the junction is leaky and will ruin the noise floor of your TIA circuit.

Selection Decision Tree: Matching the Diode to the Photon Budget

Stop guessing which part to order. Use this decision matrix to lock in the exact part number for your next build based on your optical and electrical constraints.

If your application requires... And your speed/bandwidth needs are... Then select this exact part number Why this part wins
Broad spectrum (Visible + IR), general prototyping, beam breaks Low to Medium (<100 kHz) Vishay BPW34 Massive 7.5 mm² active area makes optical alignment trivial. High responsivity at 900nm. The undisputed king of general-purpose light sensing.
High-speed data, IR remote decoding, optical encoders High (1 MHz to 10 MHz) Osram SFH203 Small active area minimizes junction capacitance, allowing fast rise/fall times (~5ns). Optimized for 850-900nm IR.
Ultra-low light, precision colorimetry, slow integration Very Low (<1 kHz) BPX65 Extremely high sensitivity and large area. Best used in photovoltaic mode with a high-impedance electrometer op-amp.
UV flame detection, UV index monitoring Low to Medium GUVA-S12SD Standard silicon diodes are blind to UV. This GaN-based diode specifically targets the 240-320nm UV-B/UV-C spectrum.

If you are still unsure after reviewing your optical budget, default to the BPW34. It is cheap enough to buy in bulk, forgiving enough to test with a crude 3D-printed housing, and its datasheet provides extensive characterization graphs that make designing your TIA feedback network straightforward. Pair it with the OPA380 circuit above, and you will have a professional-grade optical sensor on your breadboard in under an hour.