toggle after 2 seconds

Discussion in 'General Electronics Chat' started by nekojita, Dec 9, 2010.

  1. nekojita

    Thread Starter New Member

    Nov 19, 2010
    2
    0
    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
     
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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?
     
  3. nekojita

    Thread Starter New Member

    Nov 19, 2010
    2
    0
    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
     
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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.
     
  5. mtripoli

    New Member

    Feb 9, 2010
    44
    8
    I don't know if you guys have seen these, but Linear Tech has a new line of "timer blox" - http://parametric.linear.com/html/timerblox. I didn't go through and see if these are exactly what you need but you might have a look.

    Mike T.
     
Loading...