Push and hold soft latching switch

Hi good folks,

I'm trying to integrate a latching switch into my project. I can successfully make a latching switch that uses one button to turn on and off my system, but what I'm trying to do is to use a switch that you hold down a few seconds to turn on or off the circuit. I'll be using a 12v power supply. Can someone please help me with this.

P.S. I'm a self teaching myself all these and am a hobbyist. Sorry if this is too noob of a question.

Thanks in advance!

Once the switch is debounced start a timer. If the timer reaches preset use the fact that the timer's state *has changed * from 'not done' to 'done' to set your latch.

It will help you much to become familiar with the concepts demo'd in the first five sketches in: IDE/file/examples/digital.

p.s. Don't forget the [ code ] your sketch here [ /code ] tags when you post your work.

Thanks dougp,

I dont really want to code this solution in the arduino, rather I am trying to do them all using electronic components.

Right now I’m following this (attached) diagram to make my switch. The question is how to add 3 seconds delay to the power on and power off.

Sticking a resistor in series with the capacitor or switch could work, but I don't know how to calculate the proper resistance, nor if it will have any side effects. It should probably not be larger than 1-2k, and possibly much smaller. It won't damage the circuit to try it out.