I need to interface an LDR with micro controller,a microcontroller.
While searching for 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 the ADC port of a microcontroller.
Another was to couple the LDR to ground via small capacitor and connect the other end directly to a microcontroller. (I am not sure how this works?)
One was using a voltage divider circuit with another resistor and input that into ADC port of micro controller.For example:
Another was to couple LDR to ground via small capacitor and another end directly to microcontroller. ( I am not sure how this works? )
Image source: Measuring Light on a PIC 16F62x from Robot Builder
The PIC 16F62X series is a pin-compatible upgrade to the old F84 offering lots of extra internal goodies such as timers, a USART and a couple of comparators. There are no analogue to digital converters (ADC) as such but it is a simple job to use a comparator, a timer and a few lines of software to make one.
Which one is more accurate?