Projects Hub, lesson 15 of 81

Light Intensity Measurement with LCD Display

intermediate3 min read

Introduction

Light intensity measurement is a fundamental task in various applications, from controlling the brightness of a room to monitoring environmental conditions. In this article, we'll explore how to build a simple yet effective light intensity measurement system using an Arduino and display the results on an LCD (Liquid Crystal Display). This DIY project is not only educational but also practical, as it can be applied in settings such as home automation, greenhouse monitoring, or even in photography studios.

Working Principle

The key to measuring light intensity lies in utilizing a light sensor, often referred to as a Light Dependent Resistor (LDR) or a Photoresistor. LDRs change their resistance in response to the ambient light level. When exposed to more light, their resistance decreases, and when subjected to less light, their resistance increases.

By connecting an LDR to an Arduino, we can create a voltage divider circuit. The varying resistance of the LDR causes the voltage across it to change proportionally with light intensity. This voltage can then be read by the Arduino's analog input pins.

Things We Need

  1. Arduino board (e.g., Arduino Uno or Arduino Nano)
  2. LDR (Light Dependent Resistor)
  3. LCD display (16x2 or 20x4)
  4. Potentiometer (10k ohm) for contrast control
  5. Breadboard and jumper wires
  6. Power source for the Arduino (USB cable or a battery)

Circuit Diagram

Here's the basic circuit connections:

Loading the circuit…Arduino Uno
Press Run to upload the code to the Arduino.
LDR
   |
Analog Pin A0
   |
10k Resistor
   |
   |---- 5V
   |
   |
   GND
   |
  LCD Display

Working of the System with Arduino

  1. Connect the LDR to one end of the 10k resistor and ground, forming a voltage divider.
  2. Connect the center point of the voltage divider (between the LDR and resistor) to an analog pin (e.g., A0) on the Arduino.
  3. Wire the LCD display to the Arduino. Connect VCC and GND of the LCD to 5V and GND on the Arduino, respectively. Connect the SDA and SCL pins of the LCD to the corresponding pins on the Arduino (usually A4 and A5).
  4. Adjust the contrast of the LCD using the potentiometer.
  5. Upload the Arduino code to read the analog value from the LDR, convert it to lux (or any desired unit), and display it on the LCD.

Code (Arduino sketch):

Here's a simple Arduino sketch to get you started:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
 
LiquidCrystal_I2C lcd(0x27, 16, 2); // Address may vary, use I2C scanner to find it
 
void setup() {
  lcd.init();
  lcd.backlight();
  Serial.begin(9600);
}
 
void loop() {
  int sensorValue = analogRead(A0); // Read the LDR value
  float lux = map(sensorValue, 0, 1023, 0, 10000); // Map to lux scale
 
  lcd.setCursor(0, 0);
  lcd.print("Light Intensity:");
  lcd.setCursor(0, 1);
  lcd.print(lux);
  lcd.print(" lux  ");
 
  delay(1000); // Delay for readability
}

Conclusion

With this DIY project, you've created a light intensity measurement system using an Arduino and an LCD display. You can further expand this project by adding features like data logging, threshold-based alerts, or remote monitoring via IoT platforms. This project not only enhances your electronics skills but also provides a practical tool for various applications where light intensity monitoring is essential. Enjoy your journey into the world of electronics and measurement!