Question: how ldr works in microcontroller?
Answer: Light dependent resistor works on the principle of variable resistance. whenever light falls on LDR, it changes its resistance according to light intensity. For example when light intensity is low, resistance of LDR will be high and similarly when light intensity is hig, LDR will offer a low resistance.