toggle after 2 seconds

Thread Starter

nekojita

Joined Nov 19, 2010
170
Hi,

I need an electronic toggle switch based on using a momentary switch that will:

1) Toggle to a logic high when the momentary switch has been continually depressed for 2 seconds

2) Toggle to a logic low when the momentary switch has been continually depressed for 2 seconds on a subsequent switch depression

Does anyone in the forum have a circuit that can do this?

Thanks,

Art
 

thatoneguy

Joined Feb 19, 2009
6,359
This could be done with 555 timers, but the question is resolution.

Would 1.95 seconds be acceptable? 2.1 seconds?

A microcontroller, such as PIC or AVR would be able to do this easily with only the dev board (dev board, uC, and programmer for either is about $50). I'd suggest a PICAxe or Arduino ($30-ish each) if you are new to uCs. These would give accuracy to 2.000 seconds.

How familiar are you with electronic schematics, soldering, prototyping, etc?

Bill Mardsen's Blog is a great source for many 555 timer topics.

What is the actual application for this?
 

Thread Starter

nekojita

Joined Nov 19, 2010
170
Thanks for your response.

I didn't post all the constraints but a PIC controller is out because of cost and the need for programming.

Also, since this circuit is used to turn on power to the system, it will be a constant power drain to the batteries. I'd like to keep current under 10uA.

It's more gates than I wanted, but my first thought was to do this:

Use a cheapie one gate oscillator into one side of AND gate, the other side, a high from the momentary switch. Cheapie oscillator clocks a binary counter. Counter is decoded to provide number of counts equal to length of time desired (based on oscillator frequency) Decoder clocks D or SR flop to create a toggled high or low to turn on/off battery power to the system.

If I use CD or HC family, this would be OK. The accuracy isn't important. The reason for the sustained push is to prevent accidental turn on/off of power.

I though that somebody might have a cute and simpler circuit to do this.

Art
 

thatoneguy

Joined Feb 19, 2009
6,359
The problem comes with holding the power down for 2 seconds to turn it on.

In order for that to happen, a clock would need to be running, which consumes power.

There are quite a few circuits for "Push Once to turn on, hold for xx time to turn off".

The delay for turn off could be something simple like the Qx output of a 4060 counter with internal clock.

The turn on is a temporary jumpstart to turn on a MOSFET, powering entire circuit. Then when the power off is held for xx seconds, the signal supplied to the MOSFET by the powered up circuitry is removed.

Thinking on this a bit more, a single 4060 could be enabled to add one power source to turn on the MOSFET, allowing a delayed turn on. Once that signal is gone, something else switchable would need to hold the MOSFET on as well. This would then only draw any power when the button is held down or already on.

There are few threads on the forum recently regarding "soft power on / off" that can be found with the search. Many ideas are shown.

The simplest way to prevent accidental turn on would be two buttons that need to be simultaneously depressed. Not elegant, but I've seen it in controllers for safety reasons.
 
Top