Smart Grayscale Sensor for Analog Surface Reflection Detection The Smart Grayscale Sensor is an analog reflection module for detecting surface brightness, grayscale level, and color contrast. It combines a bright LED and a photoresistor-style sensing circuit so a controller can read different reflected light levels from paper, tabletops, tracks, or robot fields. Unlike a simple digital line sensor, this module gives a continuous analog value, allowing software thresholds and calibration for different lighting conditions. It is useful with Arduino analog inputs, ESP32 ADC pins, and the OpenELAB UNO R3 Intermediate Kit V2 for interactive color and line-following experiments. Use it when the project needs more nuance than black/white detection, such as grayscale sorting, robot football field detection, or adjustable line threshold learning. Technical Specifications Parameter Value Sensor type Analog grayscale / reflection sensor Light source High-brightness white LED Receiving element Photoresistor / LDR reflection circuit Output type Analog voltage Operating voltage 3.3 V / 5 V typical Connector 2.54 mm pitch 3-pin header Pinout GND, VCC, S Detection target Reflective surfaces with different grayscale levels Recommended distance Short fixed distance above target surface Calibration method Software threshold or ADC mapping Development support Arduino, ESP32, STM32, Raspberry Pi Pico ADC Board Layout & Label Guide White LED: Illuminates the target surface for stable reflection readings. Photoresistor area: Receives reflected light and changes circuit voltage. G pin: Power ground. V pin: 3.3 V or 5 V power input. S pin: Analog output to controller ADC. Mounting position: Keep height and angle consistent for repeatable readings. Ambient light note: Shield or recalibrate when room lighting changes. Application Scenarios 1. Grayscale Reading Read grayscale reflectance as an analog value and print it for calibration. const int SENSOR_PIN = A0; void setup() { Serial.begin(115200); } void loop() { int wetLevel = analogRead(SENSOR_PIN); Serial.print("wet_level="); Serial.println(wetLevel); delay(200); } 2. Adaptive Line Threshold Use a threshold to classify a dark line versus a light background for robot navigation. const int SENSOR_PIN = A0; const int OUTPUT_PIN = 8; const int WET_THRESHOLD = 500; void setup() { pinMode(OUTPUT_PIN, OUTPUT); } void loop() { int wetLevel = analogRead(SENSOR_PIN); digitalWrite(OUTPUT_PIN, wetLevel > WET_THRESHOLD ? HIGH : LOW); delay(100); } 3. Surface Sorting Logger Average readings to sort surfaces or materials by reflectance. const int SENSOR_PIN = A0; void setup() { Serial.begin(115200); } void loop() { long total = 0; for (int i = 0; i < 16; i++) { total += analogRead(SENSOR_PIN); delay(5); } Serial.print("average_wet_level="); Serial.println(total / 16); delay(1000); } Packing List 1 x Smart Grayscale Sensor FAQ Q: Can this module work with Arduino?A: Yes. Connect VCC, GND, and the signal pin to an Arduino-compatible board or an OpenELAB Sensor Shield V5. Q: Can it work with 3.3 V controllers?A: Yes for the listed 3.3 V to 5 V modules, but keep analog output within the controller ADC range. Q: Is calibration required?A: For threshold or quantitative use, calibrate in the final installation and record baseline readings. Q: Can I use long wires?A: Shorter wires are better for analog stability; use averaging in firmware if readings fluctuate. Q: Does the module output precise engineering units?A: Most of these modules provide relative analog or digital signals, not certified measurement data. Q: What should I check first if it does not trigger?A: Verify power, ground, pin mapping, threshold setting, and whether the signal is active-high or active-low. Q: Is it suitable outdoors?A: Only with enclosure protection. Keep connectors and electronics away from water and corrosion. Q: Can it drive a relay or motor directly?A: No. Use the module as an input to a controller, then drive a suitable relay or motor driver.