12F629 LDR - Light Dependant Resistor


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Location
    down south
    Posts
    90


    Did you find this post helpful? Yes | No

    Default

    forgive just trying to understand what your doing here.
    instead of using the LDR as a A/D input (which the 29 does not have)
    when the amount of light causes the voltage to over come the the pull down resistor you get a high input on gpio.2 ?
    am I close?
    " be nice it's people like me that make people like you look smart"
    yes I read the datasheet, of the 300 pages I understood 10

  2. #2


    Did you find this post helpful? Yes | No

    Default OK... you got me !! ;-)

    Hi all

    Apologies for the confusion .. I had left an important line out of the schematic in my rush to share.

    All is fixed now !! The new corrected schematic is attached.

    I don't know how those bad schematics got here ..HUMAN HUMAN HUMAN.. grrr!

    @BobK .. well we could have been trying a current limiter or 'floating points' ;-)
    Valid chirp though was laughing like mad at myself for forgetting a track in schematic and spot on it should connect somewhere for the PIC to be of any use ...!

    @grounded , damn right... build it , and see the magic ;-), works like a charm!

    @Bruce GPIO.2 conects right between the 10K potentiometer and the LDR

    Build it build it build it !

    Kind regards
    Dennis
    Attached Images Attached Images  

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I used a similar circuit for an Intel 8749 Micro-Bot project I wrote for Circuit Cellar way back
    in 1998, issue #92, to turn on a set of bright LED headlights on my robot.

    Worked really well. Robot entered a dark area, and headlights turned on automatically.

    Moved into the light, headlights turned off.

    http://www.circuitcellar.com/archive...ents/1998.html

    Déjà vu ehh...;o)
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4


    Did you find this post helpful? Yes | No

    Default Can't see it :-(

    Hi Bruce


    Unfortunately I can't get to see the article/place/page referred to in your link as I am not a subscriber :-(
    Looks like a very interesting magazine(s) based on the tables of contents!
    I always used to read Elektor magazine which aslo had some very interesting articles and projects.
    Would be very interested to have a look though.. perhaps you could show a schematic or code ?

    What got me started on the LDR mission was this site http://www.doctronics.co.uk/ldr_sensors.htm as I needed to understand the working of LDR's.

    Earlier today I was wondering what would happen if(and when) the supply voltage would drop below the 5Volts I was using for calculations.
    Need to dabble a little bit more by dropping the supplied voltage and see what the results are, hope to be able to give some feedback on that shortly.

    Kind regards
    Dennis

    Kind regards

    Dennis
    Last edited by Dennis; - 18th February 2010 at 01:06.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Dennis,

    Unfortunately - you can't view the article or code without buying a copy of the original
    March 1998 issue #92 from Circuit Cellar. Assuming they even have a copy of an article
    that old.

    The code would mean very little to you if you're only familiar with BASIC since it was all in
    Intel 8749 assembler using the very old Intel ISIS assembler. It was similar to standard 8051
    instructions with a few differences due to the old 8749 architecture.

    It would hardly be worth buying a copy of that old article if you're only using PICs, and the
    schematic for the LDR sensor circuit was essentially the same as what you already have.

    Edit: I think Elektor or some other magazine just bought-out Circuit Cellar, so maybe they
    now have all rights to old articles? Not sure, but I know Circuit Cellar was bougth-out!

    It just turned on/off two very bright LEDs for the headlights. It was a cool project, but
    way outdated for now.

    The neat part about the robot was it had push-button switches that allowed you to enter
    the time to move in certain directions. If you messed it up, you just re-programmed it to
    follow a course for specific time periods in fwd, rvs, back, left, right, etc. It didn't have any
    sensors to detect obstacles since it was designed as a game - where you would compete
    against other users to program the bot to navigate different courses.

    It had 2 7-segment LEDs to view program entries. It was really simple, but a ton of fun at
    parties. And it was my first article ever published in a major magazine.

    Edit: I think Elektor bought Circuit Cellar, so they may now own the rights for old articles?
    Last edited by Bruce; - 18th February 2010 at 01:39. Reason: Elektor
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6


    Did you find this post helpful? Yes | No

    Default That is pretty cool!

    Bruce ...

    So the robot could navigate a maze if programed correctly and if the maze lights went off or if there weren't lights is would provide headlights ?

    That would be pretty cool for caves and for video cameras and cameras too.
    The LDR circuit could also give older cars the ability to provide auto-headlights.

    Now I'm wondering how to adapt the circuit to allow for light readings because right now the circuit (PIC and LDR) don't really know the difference between darkness and a cloudy/rainy day.
    So a possible change here could be to add a humidity/rain sensor and with the right logic and program, this circuit would ,for example, know when to switch a sprinkler system off because it is raining!

    Kind regards

    Dennis

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Yeah - it was pretty simple stuff. You entered the number of seconds for the robot to move
    in fwd, rvs, left, rght, or backwards to navigate a course. The headlights just turned on or
    off based on light levels. Nothing fancy. It had zero sensors except for the LDR.

    The average person had to re-program it around 4 times to make it through most simple
    courses, but it was tons of fun. You could do the same thing with around 50 lines of PBP
    code on a PIC. It was several hundred lines of 8749 assembler. Boy have times changed.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Stairwell light code from BS1 to PHP2.50a
    By vtt-info in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 21st December 2007, 18:32
  2. A/D on 16F767 for light tracking.
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th November 2007, 06:56
  3. Reading a Light Dependent Resistor
    By kiwipiper in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 21st October 2007, 06:29
  4. Replies: 5
    Last Post: - 2nd March 2006, 10:21

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