A long-term timer circuit designed to remind you when your machine or equipment needs maintenance. If the warning or blocking time is not reached, the LED-2 indicator will remain lit, acting as a work monitoring LED. When the time is greater than or equal to the warning time, LED-2 will blink, alerting the machine operator to the need for maintenance.
This time is set 7 days before the specified lockout time. When the maximum time (1 year or another user-selected time) is reached, only LED-1 will remain lit. At this time, the relay will close, preventing the machine from operating.
If you do not wish to use this machine lockout feature, you can use only the LEDs as a maintenance reminder without using the relay output of the circuit.
To keep the circuit simple, the maintenance time is programmed in the software file. If you need other values, change them and recompile with the CCS C Compiler (CCS PCM C Compiler, Version 3.200).
You will then program the PIC12F675 with the new hex file obtained from this compilation. This change can be made in the ‘user definition’ as can be seen in the following code section:
CCS C Code User definition
// User definition:
// Select the desired time in hours for the machine lockup to occur.
#define NUMBER_OF_HOURS 8760 // Desired maintenance time (in hours)
// 1 year = 365 days -> (365 days x 24 hours = 8760 hours)
// Select how many hours must pass before the warning LED starts blinking
#define NUMBER_OF_HOURS_BEFORE 168 // LED starts blinking 7 days before shutdown
// (7 days x 24 hours = 168 hours)
Annual Timer Circuit Diagram

A switch is located on pin 4 of the PIC12F675 to reset the counter and the internal EEPROM. After periodic maintenance, this switch must be pressed for more than 3 seconds.
Both LEDs will blink to confirm that the time has been reset. Then a new 1-year cycle (or a user-selected period) will begin counting.
Power is supplied by a 300mA 2×9 volt transformer, using filter capacitors and a 7806 voltage regulator.
To power the PIC12F675 in case of a power outage, two rechargeable CR2032 batteries connected in series with a 1N4001 diode are used. If the batteries also fail, this number is recorded in the EEPROM every hour.
source: picsource.com.br/archives/10804/
What if the power supply is cut off?