By Alexsandar | 21 October 2017 | 1170 Comments
Tutorial for Arduino Light Detection

After completing this tutorial, you will learn how you can detect changes in the light levels around you.
Step 1: Parts Needed

Arduino Board (I'm using an UNO)
Breadboard
LDR
LED (Color doesn't matter)
10k ohm Resistor
220 ohm Resistor
5 Jumper Wires
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:
Recently Reviews
Read MoreLeave a Reply
Your email address will not be published.Required fields are marked. *
POPULAR BLOG
CATEGORIES