Photoresistor light (LED)

Discussion in 'The Projects Forum' started by 1-3-2-4, Jan 14, 2012.

  1. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
    I'm trying to figure this out since I don't think it's been tried before.. I have two royal blue Cree LED's I also have a 1 A LED driver to drive them which is constant current from likr 5-32 VDC if I recall right..

    So I want them to come on at dusk and off during the day.. I already have a power supply to run them so that's no issue but I'm trying to figure out about the photoresistor.. I'm guessing I'm going to need a transistor, no?
     
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    What is your Driver, what is the voltage of your power supply for the LEDs?

    For what I have in mind below, you'd need a 5V and a 32V supply for logic and dimmer, +LED source. This can be changed, but will use more transistors, which it doesn't sound like you are interested in.

    Option #1:
    You could use the photoresistor as the lower half of a voltage divider, so as it gets darker, the voltage at the top of the photoresistor rises. The top half of the voltage divider would be a potentiometer to set the level of light/dark where the lights are enabled.

    Feed the output of that into a Schmitt Trigger inverter IC (74HC14), which provides hysteresis so it won't flash off and on during the transient period, and use the output of that to the control wire of your Driver if it takes a linear voltage.

    You'll need to use a transistor to boost the voltage if the controller needs more than a 5.5V control signal. In that event, put the photoresistor on the top side of the voltage divider to the Schmitt Trigger Inverter, as the output will be inverted again through the transistor. You'll also need one more resistor between the logic output and the transistor, but that's it for parts. Well, that and a 5V supply.

    Option #2 would be using comparators to give you the hysteresis you need, but without using logic ICs, eliminating the transistor part.

    Let me know if you understand this, or I can make a schematic, once I know what the control voltage for your LED driver is, and how much current it draws.

    I'll also need the "sunlight", the "room light", and the "dark" resistance of the photoresistor. Reason for the three readings is some are more linear or logarithmic than others, knowing the response helps pick the correct size potentiometer for the other resistor in the divider with the photoresistor to adjust the switching level.
     
  3. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
    This is my driver here in the 1 A version

    http://www.luxdrive.com/products/powerpuck-2008b/

    My voltage is 12 VDC I will be running them in series

    You lost me a bit on the other stuff.. is the 74HC14 really needed? Because I would need to order all that stuff.
     
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Ok, Ignore most everything in the post above. You do not have a control line on that buck converter per the datasheet linked.

    The logic IC was a simple way to get hysteresis without a more complicated comparator circuit, which will need to be used.

    The concept is still the same, photoresisotor and variable resistor in series to give an output voltage relative to the light.

    Then a comparator with hysteresis, which means at the point when the light turns on, it has to get brighter than that point to to turn back off again, and when the point to turn off has been reached, the point to turn on changes as well. This prevents the light from turning on and off during sunrise/sunset.

    So now we are at the voltage divider, a comparator with hysteresis, and the output, which will have to handle the full current drawn.

    1A is the maximum current, and using 12V, the switching can be done with a MOSFET, so we are at about a dozen components.

    I took your question about transistors as meaning you didn't want to work with them, so I went the logic IC route, thinking 5V operation didn't read first post well enough :rolleyes:. Then at the very end of the post, I saw 32V, so that's where that mess came from.

    It's pretty late for me, hopefully you'll get more input from other members regarding the comparator and MOSFET switch for the BuckPuck. It's overall not that complicated until the MOSFET part, which is still straightforward.
     
  5. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
    haha no I did not mean to say I did not want to work with transistors I was just wondering if it was needed.. since this is going in the kitchen and knowing someone is going to turn on the light (these things are bright at 1 A) it's going to shut off anyways then turn back on.

    The 74HC14 you listed you said that does hysteresis right?

    The info I gave about the voltages was the range that the buck supports, I will be just using 12 v to power it is the MOSFET still needed?
     
  6. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
  7. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    395
    Here are some scratchings to show a possible solution using a comparator & P-Ch MOSFET. The + input is biased to about 5 V, Assume VR set to 10K, it's bright so LDR is less than 10k, gate is high, FET is off. Light fades, LDR V climbs above 5v, gate goes low, FET on, RF increases LDR V by about 1V holding comparator output solidly low. [ I think].
     
    Last edited: Jan 14, 2012
  8. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
    Crap I picked up a N-channel MOSFET instead of P-ch

    It looks rather simple.. I picked up a few things from radio shack this afternoon which some things can be used for this or something else..

    [​IMG]
     
  9. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    Then maybe you want to experiment with the attached. I haven't built it, but it's worth a try.
     
    1-3-2-4 likes this.
  10. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
    What is the IRLZ44N some transistor but rated for what?
     
  11. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    It's an N channel MOSFET, but it's way overpowered for your needs. If you have an N channel, try it.
     
  12. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
    Ah ok because I was looking at the one I picked up a IRF510 yeah way overpowered but I guess it will have to do.
     
  13. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,771
    930
    A cheap and simple solution of light and dark detection/switching has already been solved.
    It floods the big box home improvement stores and other large stores. Light sockets that you put a bulb in which contain all the circuitry inside to switch it on and off.
    Couldn't you use such a light sensing device(110V) and control the AC voltage input to the supply, thereby turning it on and off with the sunrise and sunset.

    If I'm missing the point of your question or you just want to build up some circuits for the experience, then excuse this interruption. :)
     
  14. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
    It sounds cooler when you say you made this ;)

    also for a little 'extra" I picked up some green LED's so I'd know when the LED's are on (I'd know anyways) but just for safety if the LED's ever failed I'd know the circuit is still working by the LED will light green when it's sending power to the puck.
     
  15. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
    hmm well it lights up.. however something must be wrong because any light that hits the Cds the LED still stays on..

    maybe I did something backwards?

    ive got the 100k resistor between the inverting input and ground & the LDR
     
    Last edited: Jan 15, 2012
  16. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    If the puck is being powered continuously, then either the MOSFET is wired wrong, or it's never turning off. If it's never turning off, then check the output from the op-amp to see if it is switching. If not, then there is something wrong with it or with the way the voltage dividers are wired.

    Draw a schematic (hand drawn is ok) of exactly what you built. In the process of drawing the schematic, you may discover a wiring error. If not, then post the schematic here and maybe someone can see what's wrong.
     
  17. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
    Yeah I will check when I get home with the scope
     
  18. 1-3-2-4

    Thread Starter Active Member

    Dec 26, 2008
    194
    1
    I know this is not the greatest but I don't draw out too many..

    Ok one thing I think I said before I don't see any change on the output pin of the 741 light or dark.
     
  19. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I see a couple of problems on the schematic. First, you should not have the MOSFET's gate connected to its drain; delete that connection. Second, you need a 100k pulldown resistor from the MOSFET's gate to ground. See if that helps.

    ETA: In looking at the photo (which is nice and sharp), I see two 100k resistors, so you may have actually included the pull-down from the MOSFET gate to ground, but double check it to make sure. I don't see a wire from the gate to the drain, but if they are connected, that's a problem.

    BTW, I have breadboarded the circuit, and have it working with an IRL44Z, so there's hope.
     
    Last edited: Jan 15, 2012
    1-3-2-4 likes this.
  20. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Once it is working, all you need to do is add a small touch of positive feedback to add hysteresis to the complete system so it doesn't toggle on/off when the light is on the borderline of the setting.

    Link with info on why it is a good thing
     
    tracecom and 1-3-2-4 like this.
Loading...