Programming Examples
Design a night lamp using a LDR and a LED using Arduino Uno and find out the time delays associated in keeping ON the lamp

Design a night lamp using a LDR and a LED using Arduino Uno and find out the time delays associated in keeping ON the lamp
Components Needed:
- Arduino Uno
- LDR (Light Dependent Resistor)
- LED
- Resistor (for LED current limiting)
- Breadboard and jumper wires
Circuit Connections:
Connect the components as follows:
- Connect one leg of the LDR to 5V on the Arduino.
- Connect the other leg of the LDR to analog pin A0 on the Arduino.
- Connect one leg of the resistor to the junction of the LDR and connect the other leg of the resistor to the ground (GND) on the Arduino.
- Connect the cathode (shorter leg) of the LED to digital pin 13 on the Arduino.
- Connect the anode (longer leg) of the LED to a current-limiting resistor, and the other end of the resistor to the ground (GND) on the Arduino.
Output/ Explanation: