Newbie with photoresistor problem


Closed Thread
Results 1 to 11 of 11
  1. #1
    Karthik's Avatar
    Karthik Guest

    Red face Newbie with photoresistor problem

    The following is a very simple circuit that uses a photoresistor as a switch to run a motor using a battery pack. But for some reason no matter how much light i expose the photoresistor to it does no conduct. The general resistance without any light is 200, 000 ohm. and using a torch it is 440 ohm. HELP.
    Attached Images Attached Images  
    Last edited by Karthik; - 13th August 2008 at 20:02.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Karthik View Post
    The following is a very simple circuit that uses a photoresistor as a switch to run a motor using a battery pack. But for some reason no matter how much light i expose the photoresistor to it does no conduct. The general resistance without any light is 200, 000 ohm. and using a torch it is 440 ohm. HELP.
    ----------------------
    | |
    | Photoresistor
    Battery |
    Pack |
    | |
    | Motor
    | |
    ---------------------
    Most assuredly NOT the way to run a motor using a photoresistor. Sounds real good in theory for somebody that doesn't know any better, but still, not the way to do it.
    You might be wanting to use a phototransistor to do this job. But again, not the best way to do the job.
    And how does this tie in to PicBasic?

  3. #3


    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

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

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

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

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

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

  9. #9


    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

  10. #10


    Did you find this post helpful? Yes | No

    Default Perhaps add more check to the sensor

    Look at the circuit I posted here
    http://www.picbasic.co.uk/forum/show...4777#post84777

    You can actually add this functionality to to a PIC timer (one that acts as a timer using timer0 and/or timer1) and does not use an RTC , your choice though).
    By adding the timer to it you could do something like :
    Code:
    IF daylight AND time is daytime THEN motor_pin OFF
    You could also go on to add things like a temperature controller and humidity sensor.
    All of these combined could determine whether it is dark outside because of rain or a storm or a passing aeroplane or bird or insect on the sendor :-)

    So our light sensor becomes quite a smart device.

    Anyways , just a thought :-)

    Kind regards
    Dennis
    Last edited by Dennis; - 28th February 2010 at 12:55.

  11. #11
    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 : 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