LED Light Sensor - Need Help Please


Closed Thread
Results 1 to 11 of 11

Hybrid View

  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 21: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 01: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...

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