LED Light Sensor - Need Help Please


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Location
    Guadalajara, México
    Posts
    28


    Did you find this post helpful? Yes | No

    Default Re: LED Light Sensor - Need Help Please

    To use an LED as light sensor you can use PBP's RCTIME or if you want to use the analog approach try connecting the anode to the input pin and the cathode directly to vss, the following code gives me 0 at dark and ~450 in the light:
    Code:
    Inicio:
    suma=0
    for cont=1 to 10
    adcin 3,dato
    suma=suma+dato
    pause 100
    next cont
    suma=suma/10
    serout transmitir,0,[#suma,10]
    goto inicio
    (I'm using 5mm Ultra bright Blue LED)

    Regards.
    Last edited by ivanrosales; - 11th September 2011 at 01:06.
    My English doesn't sucks, it's just fugly...

  2. #2
    Join Date
    Aug 2011
    Location
    Guadalajara, México
    Posts
    28


    Did you find this post helpful? Yes | No

    Default Re: LED Light Sensor - Need Help Please

    Anyway a simple LDR is by far more reliable and is as cheap as an LED, you can connect the LDR in series with a 1K resistor and use it as a voltage divider.

    Regards.
    My English doesn't sucks, it's just fugly...

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: LED Light Sensor - Need Help Please

    Dwight:

    Have you seen my design? Pictures, schematics, description, and code are posted in the WIKI under Projects - Solar - My Small Solar Tracker. Two posts appear, the second one has a PDF of the schematic. I have been using this tracker a lot, it is reliable and very accurate.

  4. #4
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: LED Light Sensor - Need Help Please

    Thanks Ozark,

    I may have seen the article but never did find the schematic... I went back to your original post after you mentioned it and found the .pdf. That is what I was looking for... how to hook up the led's and some sample code on reading the light values.

    Is there a way to add the .pdf with the SCHEMATIC to the Wiki project page, you might also want to mention in the article where to find the schematic ?? I went back to the article and searched for the word "schematic" and could not see where to view the schematic. Then at the bottom of the page I found a link to the original thread and finally found the .pdf there.

    How did you determine that it was necessary to add the capacitors in parallel to the LED's?

    Thanks

    @Ivanrosales... I know an LDR is probably a more standard way of measuring light... but I did not have one on hand and wanted to try using an LED as others have mentioned is possible. thanks for your help also
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: LED Light Sensor - Need Help Please

    Dwight:

    I have a lot to learn regarding posting schematics. Sorry for the confusion.

    As far as adding the capacitors - I'm sure they are not needed, the signal from the LED's is very stable, no noise or "jitter". Since a high speed response was not required here, I thought "what the heck", I'll just add them anyway. I did not test the circuit without the capacitors, but it would probably work just fine without them.

    The change in signal level from the LED's is very smooth, kind of neat to see how the value changes as the shadow moves across the LED.

    Ken

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: LED Light Sensor - Need Help Please

    Quote Originally Posted by ozarkshermit View Post
    Dwight:

    Have you seen my design? Pictures, schematics, description, and code are posted in the WIKI under Projects - Solar - My Small Solar Tracker. Two posts appear, the second one has a PDF of the schematic. I have been using this tracker a lot, it is reliable and very accurate.

    Ken, your Wiki has been cleaned up. There was a technical glitch, Lester had to intervene to get it straightened out.

    Robert

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: LED Light Sensor - Need Help Please

    Moved from Schematics.

    Robert

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