Read Analog Values From LDR Using Arduino

Introduction: Read Analog Values From LDR Using Arduino

About: I love to learn,build and design.....

In this instructables we will play using ldr to get analog values...(light dependent resistor its more like solar cell in which resistance decreases as light falls on it)

Step 1: Components Required

*Arduino Uno
*Pot(To increase or decrease the sensitivity of ldr)
*wires to connect to breadboard (if needed I pulled out some single strand wires from scratch)
*LDR

A photo resistor or light-dependent resistor(LDR) or photocell is a light-controlled variable resistor. The resistance of a photo resistor decreases with increasing incident light intensity; in other words, it exhibits photo conductivity. A photo resistor can be applied in light-sensitive detector circuits, and light- and dark-activated switching circuits.

Step 2: Connecting Components

It works on voltage divider
so we connect pot in series with LDR and sensor value is taken across LDR in terms of voltage developed.... due to light intensity....

Step 3: Coding

void setup ()
{
Serial.begin(9600);
}
void loop()
{
int sensorvalue=analogRead(A0);
Serial.println(sensorvalue);
delay(1);
}

Step 4: Upload

Above pics represents first when light is not falling on ldr(single digit)
secondly light is falling on ldr (two or three digit number)

Step 5: Adding Led

In void loop statements can be added and led pin should be declared at void setup..
If (analogread>=600)
{
digitalWrite(13,HIGH);
}
else
{
digitalWrite(13,LOW);
}

Arduino All The Things! Contest

Participated in the
Arduino All The Things! Contest

Be the First to Share

    Recommendations

    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Super-Size Speed Challenge

      Super-Size Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020

    3 Discussions

    0
    nibin matteo
    nibin matteo

    Question 1 year ago

    is it not possible to read the value of the ldr via digital pin??

    0
    adithyapaip
    adithyapaip

    Reply 1 year ago

    analogRead is a function to read analog values from the arduino pin

    0
    nibin matteo
    nibin matteo

    Question 1 year ago

    hi,
    i am nibin and i am new to arduino.
    i would like to know why you didnt declare pinMode in the void set up