Reflective infrared sensor
[1] A reflective infrared (IR) sensor is a sensor detecting/measures surface colors by emitting invisible infrared light from an LED and measuring the amount of light bouncing back to the phototransistor/receiver.
[1] A reflective infrared (IR) sensor is a sensor detecting/measures surface colors by emitting invisible infrared light from an LED and measuring the amount of light bouncing back to the phototransistor/receiver.
[D1] Fig.
Infrared LED (emitter) continuously emits invisible IR light forward. In this case, it's the right component, the purple diode (Fig. 1).
Phototransistor (receiver) receives any IR light that bounces back off a surface. If light hits it, current flows between its collector and emitter proportional to the intensity of reflected light. In this case, it's the left component, the transistor (Fig. 1).
Built-in optical filters block visible light, while physical shielding prevents the emitter's light from directly bleeding into the receiver without reflecting off an object first.
[D1]
In this circuit, pin A0's voltage changes based on a given surface's reflectivity:
By detecting a white surface (high reflection) via the emitter facing the object, the light the infrared LED emitter constantly emits is reflected back by the white surface to the phototransistor receiver, turning it on (in saturation mode), current is grounded, the voltage on A0 drops to 0.2 V, and the microntroller reads a low integer value, often ~0.2V/5V x 1023 ≈ 41.
By detecting a black surface (low reflection) by the emitter, the black surface absorbs the emitted IR light, causing little light to reflect back to the receiver, turning it off (in cutoff mode), preventing current from flowing to ground, Pin A0 is caused pulled up to the supply, voltage rises to 4.9 V, causing the microcontroller to read nearly an integer of 4.9V/5V x 1023 ≈1002.54.
[D1]