Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Double-Click Switch (like mouse double click)

Status
Not open for further replies.

adamey

Member
I want to find a simple way to make a switch that requires two quick presses in succession before it will turn a device on. It would be nice if it was easy to adjust the time between presses before it would actually turn on.

This is for a power window circuit for a car. Pressing the switch would operate the window as normal. A double press would activate a one-touch feature to open/close the window all the way.

I know I could do it with a Basic Stamp or other simple microcontroller, and I have come up with a few solutions using timers and logic, but perhaps someone has figured out a really simple way to do this.
 
A 2-bit counter that resets every <insert max time period between double clicks here>? The MSB can be read out and whenever it is 1 that means a double-click has occured. THe counter's state of "11" remains used.
 
Last edited:
^ That's a good idea. But what if the user presses the button, the reset happens and they press again? Then the counter would never hit 2 and a double-click would be missed.
 
Then they push it again. I suppose you could just have the timer only start to countdown the reset after they pushed it once. THe problem then is, how do you make it so the first function ever activates at all? You gotta make it wait to see if it is a double click or just a single click.

But I think what you are looking for is something that responds instantly to the single click function and then proceeds to do the double click function if a second click occurs fast enough. That's kind of hard to think of in my head without an MCU. It's a state machine of some sort with counters and flip-flops, etc.
 
You can have the button also activate a one-shot with its time equal to the maximum desired delay between presses. The one-touch feature is only available when the one-shot is high. When the one-shot times out, the one-touch feature is inhibited. You can use a 555 to make the one-shot.

You also need some type of circuit (perhaps another one-shot) to shut off the power to the motor when the window is completely closed or open in the one-touch mode to avoid burning it out.
 
Thanks for the ideas.

What I'll try is the 2 bit counter where the clock input is the switch. I'll also use the switch to trigger a timer that will reset the counter after a short delay. If I get a quick double press, the 2nd bit of the counter will go high before the reset. If not, the timer resets my counter.

The 2nd bit output of my counter triggers the circuit to power the window motor (I already have a window circuit to monitor the motor to determine when it stops).

For normal window operation I'll have another circuit that also monitors the switch, and if it detects a press longer than, say, 200ms that it will activate the window motor as well.
 
The 200ms delay for normal operation may be somewhat annoying if you are trying to just tweak the position of the window.

My car window differentiates between the two operations by the amount of time you hold down the button. If the button is held for just a short period, the window moves a short distance. If you hold it down about a second or more, then it moves all the way to the full open or close position.
 
double click

i have been wondering about the same thing...
I suggest to use a 555 timer IC as a missing pulse detector but "in reverse" = negated = when you double (or triple or quadruple) click there will be no missing pulse (555 output goes low), otherwise there is a (million) missing pulse(s) so 555 output goes high.
Then use another 555 timer (or use a 556 = 2 x 555 in 1 chip) as a one-shot to time your window movement (triggered by the low-going output of the first miising pulse detector IC 555).

Comments anyone???
 
Wouldn't it be easier to build a circuit that detects a short pulse and activates the auto-open circuit.
If the pulse is longer (You are holding the buttton) then the timer ignores the pulse, and you moonroof works as normal.

Comments?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top