Optoelectronics Explainer — LEDs Backwards: How Silicon Sees Light
Text written by Claude Fable 5 (claude-fable-5).
Optoelectronics Explainer — LEDs Backwards: How Silicon Sees Light
This is the “before you build” companion to Projects 7–11, in the spirit of the NE555 explainer: it assumes solid-state basics at the “took one condensed-matter course once” level and no electronics. The goal: by the end, every part of the optointerrupter — and every wiring choice repeated across the five projects — should feel derivable rather than memorised.
One device, two halves
A slotted optointerrupter is two semiconductor junctions in a plastic U:
- an infrared LED (GaAs, ~940 nm) on one prong, always on;
- a phototransistor (silicon) on the other, staring at it across ~5 mm.
An LED and a photodetector are the same physics run in opposite directions. Forward-bias a junction and recombining electron–hole pairs emit photons with ; illuminate a junction and absorbed photons with create electron–hole pairs that the junction field sweeps apart into a measurable current. Emission and absorption across the same gap. (Ordinary LEDs really do work as photodiodes — a red LED into a voltmeter under a bright lamp shows tens to hundreds of mV. Fun desk demo.)
Why 940 nm
Three constraints intersect neatly:
- Silicon’s absorption window. Si has eV, i.e. an absorption edge at nm. Sensitivity peaks in the 800–950 nm range: photons energetic enough to be absorbed, but not so energetic that they’re absorbed within nanometres of the surface where recombination eats them.
- GaAs emits right there. eV → ~870 nm; with silicon doping, ~940 nm. Direct bandgap → efficient emission → the cheapest IR photons money can buy.
- Human eyes stop at ~700 nm, so the beam is invisible — which for our purposes (alarms, finish lines) is a feature, and for the child is magic.
The black plastic housing is itself a filter: opaque to visible light, translucent at 940 nm — it shades ambient light while passing the signal. The “straw over the phototransistor” trick in Project 8 is the same idea when you’ve thrown the housing away.
The detector family, by speed
The series meets three photodetectors; the physics cleanly predicts their speed ordering.
LDR (Project 6’s theremin — CdS photoresistor). Bulk photoconductivity: photons free carriers throughout the volume, raising conductivity . No junction, no field, no direction. Response is set by carrier generation/recombination and — the killer — slow trap states that hold carriers for long times. Result: big, cheap, polarity-free signal, but 10–100+ ms response and a memory effect (resistance depends on recent illumination history). Fine for “is a hand over it”; hopeless past ~10 Hz.
Photodiode. A reverse-biased junction. Absorption in or near the depletion region creates pairs; the built-in plus applied field sweeps them across in nanoseconds. Photocurrent is beautifully linear in flux (, quantum efficiency η ≈ 0.5–0.9) — this is why photodiodes are instruments while LDRs are gadgets. But the current is small: ~0.5 A/W, so μW of light → sub-μA.
Phototransistor (our part). A photodiode whose junction is the base–collector junction of a BJT, with the photocurrent injected where base current would go — so it gets multiplied by the transistor gain: , β ~ 100–500. Now mA of collector current from the optointerrupter’s few mW of IR — enough to switch things without further amplification. The price of the gain is speed: the collector–base capacitance is Miller-multiplied by β, giving μs-scale rise/fall instead of ns. The datasheet CTR (current transfer ratio, , often 5–30 % for slotted parts) packages the whole chain — LED efficiency, geometry, η, β — into one number you can design with.
The hierarchy — LDR ~10⁻¹ s, phototransistor ~10⁻⁵ s, photodiode ~10⁻⁹ s, each buying speed by giving up gain — is a textbook gain–bandwidth trade, and Project 9 sits exactly where it needs the middle option: kHz chopping is 5 orders too fast for the LDR and doesn’t need photodiode heroics.
The pull-up resistor, or: how a current becomes a logic level
The phototransistor is a light-controlled current sink; alone it outputs nothing. Put a resistor between it and the rail and Kirchhoff does the rest. With the common-emitter arrangement (Projects 7 and 9):
- Beam on: the part can sink far more than mA, so it saturates — node ≈ 0.2 V, logic LOW.
- Beam blocked: (dark current, nA) — node pulled to , logic HIGH.
Graphically: a load line of slope across the transistor’s output curves, with light as the parameter selecting the curve. The resistor value sets the compromise: larger R → switches on less light (more sensitive, and saturates more deeply) but slower (the node’s stray capacitance charges through R); smaller R → faster, needs more photocurrent. 10 kΩ suits everything in this series.
The two polarities used in Projects 7–11 are just the two places you can put the resistor:
| Wiring | Resistor | Beam on → node | Used when you want |
|---|---|---|---|
| Common-emitter (Proj. 7, 9) | pull-up above collector | LOW | blocked = active: alarms, click-per-spoke |
| Common-collector (Proj. 8, 10, 11) | pull-down below emitter | HIGH | light = active: armed race gates, hole = note, flash = count |
Same part, same physics; swapping the resistor’s position logically inverts the output. When a lesson says “if yours does the opposite, swap the legs,” this table is what’s really going on (that, or the collector/emitter were genuinely reversed — a phototransistor conducts weakly backwards, so a swapped part half-works confusingly rather than failing cleanly).
Dark side notes (the honest engineering)
- Ambient light is DC interference: sunlight is ~40 % near-IR, so a sunlit eye conducts with no beam at all. Defences, in increasing sophistication: shade it (the slot housing, the straw), raise the threshold, or — how real IR remotes and light barriers do it — modulate the emitter at ~38 kHz and band-pass the receiver, moving the signal away from DC entirely.
- Dark current (thermally generated pairs, ~nA, doubling every ~8 °C) is the noise floor; irrelevant at our mA signals, dominant for astronomers, which is why their silicon runs cold.
- The comparator modules: the LM393 boards just add a threshold-and- hysteresis stage after the same phototransistor + resistor divider — a crisper, adjustable version of what the 4017’s Schmitt input or the 555’s ⅓/⅔ thresholds already give you in Projects 8–11. Nothing new, only packaged.
The one-sentence summaries, per project
- 7 (alarm): junction photodetection is fast and directional; a pull-up turns it into logic; a 555 monostable stretches an edge into time.
- 8 (photo finish): the gate converts kinematics (50 ms of shadow) into one clean falling edge; the latch converts an edge into a persistent bit.
- 9 (speedometer): an encoder converts ω into frequency — the physicist’s favourite thing to measure — and only a junction detector is fast enough.
- 10 (punched card): the eye reads a 1-bit serial ROM whose clock is a human hand; gating pin 4 separates control path from signal path.
- 11 (counter): RC + Schmitt turns a mechanically messy blink into exactly one edge; five flip-flops in a ring turn edges into arithmetic.
← Back to Read Me First, or on to Project 7.