PDA

View Full Version : Detecting night time



Switch
- 30th January 2009, 11:42
I have an application where I need to reliably detect night time, i.e. darkness, not just bad weather or a shadow but nighttime, a current product has an issue of activating in moonlight or with car headlights, any ideas ?

mackrackit
- 30th January 2009, 13:35
Maybe...
The moon/bad weather could be solved by adjusting the sensitivity. I will assume you are using an ADC for this. Have the sensor shaded from the moon directly. Adjust so moon light appears as clouds or bad weather.

The car lights ... Maybe a counter. The light would have to hit the sensor for a predetermined time (count) before it is activated.

Jerson
- 30th January 2009, 15:10
Nice application. I would think you can use photo sensors placed in directional tubes facing opposite directions like left and right separated by a tall barrier. This will ensure only night / darkness on both sensors will trigger your circuit. I'm too lazy to sketch it out right now ;)

Melanie
- 30th January 2009, 16:19
>a current product has an issue of activating in moonlight or with car headlights, any ideas ?

Sensitivity adjustment will take care of moonlight.

An activation/deactivation Time-Delay will take care of Car Headlamps.

A Time-Clock will take care of switching during Daylight Hours. Most places on the planet publish "Lighting-Up" Times.

A combination of all three should give you a better product.

Oh... and sensible positioning of the Sensor (like pointing skywards - and not towards where the moon normally traverses) always helps!

muddy0409
- 31st January 2009, 02:05
Or you could eliminate all this automatic stuff by handing it to someons sitting at a window with the following short instructions:

If dark = 1 then turniton 'now night
if dark = 0 then turnitoff 'now day

This would also help with the unemployment problem, but probably not with sales.


------------------------------------------------------------------
Oh dear, I am sorry, I just couldn't resist.
Yeah, I know, some people are just no bloody help at all, are they?
I'm just gonna go sit in the corner for a while

Switch
- 2nd February 2009, 12:32
Muddy little help but made me smile :)

Still thinking about this, I have had another idea and quite a good one I think, how about using a small solor panel.

RussMartin
- 2nd February 2009, 16:48
Since there is effectively no naturally-occurring infrared (IR) in the night sky but lots of it during the day (even when overcast), would an IR photodetector be a possible solution?

grounded
- 2nd February 2009, 18:48
with my hobby projects I use a 10k pot,1k safety resistor and 10k photo cell
you can add a little "debounce delay " for the headlights and cal with the pot



LDR=1 'POWER UP LIGHT SENSOR
Pause 20
ADCIN 0,NIGHT 'READ AN1 & STORE IN NIGHT VAR
PAUSE 250
IF NIGHT=<400 then IT'S DAY SO DO THIS
IT'S NIGHT SO DO THIS
Pause 25

LDR=0 'MAKE SURE LDR/ADCIN POWER IS OFF

Archangel
- 3rd February 2009, 01:33
Here is an example of a delay to avoid headlight induced lights off.


LIGHTS VAR PORTA.0
DAY VAR PORTA.1

MAIN:
IF DAY = 1 THEN
PAUSE 10
IF DAY = 1 THEN
LIGHTS = 0
ELSE
ENDIF
ENDIF
LIGHTS = 1
GOTO MAIN

END