
Beginner4/7/2026- Author: IoTSpark Maker
ESP32 + LDR: Photoresistor Light Sensor (Quick Test Sample Code)
An LDR (Light Dependent Resistor) is a CdS photoresistor — its resistance changes with the light hitting it: low resistance (a few hundred Ω) in bright light, high resistance (hundreds of kΩ - MΩ) in the dark.
ldranh-sangadc
4 steps3 components
An LDR (Light Dependent Resistor) is a CdS photoresistor — its resistance changes with the light intensity hitting it: low resistance (a few hundred Ω) in bright light, high resistance (a few hundred kΩ - MΩ) in the dark. It's the simplest analog sensor in this series, requiring an understanding of the voltage divider to convert resistance into a voltage readable by the ADC.