LED Light Sensor - Need Help Please


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427

    Default LED Light Sensor - Need Help Please

    Hey Group,

    I have been experimenting with the Idea of building a Solar Tracker.

    I have read here and else where that you can use an LED as a light sensor.

    I have had limited success. First trying to just connect one leg of the LED to an A/D converter input on my PIC 916F690, and the other leg of the LED to either +5 or Gnd. I have tried a lot of different configurations such as reversing the LED, connecting the other leg of the LED to either +5 or gnd, etc. etc.

    I do not seem to get very good results. I can see some change with light intensity and using different LED's, but the dynamic range of light measuring does not seem to be very good. I only see a change of about 50 counts on an 8 bit (0-255) word.

    Have any of you had any experience with this?? Could you share CODE/SCHEMATIC please.

    I have searched this forum and elsewhere onthe web but the examples are somewhat vague and confusing.

    Here is one GOOD example video on YouTube...
    But he does not share the schematic or code.

    I'm not asking for someone to do the work for me... Just give me a few tips and a basic starting circut and/or sample code.


    Thanks
    Last edited by Heckler; - 10th September 2011 at 22:41.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: LED Light Sensor - Need Help Please

    The voltage range/swing here is gonna be miniscule, so you're gonna need an amp of some sorts, something like this prior to your ADC pin...

    http://www.eleccircuit.com/using-led-as-a-light-sensor/

    the output of that will be a varying DC level depending on the amount of light hitting the led, which you can then feed to a pic pin & use any old basic ADC reading type code from here.

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: LED Light Sensor - Need Help Please

    Hey Heckler, try http://www.redrok.com.htm They have a lot of different circuits that people have designed.. In fact one of our tech's who just graduated with his degree used one of them for his final project.
    Dave Purola,
    N8NTA
    EN82fn

  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

    @Hank... I really want to keep the component count low and only need to do a comparative measurement between 2 or 4 different sensors. So I hope to be able to avoid using an amplifier, if possible.

    @Dave... wow there is a lot on that website to take in... I'll look there for someting I can use. (your link seemed bad... I had to delete the .htm on the end)


    Any others with ideas? please chime in.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  5. #5
    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 02:06.
    My English doesn't sucks, it's just fugly...

  6. #6
    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...

  7. #7


    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.

  8. #8
    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.

  9. #9


    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

  10. #10
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588


    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

  11. #11
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588


    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 : 1

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