How do you connect LDR sensors with a PIC ??

Discussion in 'General Electronics Chat' started by zeeba, Oct 3, 2010.

  1. zeeba

    Thread Starter New Member

    Sep 26, 2010
    22
    0
    Hi

    How do you connect LDR sensors with a PIC ??

    Im writting a code to read from both LDRs and show the reading on LCD and I want to see if it's working
    but I dont know how to connect the LDRs with the PIC?? ​
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
  3. timrobbins

    Active Member

    Aug 29, 2009
    318
    16
    Sounds like you're using the LDR for an analog signal, rather than as a digital input??
     
  4. tom66

    Senior Member

    May 9, 2009
    2,613
    214
    If your chip has them, you will need to use the comparators or an ADC input. Then put a resistor in series with an LDR to form a divider; connect the resistor to the PIC's Vdd and the LDR to ground. The centre tap between these points is proportional to light levels.
     
Loading...