I developed a solar light controller / timer. What happens is the PIC monitors the voltage from the solar panel. When the panel voltage drops below a certain amount a timer is started. The light comes on when the timer expires.
The reason for this is on our previous purchased controller, it turned the light on when the voltage dropped to zero. The problem was there was still plenty plenty of ambient light, just not enough for the panel. Hence the reason for the timer.
I just realized that I have a small bug in my software. Should the power fail at night (disconnected battery), the timer will start again from zero. Not a big problem really but it would be nice to avoid it.
One thought I had would be to store the fact that the light is already on in eprom. If the PIC comes up again and it is dark and the eprom value is true then the timer does not start and the light comes on right away.
Any other ideas on how to solve this?
The reason for this is on our previous purchased controller, it turned the light on when the voltage dropped to zero. The problem was there was still plenty plenty of ambient light, just not enough for the panel. Hence the reason for the timer.
I just realized that I have a small bug in my software. Should the power fail at night (disconnected battery), the timer will start again from zero. Not a big problem really but it would be nice to avoid it.
One thought I had would be to store the fact that the light is already on in eprom. If the PIC comes up again and it is dark and the eprom value is true then the timer does not start and the light comes on right away.
Any other ideas on how to solve this?