50% OFF! Hot items selling fast—Grab them before they're gone!
The HS-S20B Ambient Brightness Sensor is an analog light-sensing module for day/night detection, auto-dimming, light-triggered alarms, and brightness-aware robotics. It converts ambient illumination into a voltage that a microcontroller ADC can read.
It is a compact companion for the ELAB Nano V3, Raspberry Pi Pico W, and MB 102 Breadboard Kit. For output feedback, pair it with an RGB Full Color LED Module.
This sensor is best for relative brightness rather than calibrated lux measurement. Set thresholds under final lighting conditions and average readings when indoor lamp flicker is visible.
| Parameter | Value |
|---|---|
| SKU | HS-S20B |
| Product Type | Photoresistor ambient brightness sensor |
| Output | Analog signal |
| Sensing Method | Light-dependent resistance / brightness detection |
| Typical Supply | 3.3V / 5V controller systems |
| Host Requirement | ADC input |
| Use Cases | Night lights, dimming, robot light seeking |
| Calibration | Recommended under final lighting |
| Response | Relative ambient brightness |
| Not For | Factory-calibrated lux measurement |
Read light sensor values through an analog input for calibration.
const int sensorPin = A0;void setup() { Serial.begin(115200);}void loop() { Serial.println(analogRead(sensorPin)); delay(300);}
Trigger an LED when the sensor crosses a tuned threshold.
const int sensorPin = A0;const int ledPin = 13;const int threshold = 600;void setup() { pinMode(ledPin, OUTPUT);}void loop() { digitalWrite(ledPin, analogRead(sensorPin) > threshold ? HIGH : LOW); delay(200);}
Log analog readings from a Pico-style ADC pin.
from machine import ADC, Pinimport timesensor = ADC(Pin(26))while True: print(sensor.read_u16()) time.sleep(1)
Q: Does it output exact lux?
A: No, it gives a relative analog reading.
Q: What pin should I use?
A: Use an ADC input for the signal pin.
Q: Can it work at 3.3V?
A: Typically yes for simple analog modules, but verify board labels.
Q: Why do readings flicker?
A: Indoor lights can flicker; average samples.
Q: Can it detect color?
A: No, it detects brightness only.
Q: Can it control a night light?
A: Yes, with a threshold and output driver.
Q: Why are bright and dark reversed?
A: Circuit orientation can invert the reading.
Q: How do I calibrate?
A: Measure values in final bright and dark conditions.