Arduino Light Detection Tutorial

by Aleksandar Tsvetkov in Circuits > Arduino

1976 Views, 8 Favorites, 0 Comments

Arduino Light Detection Tutorial

IMG_20171013_232228.jpg

After completing this tutorial, you will learn how you can detect changes in the light levels around you. The parts for this project were provided by Kuman. You can find them in their Arduino UNO Starter Kit.

Parts Needed

IMG_20171013_230411.jpg
  • Arduino Board (I'm using an UNO)
  • Breadboard
  • LDR
  • 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!

Making the Necessary Connections

IMG_20171013_230552.jpg
ldrarduino.jpg

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

Uploading the Code and Finalizing

Arduino LDR Tutorial

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: