
Use an infrared emitter paired with a photodiode for accurate object detection within a 10–15 cm range. Connect the emitter to a stable 5V supply and limit current with a 220Ω resistor to prevent overheating. The photodiode should face the emitter directly, with its output linked to a high-gain amplifier to detect subtle changes in reflected light.








