Electronic – Design of a Five Second Kill Switch

delayswitchestimer

I think I have a challenge for you smart souls on here, who donate your time by answering all of my terrible questions.

I have to design a switch that completely shuts off a system when it is engaged, then turns the system on only after five seconds have elapsed from when the switch is closed.

That is,

  1. switch is open, system is completely off
  2. switch is closed
  3. five seconds pass
  4. system is on

By open I mean the switch is touching the top terminal in the junction labeled U3 in the schematic. By closed I mean its touching the bottom terminal.

If the switch is re-opened at any time during the 5 seconds in 3., the system goes back to 1. and the switch must be closed for another five seconds.

Even more complicated, once the five seconds have passed and the system is on, I'd really like it if this whole switch-circuit apparatus didn't change the system state any more, unless I unplug the power source. That is, after the system turns on, it's always on, and toggling the switch can't turn it off.

I've made a test circuit using a p-channel mosfet and a tiny45. The idea is that, when the switch is open, the mosfet's gate is pulled high by the voltage source (a 3.7V LiPo) supplying the power to the system. When the switch is closed, the attiny45 is turned on, and the MISO pin pulls the FET's gate high for another 5 seconds, then low, allowing charge to flow through the FET.

schematic

Only problem is, when I close the switch, the system turns on momentarily, I assume because the 45 hasn't started up yet. I can't have the 45 be on, since it will draw power from the battery and perhaps drain it before it gets a chance to power the system. Is there a way to smooth that transition so that the MOSFET gate continues to be high for the few microseconds required for the 45 to turn on?

Thanks!

Best Answer

Unless the 5 seconds needs to be highly precise, this can be done in a totally discrete way. When you close the switch, have it start charging up a cap through an RC. The cap is connected to the negative terminal of a comparator. The positive terminal of the comparator is connected to a voltage divider. Choose RC so that after around 5 seconds, the cap voltage is high enough that the comparator output switches low, turning on two PFETs. One PFET bypasses the switch (so it can now be turned off and there is no effect), and the other energizes your load. One last thing. Make sure that the cap discharges quickly when switch is opened during the 5 second interval. Maybe you can make it a pushbutton switch. I might draw a circuit for you if I have time. But I agree with others that this is not a source for turnkey solutions. ;-)

Oh, if you set the voltage divider so that V = 0.63 * VBATT, then you can set the RC time constant to 5 seconds. Have fun with your design problem.

Related Topic