
01Basic Understanding
Model:HS-S20PName:Ambient Light SensorSeries:SensorDescription:This is a sensor device designed specifically for detecting ambient light intensity, equipped with a light-sensitive element(such as a photoresistor or photodiode), which can convert ambient light signals into electrical signals, providing real-time feedback on light intensity changes, enabling devices to have the ability to “perceive light”.Usage Scenarios:Linking curtains and lighting systems to automatically adjust brightness(such as dimming lights during the day and turning them on at night)(Smart Furniture)Monitoring light intensity in greenhouses, controlling supplementary lighting to ensure crop photosynthesis(Agricultural Greenhouses),working with cameras to achieve a “daytime dormant, nighttime active” mode(Security Devices)and other scenarios; aligning withAI Education in Primary and Secondary Schools, in accordance withthe “Guidelines for Artificial Intelligence General Education in Primary and Secondary Schools (2025 Edition)”,by building light-controlled devices(such as automatic street lights), cultivating students’ practical abilities in light signal perception and automation control.Subject Integration:Physics, Biology, Labor, Information TechnologyEthical Education:Discussing sensor misjudgments(such as false triggers from strong light on cloudy days)and their impact on energy consumption(such as unnecessary lighting being turned on); analyzing the technical limitations and ecological protection responsibilities in urban light pollution monitoring(such as interference with nocturnal wildlife); exploring the privacy boundaries of lighting data in public areas(such as inferring human activity from brightness changes).
02Technical Parameters
Photoelectric Conversion:
After the light-sensitive element receives ambient light, its resistance value changes with light intensity(the stronger the light, the lower the resistance), converting the resistance change into a voltage signal through the circuit;Signal Processing:Built-in signal conditioning circuit, simultaneously outputting analog signals(which vary linearly with light intensity)and digital signals(threshold-triggered high and low levels, such as strong light/weak light judgment).
Parameter Analysis:
G(GND): Power input negative/cathode
V(VCC):Power input positive/anode
S(Signal):Signal output interfaceDetection Range: 0-10000lux (covering indoor low light to outdoor strong light)Response Time: ≤20msSpectral Response: 400-700nm (close to the visible light range of the human eye)03Code Example
The connection pin is analog A0.
Note: Students should pay attention to the effect of the light source angle on the values.
04Safety Measures
1.Always operate with power off when wiring, confirm the positive and negative terminals of VCC and GND, reverse connection may cause internal circuit damage.;
2.Strictly control the power voltage between 3.3V-5V to avoid circuit damage from excessive voltage.;
3.Avoid prolonged use in direct strong light (such as midday sun) or high temperatures (>60℃) to prevent component aging.;4.Avoid corrosive gases and dust to prevent contamination of the light-sensitive surface affecting detection accuracy.;5.The optical window on the sensor surface should not be touched or wiped with hands; if cleaning is necessary, use a soft brush to sweep.;6.Avoid shining a flashlight directly at the sensor during debugging to prevent instant strong light from damaging components.;7.Do not place liquids on the table to prevent them from seeping into the sensor and causing a short circuit..05Expansion
Students can add an LED light that gradually lights up when light is detected.
Arduino Sensors: HS-S01A Infrared SensorArduino Sensors: HS-S02P Infrared Sensor (Obstacle Avoidance)Arduino Sensors: HS-S03P Ultraviolet SensorArduino Sensors: HS-S05P Sound SensorArduino Sensors: HS-F07P Active BuzzerArduino Sensors: HS-S08P Flame SensorArduino Sensors: HS-S09LB Raindrop SensorArduino Sensors: HS-S09PC Soil Moisture Sensor
Arduino Sensors: HS-S10P Mist Sensor
Arduino Sensors: HS-S11-L Gas Sensor
Arduino Sensors: HS-S26A Temperature and Humidity Sensor
— Previous Recommendations —




