[3] An QRD1114 reflective sensor
[3] An QRD1114 reflective 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.
[D1] Fig. 1 This diagram features an Arduino microcontroller's analog pin A0 connected to the sensor's phototransistor (receiver)'s collector terminal to actively read the voltage from it.
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.
For a IC/component like the QRD1114 reflective sensor, its pins located as follows:
The sensor's phototransistor receiver can be identified by its dark surface to detect the emitted IR light, thus the receiver's collector and emitter are on that side.
The sensor's IR emitter can be identified by its white surface, thus the cathode and anode are on that side, either upside down depending on the component's position.
[D1] A reflective IR sensor like the QRD1114 with its terminals labeled.
[D1] Schematic diagram of a reflective IR sensor like the QRD1114
[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]