0
\$\begingroup\$

Can anyone tell me why we use a voltage divider circuit with an LDR for an LDR robot?

For example, why can't we directly take the LDR output and feed it to the ADC port in an ATmega controller? Why must we use this order?

Light --> LDR --> voltage divider circuit --> ADC pin

I read somewhere that it was used for "buffing" but I couldn't really understand what it meant.

\$\endgroup\$
  • \$\begingroup\$ Where is the schematic? \$\endgroup\$ – Unknown123 Mar 30 at 11:22
  • \$\begingroup\$ Sorry, I didn't mean schematic. Meant a flow chart(of sorts). \$\endgroup\$ – noorav Mar 30 at 11:53
4
\$\begingroup\$

An LDR is a light dependent resistor. It doesn't generate voltage so you can't just connect it directly into an ADC because the ADC doesn't measure resistance, it measures voltage. So how can we generate a voltage from an LDR?

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. (a) Using a constant current source. (b) Using a potential divider.

We know from Ohm's Law that V = IR so if we can run a current through our LDR then we can measure the voltage drop across it and, effectively, create a light-dependent voltage source.

Figure 1a shows how to do it with a constant current source. This makes the resistance to voltage calculation simple as the current is constant. Creating the constant current source can be more trouble than it's worth for most applications so we opt for a series resistor as shown in Figure 1b. The disadvantage with this arrangement is that the relationship is now non-linear and some more complicated mathematics have to be performed to work out the ratios.


I read somewhere that it was used for "buffing" ...

That must have been an article about polishing something like your car. "Buffering" is a technique used in electronics to avoid altering the signal you are trying to measure by the act of taking the measurement. Usually a buffer amplifier is positioned between the signal being monitored and the device taking the measurement. The buffer amplifier is designed to have a very high input resistance so that it doesn't draw significant current from the device being measured. It isn't needed in this case.


Comment:

So just to clarify, the resistors in the voltage divider circuit cause a current(V+/R) to flow to the LDR, which when multiplied with the LDR resistance gives its voltage. Am I right?

Yes. Take an LDR resistance measurement in the darkest and brightest situations and work out the best value of R1 to give you a decent voltage swing into the ADC. The equation is

$$ V_{ADC} = \frac {R_{LDR}}{R_1+R_{LDR}}V_+ $$

You can, of course swap the positions of R1 and the LDR if it suits your purposes. (Swap in the equation too.)


Would the current from V+ even flow through the LDR? Wouldn't the current directly go to the analog input pin as there is no resistance along that path?

No, the ADC input typically has an internal resistance of > 100 kΩ. Check the datasheet. The idea is that it draws very little current from the device it is measuring.

And even if there does flow some current through through the LDR, the value of that current would vary depending on the value of V+ and the resistor value?

Correct. So we use a regulated voltage and a fixed resistor. A regulator maintains the voltage when the current draw varies.

And hence this would also result in a variable LDR voltage value, right?

No, for a given light level you will get repeatable readings provided V+ is constant and you have a reasonably stable resistor. For precision work you need to be concerned about temperature coefficient, etc., but for most hobby devices it wouldn't be a problem.

\$\endgroup\$
  • \$\begingroup\$ @Transistor, so just to clarify, the resistors in the voltage divider circuit cause a current(V+/R) to flow to the LDR, which when multiplied with the LDR resistance gives its voltage. Am I right? \$\endgroup\$ – noorav Mar 30 at 12:55
  • \$\begingroup\$ See the update. \$\endgroup\$ – Transistor Mar 30 at 13:27
  • \$\begingroup\$ this explanation was as clear as water. Thank you so much. Could you help me with books/material that will increase my level of understanding as much as yours? Would really appreciate it. \$\endgroup\$ – noorav Mar 30 at 14:36
  • 1
    \$\begingroup\$ Read, read, read. I learned most of mine from hobby electronics magazines many decades ago so taking out a subscription to one of these would be a good idea. Reading through the answers on this site will also teach you a lot. \$\endgroup\$ – Transistor Mar 30 at 14:51
  • \$\begingroup\$ sorry for coming back to this question but, would the current from V+ even flow through the LDR? Wouldn't the current directly go to the analog input pin as there is no resistance along that path? \$\endgroup\$ – noorav Apr 1 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.