Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Light Detector

Status
Not open for further replies.

vne147

Member
Hey everyone. I have project in mind requiring a circuit to be designed that would turn on an LED around sundown every day and then turn it off at sunrise. I know that one can use photo transistors for this type of thing but I am uncertain if this approach would work for my purposes because I only want the LED it be turned on and off by sunlight. The finished project will most likely by on a window sill or in an area exposed to sunlight but will also be subjected to ambient light (i.e. incandescent light, fluorescent light, TV, computer monitor, etc). How would I go about making a circuit that would turn on an LED at sundown but not turn it off again when someone turned on an overhead light for instance? I’m very familiar with PICs, LEDs and standard logic circuits so the advice I need mostly pertains to the light detection portion of the circuit. Please let me know if you need more details than I have provided and thanks in advance for the advice.
 

dougy83

Well-Known Member
Perhaps you could try build a colour detector using multiple LDRs/phototransistors and coloured filters. Set the valid range for each colour component using window comparators, and switch the light on when all colour components are within the valid range.
 

marcbarker

New Member
turn on an LED around sundown every day and then turn it off at sunrise.

I think it can be done with a 555, an LDR, and a couple resistors.

put the LDR outside, or somewhere artificial light can't (significantly) affect it

:) Maybe someone will post a schematic...
 

vne147

Member

Hero,
I read the page your link pointed to but I don't understand how I could use this approach to prevent ambient light (i.e. an overhead light inside the house) from triggering the circuit. Am I missing something? Thanks.

Perhaps you could try build a colour detector using multiple LDRs/phototransistors and coloured filters. Set the valid range for each colour component using window comparators, and switch the light on when all colour components are within the valid range.

Dougy,

I like where you're going. I did have some ideas before posting this question. One idea I had was similar to what you are driving at I think. What if I made the light detector only trigger from a specific wavelength that is only present in sun light? My first guess said there might be some UV components in sunlight that aren't present in 99% of all normal ambient light that might be in the average home. You would need to elaborate a little on your approach for me to really get started. Maybe there is some online info or tutorial you could link me to? Thanks.
 

vne147

Member
I think it can be done with a 555, an LDR, and a couple resistors.

put the LDR outside, or somewhere artificial light can't (significantly) affect it

:)

Thanks for the suggestion but the project will need to be self conatined. I can't put some components outside while keeping the bulk of it inside. Any other ideas?
 

marcbarker

New Member
Any other ideas?
Yes, place the sensor against the inside of the window, facing outwards of course. Or put the whole thing outside, with the LED visible from inside.

I think it can be done with a 555, an LDR, and a couple resistors.
 
Last edited:

Hero999

Banned
Hero,
I read the page your link pointed to but I don't understand how I could use this approach to prevent ambient light (i.e. an overhead light inside the house) from triggering the circuit. Am I missing something? Thanks.
The sun is much brighter than the artificial lights inside the house so setting up the turn on threshold so it only lights during the day should be easy. Pointing the LDR towards the window, away from all the light sources in side the hous, would also help.
 

marcbarker

New Member
The sun is much brighter than the artificial lights inside the house so setting up the turn on threshold so it only lights during the day should be easy. Pointing the LDR towards the window, away from all the light sources in side the hous, would also help.

That's kinda what I just said too :)

I also said it can be done with a just a CMOS 555, one LDR, and 2 resistors. Job done. Maybe that solution wasn't 'complicated' enough? :rolleyes:
 

Hero999

Banned
An LM311 comparator might also be a good idea.

Heck if you used a UV detector it wouldn't be activated by incandescent lighting, fluorescents might be a problem though.

Another solution would be to use both an IR and UV detector and only activate the LED if both are stimulated but this could be confused if there's both incandescent and fluorescent lighting.

I can't think of anything that is totally foolproof short of an optical spectrum analyser which won't be simple or cheap.
 

marcbarker

New Member
Dunno why it's got to be so complicated.

With whole thing self-contained, just a CMOS 555, one LDR, and 2 resistors, with the LDR against the window would meet the OP requirements.

311 solution of the above would have 4 resistors.
 
Last edited:

Hero999

Banned
555 will have a huge amount of hysteresis, maybe too much.
 

vne147

Member
I will be using a PIC in the project so I don't think the 555 will be necessary and I should be able to aviod any hysteresis problems with proper programming. I plan on placing the finished project on the window sill so I could just ensure that the detector faces outside but I did kind of want it to me more fool proof than that. I'll start playing around and see where I end up.
 

Hero999

Banned
Does the PIC have a built-in comparator? You could use that.

Heck why not include a clock so it doesn't turn on in the day when it's cloudy? If you're cleaver you can program it so the clock sets itself using the diurnal cycle of dark/light.
 

vne147

Member
I haven't selected the specific PIC yet but I was planning on getting one with a comparitor or at a minimum onboard ADC. The project will be a gift so when it arrives I would like to have the recipient just take it out of the box, set it on the window sill and turn it on. I'm not sure how I could use timers in the programming and make it work from the start that way without having seen at leats one day/night cycle to "calibrate". I have thought of using an RTC and setting it before I shipped it but I'm not sold on that approach yet.
 

vne147

Member
I found this on the GE site:

"a paper by the National Electrical Manufacturers Association (NEMA) explores this subject in more detail. It cites a study in which it was determined that UV exposure from sitting indoors under fluorescent lights at typical office light levels for an eight-hour workday is equivalent to just over a minute of exposure to the sun in Washington, D.C. on a clear day in July"

That tells me that for the most part the intensity of UV light coming from fluorescent lights (with the exception of a tanning bed maybe) is orders of magnitude less than that from the sun. I think I'm going to go with the UV light detector idea and just make sure I set the threshold appropriately. I wouldn't want it to be affected by clouds or storms but the above quote makes it sound like even on a cloudy day the UV from the sun would still be much more than the average overhead fluorescent lights. I think using the UV idea would also prevent pretty much every other type of typical house hold lighting from triggering it. What do you think?
 

Hero999

Banned
It depends on where you live, here in the UK the street lighting stays on all day when it's dark and cloudy in winter.
 

marcbarker

New Member
555 will have a huge amount of hysteresis, maybe too much.

What? Night= megohms Day=1kohm :) Maybe I'm wrong

Anyway PIC is even better, + 2 resistors & an LDR.

If it's a daylight UV sensor it'll need amplifying or include an amplifier, that works off low voltage. Good luck.

Of course if it's PIC-based and battery powered, the sensor doesn't need to be on all the time, the PIC can energise it for a few seconds every 1/4 hour

And if it's via PIC ADC, the PIC could remember how dark it was last night when it chooses the hystersis.
 
Last edited:

vne147

Member
I assumed the hysteresis Hero was talking about would happen around sundown and sunrise when the light level was close to the threshold. The LED would blink for a while before it came on and stayed on or went off and stayed off. Maybe I misunderstood.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top