A photodiode is a semiconductor device that converts incident light into a proportional electrical current. Unlike solar cells which are optimized to deliver raw power, photodiodes are optimized for linearity, speed, and precision measurement. If you are trying to read a photodiode by simply putting a resistor in series with it and measuring the voltage drop, you are likely suffering from severe non-linearity and temperature drift. To get reliable data into your microcontroller's ADC, you must understand junction capacitance, reverse-bias leakage, and transimpedance amplification.
This guide skips the abstract solid-state physics and goes straight to the bench: which part numbers to buy, how to bias them for your specific speed-to-noise tradeoff, and how to build a stable readout circuit.
The Core Photodiode Specs: Choosing Your Safe Defaults
Walking into a distributor's parametric search for photodiodes yields thousands of results. For 90% of hobbyist, IoT, and industrial prototyping applications, you only need to look at a handful of proven workhorses. When selecting a part, you are balancing peak wavelength (what color it sees best), dark current (the noise floor when it's pitch black), and junction capacitance (which dictates your maximum bandwidth).
| Part Number | Manufacturer | Peak Wavelength | Dark Current (Typ) | Junction Capacitance | Package / Form Factor | Approx. Cost |
|---|---|---|---|---|---|---|
| BPW34 | Vishay / OSRAM | 900 nm (NIR) | 2 nA | 72 pF (at 0V) | Through-hole / SMD | $0.80 |
| SFH203 | OSRAM | 850 nm (NIR) | 1 nA | 10 pF (at 5V) | 5mm Radial | $1.20 |
| BPW21R | Vishay | 565 nm (Visible Green) | 2 nA | 100 pF | TO-5 Metal Can | $2.50 |
| S1226-18BQ | Hamamatsu | 400 nm (UV/Violet) | 0.1 nA | 14 pF | Ceramic SMD | $15.00 |
Symbol, Pinout, and Biasing Regions
The schematic symbol for a photodiode is identical to a standard PN-junction diode, but with two arrows pointing inward toward the junction, indicating incoming photons. Physically, the Cathode (K) is typically the shorter lead, or the side marked with a dot or stripe on the SMD package. The Anode (A) is the longer lead.
How you wire those two pins determines your operating region. You have two choices, and they represent a strict tradeoff between noise and speed.
| Region | Bias Condition | Pros | Cons | Best Application |
|---|---|---|---|---|
| Photovoltaic | Zero Bias (0V across pins) | Zero dark current noise; excellent low-light precision. | High junction capacitance; very slow response time. | Precision light meters, spectrometers. |
| Photoconductive | Reverse Bias (e.g., Cathode to 5V, Anode to GND) | Depletes the junction, lowering capacitance; very fast. | Introduces dark current (shot noise); temperature sensitive. | Fiber optic receivers, LiDAR, high-speed encoders. |
A critical rule of thumb for reverse bias: dark current doubles for every 10°C rise in junction temperature. If you are operating a photoconductive circuit in a hot enclosure, your noise floor will rise exponentially. Always check the datasheet's temperature derating curve.
Building a Transimpedance Amplifier (TIA) Circuit
Because a photodiode acts as a current source, measuring voltage across a simple series resistor changes the voltage across the diode itself as light levels change. This ruins linearity. The industry-standard solution is a Transimpedance Amplifier (TIA), which uses an op-amp to hold the diode at a constant virtual ground while converting the current to a usable voltage.
Below is a complete, single-supply (5V) TIA circuit designed for a BPW34, yielding an output of 0V to 5V proportional to light intensity, ready for an ESP32 or Arduino ADC.
Component List & Values
- U1: OPA380 (Texas Instruments) - Low noise, high-speed TIA op-amp.
- D1: BPW34 Photodiode.
- Rf (Feedback Resistor): 1 MΩ (Sets the gain: Vout = I_photo × 1MΩ).
- Cf (Feedback Capacitor): 10 pF (Critical for phase margin/stability).
- R1, R2: 10 kΩ each (Creates a 2.5V virtual ground for single-supply operation).
- C_bypass: 100 nF ceramic (Across the 2.5V divider to ground).
Wiring & Assembly Steps
- Establish Virtual Ground: Connect R1 from 5V to the non-inverting input (+) of U1. Connect R2 from the non-inverting input to GND. Place C_bypass from the non-inverting input to GND to kill power supply noise.
- Wire the Diode (Photoconductive Mode): Connect the Cathode (K) of D1 to the 5V rail. Connect the Anode (A) of D1 to the inverting input (-) of U1. This applies a 2.5V reverse bias across the diode (5V at Cathode, 2.5V virtual ground at Anode).
- Close the Feedback Loop: Connect Rf (1 MΩ) between the inverting input (-) and the output pin of U1.
- Compensate for Stability: Solder Cf (10 pF) directly in parallel with Rf. Do not skip this capacitor. The BPW34 has 72pF of junction capacitance. Without Cf, that capacitance interacts with the 1 MΩ resistor to create a pole that will cause the OPA380 to oscillate violently at high frequencies.
- Read the Output: Connect the output pin of U1 to your microcontroller's ADC. In total darkness, the output will sit at 2.5V. As light hits the diode, current flows through Rf, and the output voltage will drop toward 0V (or rise, depending on your exact diode orientation and op-amp rail limits).
Bench Testing: How Photodiodes Fail and How to Test Them
Photodiodes are rugged, but they have two primary failure modes on the bench: ESD junction punch-through and thermal runaway from excessive reverse bias voltage.
When a junction is destroyed by electrostatic discharge, it typically fails as a dead short. If you apply too high of a reverse voltage (exceeding the breakdown voltage, usually around 30V to 60V for standard PIN diodes), the dark current spikes, the die heats up, and the junction melts, again resulting in a short or a massive leakage path.
Testing with a Digital Multimeter (DMM)
You can verify a photodiode's health in about 30 seconds using a standard DMM.
- Forward Bias Check (Diode Mode): Set your DMM to diode test mode. Place the red probe on the Anode and the black probe on the Cathode. A healthy silicon photodiode will read between 0.400V and 0.600V. If it reads 0.00V or OL (open), the junction is destroyed.
- Reverse Bias Check (Resistance Mode): Swap the probes (Red to Cathode, Black to Anode). Set the meter to the highest resistance range (usually 20 MΩ or higher). In a dark room, it should read OL (infinite resistance). If it reads a fixed low resistance (e.g., 500 Ω), the diode is shorted.
- The Flashlight Test: While still in resistance mode with the probes in reverse bias, shine a bright LED flashlight directly onto the diode's epoxy window. A healthy diode will show a massive drop in resistance (often down to a few hundred kΩ) as photons generate electron-hole pairs. If the resistance doesn't budge, the optical window is blocked or the junction is dead.
Selection Framework: Matching the Diode to the Application
When the BPW34 isn't the right tool, you need to know what to reach for next. Use this decision matrix to select the correct semiconductor architecture for your specific project constraints.
| Architecture | Speed / Bandwidth | Sensitivity / Gain | Bias Voltage Required | Choose This When... |
|---|---|---|---|---|
| Standard PN | Low (kHz) | Low (1x) | 0V to 5V | Building ambient light sensors, slow optical switches, or simple sun-trackers. |
| PIN Diode | High (MHz to GHz) | Low (1x) | 5V to 50V | Reading fiber optic data, high-speed rotary encoders, or LiDAR return pulses. |
| Avalanche (APD) | Very High (GHz) | High (Internal gain 10x-100x) | 50V to 400V+ | Detecting single photons, long-range time-of-flight (ToF) sensors, or medical imaging. |
| Schottky | Medium | Medium | 0V to 5V | You specifically need to detect UV light (silicon PN diodes block UV due to shallow penetration depth). |
For most makers and embedded engineers, the PIN diode (like the SFH203 or BPW34) is the ceiling of what you need. Avalanche Photodiodes (APDs) require highly regulated, low-noise high-voltage bias supplies that are generally impractical for standard microcontroller projects. Stick to PIN diodes, master the TIA layout, and your optical sensors will yield clean, linear data every time.






