Luminosity Measurement

Introduction

This experiment demonstrates how to measure light intensity using a photoresistor (LDR).

Luminosity Sensor (LDR)

Components Needed

Circuit Setup

  1. Connect one end of the LDR to 5V on Arduino.
  2. Connect the other end to an analog input pin (e.g., A0) and also to a 10k Ohm resistor which connects to GND.

The LDR will vary its resistance based on the amount of light falling on it, and the Arduino reads this variation.

Luminosity Circuit Setup

Code for Luminosity Measurement

Upload the following code to your Arduino to measure luminosity:


const int ldrPin = A0;

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

void loop() {
  int ldrValue = analogRead(ldrPin);
  Serial.print("Light Intensity: ");
  Serial.println(ldrValue);
  delay(1000);
}
            

Explanation

The LDR’s resistance decreases with increasing light intensity, and this change is captured as an analog value by the Arduino.

Troubleshooting