กลับไปหน้ารวมไฟล์
light-detecting-c4734b-en.md

Optoelectronics 101: Understanding the LDR

The Light Dependent Resistor (LDR), or photoresistor, is one of the most fundamental sensors in the maker's toolkit. This project demonstrates how to interface an LDR with the Arduino Uno to translate physical light intensity into a digital data stream, serving as a building block for "Smart City" streetlights and automated home shading systems.

The Physics of Photo-Resistivity

At its core, an LDR is a semiconductor device whose resistance changes based on the number of incident photons:

  • High Resistance (Darkness): In total darkness, the LDR can have a resistance in the Mega-ohm range, preventing current from flowing through the circuit.
  • Low Resistance (Brightness): As light intensity increases, more electrons are freed within the semiconductor material, dropping the resistance to just a few hundred Ohms.
  • The Voltage Divider: Because the Arduino's analog pins measure voltage rather than resistance, the LDR is paired with a fixed resistor (often 10k) to create a voltage divider. This ensures that the transition between light and dark produces a measurable 0-5V signal.

Tuning the Analog Input

While raw analog values range from 0 to 1023, the actual environment rarely hits these extremes:

  1. Sensitivity Calibration: Many LDR modules include a physical potentiometer (trimmer). This allows the user to set a hardware threshold, effectively choosing the "Lux" level at which the digital output (if available) triggers.
  2. Software Mapping: In the Arduino IDE, the map() function can be used to convert raw sensor readings into percentages (0% to 100% brightness) or to control the brightness of an LED via PWM.
  3. Data Filtering: To prevent "flickering" caused by passing shadows or minor atmospheric changes, the project uses a moving average or a simple delay() to stabilize the reading.

Real-World Applications

This simple light-detecting circuit is the foundation for:

  • Automatic Poultry Doors: Ensuring the flock is safe at sunset.
  • Solar Trackers: Positioning solar panels to follow the sun's trajectory.
  • Daylight Harvesting: Dimming indoor lights when natural sunlight is sufficient to save energy.

Reading LDR sensor module's analog values in order to detect the intensity of light

Is as simple as

When there is light, the resistance of LDR will be low according to the intensity of light.

The greater the intensity of light, the lower the resistance of LDR

The potentiometer knob on the module can be adjusted to change the sensitivity of LDR towards light, offering a wide large scale

ข้อมูล Frontmatter ดั้งเดิม

title: "Light Detecting"
description: "Through this project we'll be able to read analog value from LDR ( Light Dependant Resistor ) in order to detect the intensity of light"
author: "Fouad_Roboticist"
category: ""
tags:
  - "weather"
  - "smart appliance"
  - "home automation"
  - "data collection"
  - "internet of things"
views: 5661
likes: 0
price: 99
difficulty: "Easy"
components:
  - "1x Premium Female/Male Extension Jumper Wires, 40 x 6\" (150mm)"
  - "1x PHOTOSENSTITIVE LIGHT SENSOR (ANALOG)"
  - "1x Arduino UNO"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://projects.arduinocontent.cc/6894c631-b11a-4383-b5be-0e69746c2cbb.ino"
documentationLinks: []
passwordHash: "7d0c14c3e72b74c1cd165f2783e5a26b9ea6bcb8f360bbb1398457e0d0abdc37"
encryptedPayload: "U2FsdGVkX18Ge3joyunqBQSXZmAR0KrQYUyFanG7yEXRkrsg5AdtXXlcN2dHDBWmEZDId7AmegvdlROFR6b6Bctf/bLhmaQ9tJqwdhrnP1k="
seoDescription: "Learn how to read analog values from an LDR to detect light intensity in this project."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/light-detecting-c4734b_cover.jpg"
lang: "en"