Light becomes a voltage
Infrared on the phototransistor lets a current through it, and the 10 kΩ turns that current into SIGNAL: 0.1 mA makes 1 V, and VCC plays no part. VCC sets only the ceiling, about 0.4 V under it, where strong infrared pins the reading: about 2.9 V from 3V3 and 4.6 V from 5V. In the dark SIGNAL is within a millivolt of 0 V.
A current, then a voltage
A phototransistor is a transistor with a window. Infrared falling on it does what a current into the base does in an ordinary transistor: it lets current through from collector to emitter, and more light lets more through. On this board the collector sits on VCC and the emitter on SIGNAL, so that current comes out of SIGNAL and down the 10 kΩ to GND.
Move the slider. Below about 2 V the sum is Ohm's law and nothing else: the current times 10 kΩ. 0.1 mA makes 1 V, 0.05 mA makes 0.5 V. Switch VCC between 3V3 and 5V and nothing changes: this block is not a divider, and VCC is not in that sum.
The slider is the current, because that is what the maker specifies. Its test light is 1 mW per square centimetre of 940 nm infrared, and it makes at least 0.7 mA in this part, typically 2 mA. The irradiance under the drawing is that typical figure run backwards along a straight line: a guide, not a calibration.
VCC sets the ceiling
Push the slider to the right. SIGNAL stops at about 2.9 V with VCC on 3V3, about 4.6 V on 5V. The transistor needs a little voltage across itself, at most 0.4 V by its datasheet, and once SIGNAL is that close to VCC it has run out of room. More infrared changes nothing: the reading is pinned.
That is the reason VCC goes to your board's logic voltage. 3V3 beside an ESP32, an ESP32-S3 or a Pico keeps the ceiling under 3.3 V. 5V beside an Uno gives the whole of its 0 to 5 V range.
In the dark
With no infrared, the datasheet allows at most 100 nA through the transistor, which is 1 mV across 10 kΩ. So a covered sensor reads 0, or within a count or two of it, and the block takes almost nothing from VCC.
When it does not work
No. Below the ceiling the reading is the current times 10 kΩ, and the current is set by the infrared, not by VCC. 5V only raises the ceiling. On a 3.3 V board it also puts up to 4.6 V on a pin built for 3.3 V.
Only what the infrared lets through. In the dark, under 0.1 µA. At the ceiling, about 1.2 mA from 3V3 and about 3.1 mA from 5V, most of it through the red LED. Worked out, not measured.
Invisible, so the eye cannot judge it. It is the maker's test light, at 940 nm, and it makes 0.7 mA or more in this part, typically 2 mA. For a typical part that is past the ceiling from 3V3. Sunlight carries many times more.
Check the room is dark in infrared, not only to the eye: a warm filament bulb, a remote in use, sunlight round a curtain all count. With the dome covered, SIGNAL should be within a few millivolts of 0 V, which reads 0 on an ESP32.
Edit this page — content/books/ir-photodiode/light-becomes-a-voltage.mdx
Questions about this product
See what other owners have asked, and read their solutions.
Infrared Receiver
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.