Close circuit after a couple of seconds
Here is the basic idea. When VCC goes high, C1 will start to charge up. After a few ms, M1 will turn on. D1 is intended to make sure the cap discharges promptly when VCC goes low. It may not really be needed.

Larger cap or larger resistor will increase the delay. This is an imprecise delay. There will be variation from unit to unit and over temperature.

Another idea, if you don't mind writing the code and you have an extra IO available is to directly control the gate of M1 with another IO pin. In this case, you would want to add a pulldown on the gate (hopefully the other pin can tolerate a pulldown!) and arrange to have code drive the gate high after the firmware has sensed the state of GPIO.

If VCC is 5V instead of 3.3, everything will still work more or less the same, although the delay will be a bit less at 5V than at 3.3.







simulate this circuit &ndash; Schematic created using CircuitLab