
Overview
The sensor consists of an IR LED and a photo sensor (phototransistor). The light emitted by the IR LED gets reflected by any object placed in front of the sensor and this reflection is detected by the photo sensor (phototransistor). Any white (or lighter) colored surface reflects more than black (or darker) colored surface.
When the reflected light is detected, it produces Digital HIGH (or Binary 1) output on the Sig pin. The on-board LED indicator will also glow. If no reflection is detected or if the object is too far from the sensor, the output on the SIG pin stays at Digital LOW (Binary 0). The on-board LED indicator will be off as well.
The detectable range of this sensor is 4–16 mm. The module incorporates a Rail-to-Rail Operational Amplifier to amplify the output of phototransistor. There is a potentiometer which can be used to adjust the gain of the amplifier, that is, sensitivity of detection.
Get Inspired

An interactive polyphonic wavetable synthesiser for the Arduino GIGA & Display Shield

In a previous video about controlling household appliances and lighting fixtures from the Arduino Cloud, Sachin Soni of the techiesms YouTube channel designed a custom PCB that allows an Arduino Nano ESP32 to toggle a series of relays. But since then, he realized that his project needed a faster and more permanent method of getting to the controls, which led him to build a complete home automation dashboard using solely Arduino hardware. Soni opted for the new Arduino GIGA Display Shield since it contains a 3.97” RGB touchscreen with support for up to five simultaneous touch points and an array of sensors if the functionality were to ever be expanded. On the back, an Arduino GIGA R1 WiFi was attached to act as the display’s controller and leverage its Wi-Fi capabilities to communicate with the system’s Arduino Cloud variables. The final step in this project involved creating a software-defined graphical user interface (GUI) complete with toggleable buttons for the lights, dials to indicate temperature/humidity levels, and a way to select the fan’s speed from an array of values. Soni was able to finish most of the groundwork by utilizing the LVGL library and its highly customizable GUI components. After laying out the buttons and dials, synchronizing Cloud variables, and connecting their event handlers to value updates, Soni had a functional tablet that could wirelessly manage his appliances from anywhere.