NVR= Non Volatile Ram. That may be an EEPEOM, or some other kind.
Thanks.The atmega328 has 1kbyte of non-volatile EEPROM for remembering stuff across resets. So using the internal oscillator you measure the time for, say, a nominal 10sec and work out a correction factor, then store that for future use with a calibration program.
The CAP1206 will work too.
I was thinking about different ways the same functionality I have right now can be achieved(cut-off lamps asa the door is opened with maximum reliability). I am listing all of them below, I would like to hear your thoughts on which one you find the most reliable.
1) The AC mains supply to load is connected through the microswitch then to a optocoupler and the two relays. The optocoupler output is read by the uC and the relays are turned on only if the mains are closed. Irrespective of whatever causes the failure, the supply is cut-off as soon as the door is opened. I think this is the most safest option. But also feel adding more components can in-turn increase the probable points of failure.
2) The circuit how its done now. Two relays, one for controlling power and the other for turning the load on or off.
3) Same as 1 but only one relay instead of two. This again guarantees that the supply is cut-off as soon as the door is opened.