With the LDR on the +5V side and 10 kΩ to ground, the analog pin sees:
V_A0 = 5 V × 10 kΩ ÷ (R_LDR + 10 kΩ)
For a typical GL5528-type LDR:
| Light | LDR resistance | Voltage at A0 |
|---|---|---|
| Dark | about 1 MΩ | 0.05 V |
| Room light | about 10 kΩ | 2.5 V |
| Bright | about 1 kΩ | 4.55 V |
So brighter light gives a higher reading. Swap the two parts if you want the opposite. 10 kΩ suits indoor light; use a smaller fixed resistor for bright outdoor sensing and a larger one for dim rooms.
int light = analogRead(A0); // 0 (dark) to 1023 (bright) on a 5 V Arduino