Introduction: Arduino Light Detection Tutorial

Picture of Arduino Light Detection Tutorial

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.

Step 1: Parts Needed

Picture of 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

Picture of 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:


About This Instructable




Bio: Student, currently studying programming. Passionate about Electronics, Arduino and IoT.
More by Aleksandar Tsvetkov:DIY FM Radio (TEA5767)16x2 LCD ClockCrude WiFi-Enabled Weather Station
Add instructable to: