Component guide · Intermediate · 3 min read
Photodiodes, Phototransistors and Photointerrupters
How They Work and Wiring
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
A photodiode turns light into a small current and is the fastest light sensor. A phototransistor amplifies that current, giving a bigger signal but a slower response. A photointerrupter pairs an LED and phototransistor in one housing to detect a slot being blocked, which is used for RPM and position sensing. All three need correct wiring: reverse bias for photodiodes and a pull-up for phototransistors.
Key specs at a glance
- Photodiode
- Fast, linear, small current; needs an amplifier
- Phototransistor
- Higher output, slower, easy to read with a pull-up resistor
- Photointerrupter
- Transmissive (slot) or reflective type, digital or transistor output
- Wavelength
- Silicon peaks near 850 to 950 nm (near infrared)
- Supply
- 3.3 or 5 V for most
- Vs LDR
- Much faster than an LDR, less sensitive to ageing
Which light sensor
Choose by speed and signal level.
| Sensor | Speed | Output | Use for |
|---|---|---|---|
| LDR | Slow (tens of ms) | Resistance | Day and night switches; see LDR sensor |
| Photodiode | Very fast | Microamps | Optical communication, precise light measurement |
| Phototransistor | Fast enough for kHz | Larger current | IR detection, object sensing |
| Photointerrupter | Fast | Digital or transistor | RPM, end stops, encoders |
| Ambient light IC | Slow | Digital lux value | See ambient light sensors |
- LDR
- Speed:
- Slow (tens of ms)
- Output:
- Resistance
- Use for:
- Day and night switches; see LDR sensor
- Photodiode
- Speed:
- Very fast
- Output:
- Microamps
- Use for:
- Optical communication, precise light measurement
- Phototransistor
- Speed:
- Fast enough for kHz
- Output:
- Larger current
- Use for:
- IR detection, object sensing
- Photointerrupter
- Speed:
- Fast
- Output:
- Digital or transistor
- Use for:
- RPM, end stops, encoders
- Ambient light IC
- Speed:
- Slow
- Output:
- Digital lux value
- Use for:
- See ambient light sensors
Wiring each type
connect the collector to the supply through a 10 kΩ resistor and read the voltage at the collector; the emitter goes to ground. More light pulls the output lower. Adjust the resistor to change sensitivity.
reverse-bias it and use a transimpedance amplifier: the photodiode current flows through the op-amp feedback resistor and gives a voltage. A 1 MΩ feedback resistor gives about 1 V per µA. See op-amps.
drive the LED through a resistor (about 220 Ω at 5 V) and read the transistor output with a pull-up resistor. The output goes low when the slot is blocked.
Typical uses
place a slotted wheel in the gap of a photointerrupter and count pulses.
reflective sensors detect black and white lines under a robot.
a photodiode plus filter receives remote control signals (IR receivers).
a calibrated photodiode and amplifier measure relative light level.
Tips
Shield the sensor from stray light with a tube or black paint. Use a filter that passes infrared if you want to ignore visible light. Keep the leads short for photodiodes to reduce noise, and use a stable reference voltage for analog readings. Remember that sunlight is a strong source of infrared and can saturate IR sensors outdoors.
Try it: Opamp gain calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Reading a photodiode directly with an ADC pin and getting nothing.
- Wiring a photodiode forward biased.
- Using no pull-up on an open-collector photointerrupter.
- Mounting a slot sensor without enough alignment.
- Using IR sensors in direct sunlight.
Frequently asked questions
Photodiode or phototransistor?
Photodiodes are faster and more linear, but need an amplifier. Phototransistors give a larger signal and are easier.
Is a photointerrupter the same as an optocoupler?
Similar internal parts, but a photointerrupter has a gap for an object to pass through.
Can I use an LED as a sensor?
Yes, an LED produces a small current under light, but a real photodiode is far better.
What resistor for a phototransistor?
Start with 10 kΩ and adjust for the light level you need.
Do I need a lens?
For long distances, yes. A lens or tube narrows the view and increases sensitivity.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 34 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- Sharp and Vishay photointerrupter data sheets
- Texas Instruments application notes on photodiode amplifiers
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




