Minimum time for digital signal reading

OK good. This is a fairly simple matter, as has been mentioned, of debouncing or deglitching you S1 signal, ppl will fall all over themselves providing answers or guidance by then I am sure.

As noted I think, you may be pounding on the EEPROM a bit - how often does this thing transition and require the 2 seconds pulses on the relays?

a7