Skip to content

Light Sensor - Automatic Brightness

Beginning of the lesson

What is a Photoresistor (LDR)?

A Photoresistor, also called a Light Dependent Resistor (LDR), is a special type of resistor whose resistance changes based on the amount of light hitting its surface.

Key Principle

More Light = Less Resistance
Less Light = More Resistance

Typical Resistance Values:
  • ☀️ Bright Sunlight ~200Ω
  • 💡 Normal Room Light ~1kΩ - 10kΩ
  • 🌙 Complete Darkness ~1MΩ - 10MΩ
Interactive visualization — available in the full lesson
The Voltage Divider Principle

Since Arduino can only read voltage (not resistance directly), we use a voltage divider circuit to convert the LDR's changing resistance into a changing voltage.

📐 Voltage Divider Formula

Vout = Vin × (R2 / (R1 + R2))

Where:
• Vin = 5V (Arduino power)
• R1 = LDR (variable resistance)
• R2 = 10kΩ fixed resistor
• Vout = Voltage read by Arduino

How It Works:
  • Bright Light: LDR resistance LOW → Vout HIGH (close to 5V)
  • Darkness: LDR resistance HIGH → Vout LOW (close to 0V)
Interactive visualization — available in the full lesson

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 15
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers