It seems a sentence was left out of my posting!

I wish to log the power failure durations, times and dates as well and that's why I would like to use a PIC as well an an RTC.
The PIC cirucit would either form part of an existing circuit or be battery/solar powered and have little or no draw on my home circuit.

Kind regards
Dennis

Quote Originally Posted by Dennis View Post
Hi all

Because of the amount of power failures in our area , I am building a circuit to auto-switch my generator because it's quite a mission getting up at 2am sometimes to go and switch it on when there is a power failure.

I plan to use an opto-isolator initially to detect the power failure however some form of zero-crossing detection may also be a consideration.

This of course raises a good few (maybe silly for some) questions:
1.Which would most accurately detect the pulses ? PULSIN or COUNT? are there other methods?
2.Using either of these does the incoming pulse have to be a known value or can on just check to see if a pulse (of any/unknown size) exists ?
3.Have I chosen the correct RTC (DS1302) for the job ?

I have been searching the forum for the last few days but haven't yet found the right example.

I really would appreciate some advice or guidance on how to detect the pulse and absence of a pulse just to get me started.


Kind regards

Dennis