4
\$\begingroup\$

I need to interface LDR with micro controller,

While searching some circuit ideas on the internet I came across two different ideas.

One was using a voltage divider circuit with another resistor and input that into ADC port of micro controller.

Another was to couple LDR to ground via small capacitor and another end directly to microcontroller. ( I am not sure how this works? )

Which one is more accurate?

\$\endgroup\$
  • 3
    \$\begingroup\$ Can you provide resource (scheme) for the second circuit. \$\endgroup\$ – aiao Feb 13 '13 at 12:46
  • 1
    \$\begingroup\$ accurate in what sense? what are you trying to accomplish? \$\endgroup\$ – miceuz Feb 13 '13 at 12:52
  • \$\begingroup\$ +1 on both above, but go option 1 if you have an ADC available. Very likely more accurate and much easier to understand / program. \$\endgroup\$ – PeterJ Feb 13 '13 at 12:56
  • \$\begingroup\$ @miceuz accurate for sun angle measurement. \$\endgroup\$ – iamgopal Feb 14 '13 at 2:41
  • \$\begingroup\$ robotbuilder.co.uk/Resources/Articles/149.aspx @aiao \$\endgroup\$ – iamgopal Feb 14 '13 at 2:44
4
\$\begingroup\$

This is very simple:

Since both the voltage into the A/D input and the A/D's measuring range is relative to the PWR voltage, the PWR voltage cancels out. The A/D pin voltage will be non-linear with light intensity. Make R2 the value R1 has in the center of its range or where you want the most resolution.

\$\endgroup\$
  • 2
    \$\begingroup\$ @gopal - Just to add a little something: when I'm using a high-ish impedance sensor like this, I like to add a little capacitor (10nF - 100nF) between the A/D input and GND. This helps to charge the ADC's sample and hold capacitor more reliably, and also acts as a simple low pass filter. You'll get a better signal/noise ratio this way. \$\endgroup\$ – Rocketmagnet Feb 13 '13 at 17:15

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.