Reading A Photo Resistor using ADC


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Bruce felt that a photocell would be to slow to measure frequency. That is why I asked about a solar cell.

  2. #2
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Yeah, I see. I glanced over what Jessey said about measuring the difference between dawn and dusk... I know the photocell with adcin would work great for measuring changes in light, but dawn and dusk, or measuring the frequency of light. I don't know if the photocell could do that.

    (Sorry for any confusion caused by my posts in this thread, I was replying to Jessey's original post about using a photocell. I didn't read the replies posted by others.)
    Last edited by TonyA; - 25th January 2007 at 10:25.

  3. #3
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default Works great

    Hello Bruce,

    Thanks for the info, I was really getting frustrated with the pot command and finding a proper value of a photo resistor to use.I found that the adc works great with just about any photo resistor value.

    Also thanks TonyA and your right that the adc does work best for this type of application and it is very fast too, I'm pleased to see. I'm also using an 18f452 (great micro) but not with the ADCin command and it works great.

    Code:
    Check_The_Light_Level:
      adcon1=%00001110   ' AN0 analog, all other pins digital 
      ADCON0 = $41       ' Set A/D to Fosc/8, Channel 0, On
      Pauseus 50         ' Wait for channel to setup         
      ADCON0.2 = 1       ' Start conversion
      Pauseus 50         ' Wait for conversion
      Lite_Level = ADRESH
      ADCON1 = 7         ' shut off (Disable) ADC 
    RETURN
    Once again thanks everyone for getting me kick started on this.

    Thanks
    jessey

Similar Threads

  1. Stable Adc Reading Routine
    By gebillpap in forum General
    Replies: 27
    Last Post: - 13th May 2015, 02:18
  2. Reading (ADC) negative current
    By sougata in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 21st November 2006, 17:38
  3. 12F675 ADC 'Issues'
    By harrisondp in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2005, 01:55
  4. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 16:46
  5. Reading multiple ADC channels FAST
    By lwindridge in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st April 2004, 22:37

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts