Newbie with photoresistor problem


Closed Thread
Results 1 to 11 of 11

Hybrid View

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

  2. #2


    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

  3. #3


    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.

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