Photoresistor light (LED)

Thread Starter

1-3-2-4

Joined Dec 26, 2008
199
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?
 

thatoneguy

Joined Feb 19, 2009
6,359
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.
 

thatoneguy

Joined Feb 19, 2009
6,359
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.
 

Thread Starter

1-3-2-4

Joined Dec 26, 2008
199
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?
 

Bernard

Joined Aug 7, 2008
5,784
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].
 

Attachments

Last edited:

Thread Starter

1-3-2-4

Joined Dec 26, 2008
199
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..

 

Kermit2

Joined Feb 5, 2010
4,162
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. :)
 

Thread Starter

1-3-2-4

Joined Dec 26, 2008
199
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.
 

Thread Starter

1-3-2-4

Joined Dec 26, 2008
199
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:

tracecom

Joined Apr 16, 2010
3,944
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.
 

tracecom

Joined Apr 16, 2010
3,944
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.
 

Attachments

Last edited:
Top