A beam across a slot
The infrared LED shines across the slot into a phototransistor, which passes current while light reaches it. That current, through a 10 kΩ, drags the sensor's voltage down from VCC. An edge sliding across the window fades the light gradually, so the voltage slides too, and the block has to pick one point on that slide to call HIGH.
Light in, current out
A phototransistor is a transistor whose base is driven by light instead of a wire. In the dark it passes almost nothing: the sheet allows 100 nA at most. With the beam on it, it passes a small current, a few percent of what the LED on the other side takes.
On this board it hangs from VCC through R11, 10 kΩ. By Ohm's law each tenth of a milliamp it passes drops 1 V across that resistor. So the voltage where they meet, which this book calls the sensor's voltage, sits at VCC in the dark and falls as the light grows. That voltage goes to the comparator.
Slide the card's edge across the window. With the window clear, the sensor pulls its voltage well under half of VCC. Fully covered, it passes nothing and the voltage sits at VCC. In between, it slides.
The point that decides
The comparator calls it at one point: when the sensor's voltage crosses half of VCC. To be under that line, the sensor has to pass at least half of VCC over 10 kΩ: 0.17 mA from 3.3 V, 0.25 mA from 5 V. Less than that and the block reads HIGH, even with some light still getting through.
How much a given sensor passes with the slot clear is the one number this book cannot give you. The GK105A sheet tests it at 20 mA through the LED and promises at least 0.8 mA there. This board runs its LED at about 2 mA from 3.3 V and 4 mA from 5 V, a fifth or less of that, and the sheet's typical curves put the current at that level close to what the block needs. Parts vary a good deal; the owner's videos show the block switching cleanly, and the figure draws a pair with room to spare. If your block reads HIGH with the slot empty, when the count is wrong covers it.
Why the edge matters
The window each tower looks through is small; the sheet's drawing shows it about 0.7 mm wide. An edge only changes the light while it is crossing that window, so a disc turning quickly changes the light in a fraction of a millisecond and a card pushed in by hand takes much longer. A slow change spends a long time near the deciding point, and that is where the comparator can stumble.
When it does not work
Paper lets a surprising amount of infrared through, and so does clear or tinted plastic. Use card, a strip of metal, or anything that stops light when you hold it up to a lamp. Black plastic is not always opaque to infrared either.
Yes. The beam crosses the slot through small windows below the top of the towers. An object that only enters the top millimetre or two can miss the beam entirely. Push a card to the bottom and the block reads HIGH for certain.
No. The LED and the sensor are fixed in one housing, 5 mm apart, and the windows face only each other. For a gap of centimetres you need a separate emitter and receiver, such as the IR sender and receiver blocks.
How the slide becomes one clean HIGH or LOW, and why the LED lights when it is LOW.
The comparator and the light →Edit this page — content/books/ir-speed-sensor/a-beam-across-a-slot.mdx
Questions about this product
See what other owners have asked, and read their solutions.
Infrared Speed Sensor
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.