Arduino Light Dependent Resistor(LDR) Guide

A Photoresistor or Light-Dependent Resistor (LDR) is a light-controlled variable resistor. The resistance of a Photoresistor decreases with increasing incident light intensity. This guide will connect the LDR with an Arduino.

Requirements
– Arduino Uno / Duemilanove / Nano
– LDR / Photoresistor : Dealextreme
– resistor (+-10k) : Dealextreme

Arduino Duemilanove / Uno

We can read the value of the Photoresistor by measuring the voltage with one of the analog pins on your Arduino.  However, we need a divider resistor to protect your Arduino.

arduino_photoresistor_wiring

On breadboard :

duamilanoveldr

Arduino Nano

arduinonanophotoresistorwiring

on a breadboard :

photoresistorwiringnano01

Test program

This program will put out the LDR value to the “Serial Monitor” :

int LDR = A0;

void setup()
{
    Serial.begin(9600);
}

void loop()
{
   Serial.println(analogRead(LDR));
   delay(50);
}

When programmed, open the “Serial Monitor” under Tools:

arduinoserialmonitor

You will now get a continuous stream of the value of your Light Dependent Resistor.

arduinoserialmonitor1

By covering your Photoresistor the value should drop when shining light on the Photoresistor the value should raise.

Leave a Reply

Leave a Reply

  Subscribe  
Notify of