LDR using Arduino UNO
This project demonstrates how to use an LDR (Light Dependent Resistor) with an Arduino Uno to detect ambient light levels.
The LDR's resistance changes with light intensity, which is read as an analog input by the Arduino.
Based on a predefined threshold, the Arduino determines whether it's light or dark and outputs the result to the Serial Monitor.
Components Needed
- Arduino UNO
- LDR (Light Dependent Resistor)
- 10kΩ Resistor
- Jumper Wires
- Breadboard
Block Diagram
Hardware Wiring Explanation:
Connect the LDR to Arduino Uno:
GND pin to arduino uno GND
Connect the LDR and resistor to the Arduino Uno as described in the circuit setup section.
Software (Arduino IDE):
Open the Arduino IDE and create a new sketch.
Copy and paste the provided Arduino code into the sketch.
Monitor the Output:
Upload the code to the Arduino Uno.
Open the Serial Monitor with a baud rate of 9600.
Observe the Serial Monitor output, which will display the LDR values and indicate whether it's light or dark based on the threshold.
Applications
Notes
Ensure the LDR is correctly connected to the Arduino Uno and powered.
Adjust the threshold value in the code to suit different lighting conditions and applications.
Modify the code to include additional functionalities or integrate with other sensors for enhanced projects.