Maker Pro
Maker Pro

Double throw momentary switch question

H

Hal Leemux

Jan 1, 1970
0
Hi,

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,

http://ourworld.compuserve.com/homepages/Bill_Bowden/page9.htm

Would really appreciate any advice,

Hal.
 
J

John Fields

Jan 1, 1970
0
Hi,

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.

---
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?
 
H

Hal Leemux

Jan 1, 1970
0
John said:
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?

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

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

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

John Fields

Jan 1, 1970
0
It needs to change state every time it is double clicked.
---
OK
---


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

---
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 __||__|||_|__||____|_||||____|_______


OUT____________________|_||||____|_______


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?
 
H

Hal Leemux

Jan 1, 1970
0
John said:
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 __||__|||_|__||____|_||||____|_______


OUT____________________|_||||____|_______


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?

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).
 
J

John Fields

Jan 1, 1970
0
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).

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

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.
 
H

Hal Leemux

Jan 1, 1970
0
John said:
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.


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.
 
R

Rich Grise

Jan 1, 1970
0
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.

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

Cheers!
Rich
 
J

John Fields

Jan 1, 1970
0
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.

---
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.
 
T

Terry Pinnell

Jan 1, 1970
0
Hal Leemux said:
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.

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
http://www.terrypin.dial.pipex.com/Images/KnockKnockSignals.gif

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>.)
 
J

John Fields

Jan 1, 1970
0
Maybe I've missed a crucial post, but the requirement still seems
ill-defined to me?

---
From what's been posted so far, here are what I think the answers are
to your questions:
---
1. What frequency is vibration?

---
Shouldn't matter.
---
2. What is voltage supply

---
Doesn't matter much.
---
3. Will vibration sensor signal have full amplitude of voltage supply?

---
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.
---
4. If we call the period of vibration a 'knock', how long can each
knock be?

---
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.
---
5. Should that matter?

---
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.
---
7. What happens with say 3 successive knocks within 1 s?
etc, etc.

---
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.
---
I've tried to illustrate these in
http://www.terrypin.dial.pipex.com/Images/KnockKnockSignals.gif

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>.)

---
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
happens.
 
T

Terry Pinnell

Jan 1, 1970
0
John Fields said:
---
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
happens.

Thanks, that's clarified it nicely for me. Look forward to seeing the
circuit.

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?
 
T

Terry Pinnell

Jan 1, 1970
0
Hal Leemux said:
Hi,

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,

http://ourworld.compuserve.com/homepages/Bill_Bowden/page9.htm

Would really appreciate any advice,

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

http://www.terrypin.dial.pipex.com/Images/KnockKnock1.gif

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.
 
Top