Newbie with photoresistor problem


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default LDR is a SENSOR - not a controller

    The Light Dependent Resistor is a sensor. Its resistance is way too high to drive any conventional low cost motor. In darkness the LDR will be several megohms. In bright light it will be under 1000 ohms, depending on make and model.

    You need to measure the LDR with either the POT command or an ADC and then convert that to a PWM signal to drive the motor.

    HTH
    BrianT

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Here is a sample circuit to drive a dc motor with a(n) LDR.

    Works in simulation at least!



    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2817&stc=1&d=121878587 6" >
    Attached Images Attached Images  
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Feb 2010
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Seems to work in reverse

    Quote Originally Posted by sayzer View Post
    Here is a sample circuit to drive a dc motor with a(n) LDR.

    Works in simulation at least!



    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2817&stc=1&d=121878587 6" >
    Sayzer, thanks for posting the schematic.

    I too need to turn on a motor with a LDR, however, when I made the circuit as diagramed, it works in reverse. It turns the motor on in light, and off in darkness.

    Does anyone know what do I need to do to make the motor turn on in darkness, and off in light?

    thanks

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Flip LDR and R1???
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Feb 2010
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Flip LDR and R1???
    Hi mackrackit, I tried that, but the motor stays on in light or dark.

    Someone told me that in that case, I need to increase the Ohms of R1. (R1 is currently 10k Ohm, 1/2 watt.)

    I'm not too proud to say that I know NOTHING about what we are talking about here. How do I figure out what R1 needs to be?

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    LSD and R1 are creating a voltage divider that will bias the transistor.
    Think about the resistance of the LDR in light or dark , measure it.
    Then use a voltage divider formula to figure what R1 should be to bias the transistor.

    Probably the easy thing to do is make it adjustable. Replace R1 with a pot.
    LDRs are all different under different lighting.
    Dave
    Always wear safety glasses while programming.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Is this a new post or revival of a very old one? Either way, this approach is not very good on many many levels. BrianT is dead-on.

    Here are some questions to ask to start with:

    No where is it mentioned how big this motor is. This will directly effect how big the transistor is. So there is the first question; how much current do you need and what is the in-rush current going to be? Ignore in-rush to your own peril (I've seen TO-3 cans vaporized). Once you answer this you can then decide whether an NPN will do it, or do you need something more like a Darlington device? You'll want to keep loses to a minimum and deal with the in-rush so at the very least we know we can use PWM. This can control in-rush as well as give speed-control (if you want).

    LDR's are notoriously loose in their tolerance. Do you actually need an LDR or would a photo-diode be a better choice? In either case you have to consider hysteresis. If you do not then you can very easily get into a situation where the motor will stutter if a cloud or a person passes by. The simplest thing would a comparator (useful but) use an ADC and perform hysteresis in software. This is all going to be very low speed stuff so you have tons of time to measure the "photo-detector".

    I see one of the 8 pin PIC's with pins left over to drive a led or two for whatever, measure battery voltage for an under-voltage lock-out, measure current, serial output...

    Mike Tripoli

  8. #8
    Join Date
    Mar 2015
    Posts
    1


    Did you find this post helpful? Yes | No

    Default Re: Seems to work in reverse

    How much voltage do I apply for running that motor?

Similar Threads

  1. Newbie making an ignition timer
    By ChrisHelvey in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 5th August 2012, 17:45
  2. Newbie HELP :(
    By TheOne in forum mel PIC BASIC
    Replies: 3
    Last Post: - 27th March 2009, 17:15
  3. Newbie: Temperature measurements
    By Budda in forum General
    Replies: 10
    Last Post: - 30th March 2007, 09:56
  4. PIC Newbie
    By azmax100 in forum Schematics
    Replies: 7
    Last Post: - 23rd February 2007, 04:52
  5. request for a newbie forum
    By nimonia in forum Forum Requests
    Replies: 1
    Last Post: - 20th May 2006, 09:01

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