Dawn or Dusk Detector

While developing a Solar Power sensor to add to my weather station, I hooked up a small Silicon Solar Cell rescued from a LED Garden light to an Analogue Port. (see photo) I found the open circuit voltage gives a very clean signal rising quickly at dawn and falling the same way at dusk. It does not require direct sunlight and appears to be quite tolerant of variations in ambient daylight eg clouds (probably because it is unloaded to a large degree). It produces a very clean zero signal at night time. (see graphic)

So if you are looking for a sensor to control your pet doors, animal feeding regimes, blinds, irrigation or whatever this maybe quite useful to you. I am still experimenting with a load resistor to get a better idea of solar 'power', but I thought this preliminary observation maybe useful for other projects.

Cheers, Rob

SolarCell.jpg

solar.png

Thanks for sharing.
+1

Don't forget to use a (10k) resistor between solar+ and analogue (or digital) input.
Even this small cell can put out enough current to phantom-power un unpowered Arduino through the input pin.
Add a 100n cap from Arduino pin to ground, and you also have some RF rejection in case a long cable is used.
Leo..

10k. By coincidence that was my first choice as a load. I am thinking maybe 500R-1k maybe needed. Cable very short so no capacitor required, it appears very immune noise anyway.

Hi,
Interesting use of the solar cell. I like it..

Might be interesting to find the statistics for your location/date. There are 3 different definitions of dusk/dark. Mine today are like this:

Civil Twilight        6:10 AM EST 4:56 PM EST
Nautical Twilight      5:35 AM EST 5:31 PM EST
Astronomical Twilight 5:01 AM EST 6:05 PM EST

Most people are probably thinking this:

Civil Twilight
The time period when the sun is no more than 6 degrees below the horizon at either sunrise or sunset. The horizon should be clearly defined and the brightest stars should be visible under good atmospheric conditions (i.e. no moonlight, or other lights). One still should be able to carry on ordinary outdoor activities.

OR:

Nautical Twilight
The time period when the sun is between 6 and 12 degrees below the horizon at either sunrise or sunset. The horizon is well defined and the outline of objects might be visible without artificial light. Ordinary outdoor activities are not possible at this time without extra illumination.

OR

Astronomical Twilight
The time period when the sun is between 12 and 18 degrees below the horizon at either sunrise or sunset. The sun does not contribute to the illumination of the sky before this time in the morning, or after this time in the evening. In the beginning of morning astronomical twilight and at the end of astronomical twilight in the evening, sky illumination is very faint, and might be undetectable.

It would be interesting to see if you can tell the difference between these, with a higher resistance load...

terryking228:
Interesting use of the solar cell. I like it..

This started some time ago when LDR light sensors failed too quickly in outside conditions.
I think moisture ingress was the main problem.

robwlakes:
10k. By coincidence that was my first choice as a load. I am thinking maybe 500R-1k maybe needed. Cable very short so no capacitor required, it appears very immune noise anyway.

I did not mention "load".
10k between solar+ and the "very high impedance" input pin does not "load" the cell at all (when the Arduino is on).

The 10k series resistor prevents the Arduino being powered through the pin protection diodes when the Arduino happens to be off and the cell is in sunlight. That could fry the pin.

If you want to load the cell, use a resistor across the cell.
But that seems not needed if you look at the graph.
Leo..

I tested the cell in full sunlight and it just scraped a little over 2volts. The system has a rechargable cadmium cell inside (only 1.2V) and the LED is white so probably requires about 3V at least, hence the little inverter chip. I don't think the Arduino Pro is likely to fire up on 2V, maybe 2.5V. However for others who try this, find the maximum voltage of your solar cell before you ignore wawa's advice. The two cells in the attached photo are different. The smaller square one is the type I am recommending. Whereas the circular type generates about 5-6V!! So it must have a couple of cells in series inside the one package. I intend to use the circular cell(s) to charge the battery that will ultimately power the sensor. So it maybe possible to just go with the circular system and use a voltage divider and the computer (UV sensor and Lightning detector) et al will be the load?

And Terry, I never thought a sunset could be so complicated, nice work though!! I have wondered, if it was possible to establish a self correcting clock by averaging the time between Sunset and Sunrise to find the middle of the day, and hence have the clock self correct (mmmm rather than jumping around in the middle of the day, which could be disconcerting, so perhaps averaging the darkness would work, and center adjustments on midnight?).

The 10k resistor is too light a load on the square solar cell as it climbs to near peak voltage early in the morning, even without direct sunlight. I feel it is not working hard enough. Very overcast today so I can not begin to check it. Though when lightly loaded it could move quick enough to come close to discriminating different levels of "Dusk" if required.

Cheers, R

I tested the cell in full sunlight and it just scraped a little over 2volts. The cadmium cell inside is only 1.2 and the LED is white so probably requires about 3V at least, hence the little inverter chip. I don't think the Pro is likely to fire up on 2V, maybe 2.5V. However for others who try this, find the maximum voltage of your solar cell before you ignore wawa's advice. The two cells in the attached photo are different. The smaller square one is the type I am recommending. Whereas the circular type generates about 5-6V!! So it must have a couple of cells in series inside the one package. I intend to use the circular cell(s) to charge the battery that will ultimately power the sensor. So it maybe possible to just go with the circular system and use a voltage divider and the computer (UV sensor and Lightning detector) et al will be the load?

And Terry, I never thought a sunset could be so complicated, nice work though!! I have wondered, if it was possible to establish a self correcting clock by averaging the time between Sunset and Sunrise to find the middle of the day, and hence have the clock self correct (mmmm rather than jumping around in the middle of the day, which could be disconcerting, so perhaps averaging the darkness would work, and center adjustments on midnight?).

The 10k resistor is too light a load on the square solar cell as it climbs to near peak voltage early in the morning, even without direct sunlight. I feel it is not working hard enough. Very overcast today so I can not begin to check it. Though when lightly loaded it could move quick enough to come close to discriminating different levels of "Dusk" if required.

Cheers, R

PS. Photo has been attached now!

SolarCells.png

robwlakes:
I have wondered, if it was possible to establish a self correcting clock by averaging the time between Sunset and Sunrise to find the middle of the day, and hence have the clock self correct (mmmm rather than jumping around in the middle of the day, which could be disconcerting, so perhaps averaging the darkness would work, and center adjustments on midnight?).

Had that idea also a long time ago, but other projects aren't finished yet.
Shouldn't be that hard to log dawn/dusk millis(), and average that to "middle of the day/night".
Even working out the seasons should be possible.
Leo..

Wawa:
Had that idea also a long time ago, but other projects aren't finished yet.
Shouldn't be that hard to log dawn/dusk millis(), and average that to "middle of the day/night".
Even working out the seasons should be possible.
Leo..

Interesting idea. If you are prepared to wait long enough for sufficient samples to be collected, the clock may even be able determine its own location (although you may have to know which hemisphere it is in).

robwlakes:
I have wondered, if it was possible to establish a self correcting clock by averaging the time between Sunset and Sunrise to find the middle of the day, and hence have the clock self correct (mmmm rather than jumping around in the middle of the day, which could be disconcerting, so perhaps averaging the darkness would work, and center adjustments on midnight?).

Have a look at this library and this thread regarding using dawn/dusk to set a clocks time.