# 1. Light Sensor User Manual ## 1.1 Light Sensor Overview ### 1.1.1 Sensor Introduction This sensor detects ambient light intensity and is typically used to create interactive projects that respond to changes in light levels. Common applications include automatic street lighting systems, environmental monitoring systems etc. ### 1.1.2 Working Principle The sensor primarily consists of a QT523C photodiode and an LM358 chip (voltage comparator). During operation, the QT523C converts light signals into electrical signals, which are then transformed into a 0–5 V voltage and received by a data acquisition system via A/D conversion. The higher the ambient light intensity, the lower the output voltage. The LM358 implements a voltage comparator in the sensor, with a miniature potentiometer for manual threshold adjustment. When ambient light exceeds the threshold, LED1 on the sensor lights up and the OUT pin outputs a low logic level. Below the threshold, LED1 is off and OUT terminal outputs a high logic level. Adjust the potentiometer to set the threshold for the current environment. At this point, LED1 will be partially on, indicating that the sensor is at its highest sensitivity. ## 1.2 Precautions 1. Do not operate the sensor beyond its rated voltage range. 2. Do not use materials that transmit visible or infrared light as test objects. 3. Avoid exposing the sensor to strong light, and ensure the test object's light is not blocked. 4. Do not use the sensor in a humid environment. 5. Parameters such as sensitivity and trigger delay should be configured according to specific requirements and application scenarios. During debugging, sensitivity can be adjusted to accommodate different light intensities and ensure stable sensor operation. ## 1.3 Parameter Description For information about the chips used in this module, please refer to "**[Schematic](https://drive.google.com/drive/folders/1rg8to71kWTd59bipm5nIiRvVMH9KD8Ec?usp=sharing)**." ### 1.3.1 Pin Description | Pin | Pin Description | | :--: | :----------------------------------------------------------: | | 5V | Voltage Input | | GND | GND | | ADC | ADC outputs the detected brightness from 0 to 1023. The brighter the brightness, the smaller the value. | | OUT | Outputs a low logic level (0) when the detected value is below the threshold, and a high logic level (1) when the value exceeds the threshold. (The threshold is adjustable.) | ### 1.3.2 Specifications
Light Sensor
Parameter Name Specification Specifications
Voltage DC 5V
Current 5mA
Interface Type 5264-4AW
Pin Count 4
PWR Instruction Lighting up after powering
Size 50mmx20mm
LED1 Instruction LED1 illuminates when the ambient light intensity exceeds the set threshold.
Modular Installation: Compatible with LEGO series components.
## 1.4 Program outcome You can refer to the example tutorials and programs for each platform within this tutorial's directory. Here, the test results are demonstrated using the Arduino IDE as an example. The light sensor detects ambient light intensity. When the sensor diode is covered, the measured value exceeds 900, which is above the set threshold. In this state, LED1 on the sensor turns off, and the Serial Monitor displays 1. When the sensor diode is uncovered, the measured value falls below the threshold. Consequently, LED1 turns on, and the Serial Monitor displays 0.