Introduction: Arduino Light Detection Tutorial
Step 1: Parts Needed
- Arduino Board (I'm using an UNO)
- LED (Color doesn't matter)
- 10k ohm Resistor
- 220 ohm Resistor
- 5 Jumper Wires
You will be able to buy the components that I've used on allchips.ai
Their store will be up by the end of January. Stay tuned!
Step 2: Making the Necessary Connections
Start with connecting the LED. The shorter lead of the LED (cathode, -) connects to Ground of the Arduino (GND). The longer end (anode, +) connects to one end of the 220 ohm resistor, with the other end going to Digital Pin 13 of the Arduino. The LED is now connected.
Now we continue with the LDR. One of it's ends connects to 5V and the other - to GND using the 10k resistor. Lastly, connect the same row (that goes to ground) to Analog Pin A0 of the Arduino. Make this connection after the resistor! You can use the second picture above for reference
Step 3: Uploading the Code and Finalizing
Connect the Arduino board to your PC and upload this code. You can modify it to suit your need. For example, you can change the value at which the LED lights up or the pins according to the connections you've made. Here is a simple video, showcasing the project in action:
We have a be nice policy.
Please be positive and constructive.