Connect with us

Double throw momentary switch question

Discussion in 'Electronic Basics' started by Hal Leemux, Sep 24, 2004.

Scroll to continue with content
  1. Hal Leemux

    Hal Leemux Guest


    Can anybody tell me a simple way to tweak a simple latch circuit to
    change state when the button is pressed in quick succession (say within
    1 second). Exactly like a double click on a computer.

    The schematic I've been working off is second circuit down at,

    Would really appreciate any advice,

  2. John Fields

    John Fields Guest

    1. Do you want the latch to change state (toggle) each time you
    double-click the pushbutton or do you only want it to react the
    first time you double-click and then stay where it is until it's
    reset by something else?

    2. Do you have to use a SPST switch or can you use a DPDT?
  3. Hal Leemux

    Hal Leemux Guest

    It needs to change state every time it is double clicked.

    I need to be using a momentary switch which will eventually be
    substituted with a vibration sensor.
  4. John Fields

    John Fields Guest

    Aha!!! Now we're getting somewhere!

    Is it the kind of vibration sensor which gives you a lot of outputs
    when it's being vibrated past its threshold, like this:

    | |||| |
    VIB __||__|||_|__||____|_||||____|_______


    or does it just give you one output, like this:

    | |||| |
    VIB __||__|||_|__||____|_||||____|_______

    _____ _
    OUT____________________| |___| |_____

    If it only gives you one output, how long does the output stay hot
    after the vibration goes away?
  5. Hal Leemux

    Hal Leemux Guest

    The sensor on its own gives lots of outputs as per your first example.
    When in the latch schematic I mentioned in my original post it is
    debounced slightly so it acts more like your second example.

    The ultimate idea is to have a circuit which toggles on or off when the
    sensor picks up a double knock in quick succession on a surface (exactly
    like a double knock on a door).
  6. John Fields

    John Fields Guest

    OK. I just posted a basic circuit for you on
    alt.binaries.schematics.electronic under the same subject as this

    If you need a circuit description or you need help with the timing
    components and you know how much time you want between knocks and sets
    of knocks post back (either here or to abse) and I'll help you figure
    it out.
  7. Hal Leemux

    Hal Leemux Guest

    Thanks a lot John - I'm really grateful. It all seems very clear.

    I might need a little help on the timing values though. Any two knocks
    in 1 second and 2 seconds between knocks seems about what I need.
  8. Rich Grise

    Rich Grise Guest

    Learn how to do this, and for version 2 you can make your secret knock,
    "Shave and a haircut, six bucks!"

  9. John Fields

    John Fields Guest

    I made a mistake on the schematic :-(

    I've got the trigger input of the 7555 connected to Q of the second
    half of the 4538 when it should be connected to Q\. Also, in order to
    get you the 2s between successful sets of pairs of knocks I'll have to
    add another one-shot. I'll fix it and post the values for the timing
    components some time tomorrow.
  10. Maybe I've missed a crucial post, but the requirement still seems
    ill-defined to me?

    There seem several facts not yet specified, such as:
    1. What frequency is vibration?
    2. What is voltage supply
    3. Will vibration sensor signal have full amplitude of voltage supply?
    4. If we call the period of vibration a 'knock', how long can each
    knock be?
    5. Should that matter?
    6. Should a *very* brief knock (possibly due to an accidental or
    premature, or just external noise) count?
    7. What happens with say 3 successive knocks within 1 s?
    etc, etc.

    I've tried to illustrate these in

    Turning to the circuit, assuming we can tighten up the spec along the
    lines above, intuition says a much simpler approach than John's ought
    to be possible. (Although I haven't got one to offer <g>.)
  11. John Fields

    John Fields Guest

    From what's been posted so far, here are what I think the answers are
    to your questions:
    Shouldn't matter.
    Doesn't matter much.
    Doesn't matter much, since if it doesn't it's pretty much a no-brainer
    to run it through a comparator and clamp it to the rails.
    He specified that he wants, as a trigger for the toggle, a pair of
    knocks to occur within one second, so I'm interpreting that to mean
    from the leading edge of the first clump of edges to the leading edge
    of the second clump. That can be done by starting a non-retriggerable
    one-shot with a period of 1s when the first edge is detected and
    starting a retriggerable one-shot with a period of, say, 250ms at the
    same time, Then using the output of the 1s one-shot to allow the
    second high-going edge out of the 250ms one-shot (if it happens
    within the 1s window) to toggle the eventual output. If the second
    edge doesn't happen in time, then no toggle and everything goes back
    to square one.
    Yes, since the likelihood of a pair of random occurrences meeting the
    triggering criteria will be slight. But, if it's important, it's easy
    to put in go no-go time windows to discriminate between too short and
    too long knock envelopes.
    If the first two meet the triggering criteria the toggle will occur
    and the third will be ignored, since he specified a two second inhibit
    between knock pairs.
    After the learning curve, the acquisition of a programmer, and all the
    rest of baggage that goes along with it, the simplest approach by far
    would be to use a microcontroller. But, there _are_ all those snags,
    so a couple of dual one-shots and a dual "D" flop is probably the
    least painful way to get it done for a one-off.

    I made a few errors in the circuit I posted earlier and I still need
    to get the 2-second holdoff in there, so as soon as I get that done
    (it won't be yesterday ;) I'll post it to abse and we'll see what
  12. Thanks, that's clarified it nicely for me. Look forward to seeing the

    Your summary also helped crystallise this question to the OP: why not
    simplify and toggle with *one* (significant) knock? By definition,
    you're going to get a toggle with 2, 3, 4 or maybe even more rapid
    knocks, so why single out 1 for exclusion?
  13. John Fields

    John Fields Guest

  14. Here's an alternative implementation of John's design.

    Let me know if you have queries, or want to see simulated waveforms.

    I'll also post a copy of this in a.b.s.e.
  15. Hal Leemux

    Hal Leemux Guest

    Thanks for your help Terry. I'll let you know how I get on.

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day