Close circuit after a couple of seconds

capacitordelaytransistors

First post on this site, sorry if it's too basic.

I'm learning to interface with a particular chip which has a GPIO pin. I'm using the GPIO for input with a pullup resistor and a switch between the pin and ground, really simple.

Due to an implementation detail, that pin needs to be high or floating (i.e. not grounded) at power on time. The firmware on the chip doesn't start if the pin is grounded.

I was thinking something along the lines of a delay with a capacitor and transistor in series with the switch but that's where I'm a bit rusty.

Appreciate any guidance. Thanks!

Best Answer

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.

schematic

simulate this circuit – Schematic created using CircuitLab