Notifications
Clear all

[Solved] What is the need of connecting a resistor with LDR for Arduino interfacing?

2 Posts
3 Users
1 Reactions
4,721 Views
0
Topic starter

Hi,

Sorry for such a silly question but I am very new to Arduino.

In the circuit, there is a resistor connected to the LDR. I don't quite understand its use. For LED I get it, to limit the current. But why with the LDR. Can't we directly connect it to the 5V and then to the analog pin??

Thanks very much.

If found this circuit here.


2 Answers
1

If you connect the LDR directly to 5V and the analog pin, there would be no voltage drop across the LDR irrespective of its resistance value. The analog pin would always read a constant 5V because there is no reference point to indicate a change in resistance.

To detect the change in resistance of the LDR, the voltage at the analog pin should change accordingly. This is done using a voltage divider circuit.

In the voltage divider circuit, as the resistance of the LDR changes with change in light intensity, the voltage drop across it changes as well. The analog pin, connected to the point between the LDR and the fixed resistor, reads this changing voltage. This allows the Arduino to continuously register and interpret the varying light levels.


0

The resistor is part of a voltage divider, which helps convert the LDR's variable resistance into a measurable voltage that can be read by the analog pin of Arduino.

Here’s why the resistor is needed:

  1. The LDR changes its resistance based on light intensity. However, the Arduino analog pin doesn't measure resistance directly, it measures voltage. The LDR and the resistor together create a voltage divider circuit, where the output voltage changes as the LDR’s resistance changes.

  2. When you connect the LDR to a resistor, the voltage between the LDR and the resistor will vary depending on the LDR’s resistance (which depends on light). This allows you to measure different light levels as different voltage values.


Share: