Hold button for a couple of seconds to close circuit?

Thread Starter

EkkuZakku

Joined Jun 4, 2022
2
I'm a bit of an electronics noob, always breaks my brain when I attempt anything as none of it makes any sense to me. I'm much more of a programmer, so please feel free to tell me if this is impossible.

I have two buttons next to each other, one I use often while the other quite rarely, yet I press it by mistake often when I don't want to. To remedy this, I'd like to force a delay of a second or two when pressing the less used button before it will "close" and perform its action. I don't really have any easy options to modify the switch to prevent accidental presses, plus I'd really like to expand my electronics knowledge whenever possible.

I thought I had a solution to this after finding the plethora of 555 circuit guides online, but as I got into this project, I realized that it doesn't really work as these circuits are used to switch a relay or something else from the output pin, while this needs to be done entirely in-line with the circuit loop (one input from +5v, one delayed output/connection to ground). Is this even possible? My google-fu is really failing me here. Appreciate the help, thanks!
 

MisterBill2

Joined Jan 23, 2018
17,774
Inserting a delay in the function of a switch without any additional anything will require either a mechanical device or implementation of the notorious "DWIM" function, which has very seldom been accomplished successfully.
The desire for a very minimal addition: "this needs to be done entirely in-line with the circuit loop (one input from +5v, one delayed output/connection to ground)" makes it rather difficult, in fact.
So I suggest instead an alteration of the mechanical properties of the switch, most probably a guard ring around the less used switch so that pressing that button takes a more deliberate action.
The problem is that even adding a simple RC delay will require also the addition of some latching mechanism.

Of course, having no additional information about the circuit being controlled makes all suggestions exist as guesses. We have very few folks here who can read minds and know all of what has not been told to us about your subject.
 

MisterBill2

Joined Jan 23, 2018
17,774
Let us know just what sort of load is being switched as well. Also let us know what the restrictions really are, because the last paragraph in post #1 does not make a lot of sense.
If a delay in switching is desired that means that there MUST BE both a delay system and a switching system, and they WILL be in the way., unless a mechanical delay is found instead.
 

djsfantasi

Joined Apr 11, 2010
9,151
I'm much more of a programmer
So use an ATTiny45 or 85, a programmer module (I use the one from Sparkfun) and the Arduino IDE. Then, write code to do what you want.

Depending on the size of the load, pick a logic level MOSFET as your switch to drive the load based on your program.

It presents a programming challenge, because you have to account for “switch bounce”.
 

AnalogKid

Joined Aug 1, 2013
10,943
Here is how a circuit designer reads your post:

blah
blah
blah
this needs to be done entirely in-line with the circuit loop (one input from +5v, one delayed output/connection to ground).
blah
blah
blah

OK, kidding aside, this is a fairly simple task but we need *much* more information. Please sketch a schematic of the current setup for both switches: components (with reference designators), voltages, connections, and some information about what the switch outputs are driving. A schematic or chip part number would be best, but the basics of input voltage range, input impedance or input current range, any pull up or pull down resistors, capacitors, etc., and any limits in the input signal rise/fall time. The issue here is that the input characteristics can have a large effect on the timing circuit because it could be in series or parallel with one or more of the timing components, depending on the timing circuit topology.

ak
 

MisterBill2

Joined Jan 23, 2018
17,774
I already suggested such an alternative and it seems to have been totally ignored.
Contact bounce is not a concern because it is not an alternate action button, so a bunch of bounces will not have any effect.
Press and hold until a capacitor charges enough to latch a series SCR input trigger ON. The OFF command was never mentioned and thus is ignored, as it is not part of the discussion.

So the off control can be another button, normally closed, which, when pressed opens the power circuit to allow the SCR to switch off.
 
Last edited:

Thread Starter

EkkuZakku

Joined Jun 4, 2022
2
Here's a diagram of the two buttons on their small pcb. The green is the button I use often and don't want to interfere with, and the red is the one I would prefer to have on a delay, and it also happens to have a resistor on it. That was where I was planning on tapping into the board to intercept the button press as that's where it has pads I can use.

I probably could add something to block the button, and I'll be looking into that if it is indeed not possible to have a delay. Where the buttons feed is pretty much a black box to me, best I could probably do from that side is tap into a separate 5v source so a 555 timer won't interfere with the circuit, and result in the same thing as just pressing the green button (I'm sure you don't need to ask how I figured that out lol). Really appreciate everyone's replies, thanks.
 

Attachments

AnalogKid

Joined Aug 1, 2013
10,943
Would have been nice to have that in post #1.

It looks lie you are saying that there is a current source limiting the current available to the switches, and it comes from a 5 V source through some output resistance. When the green button is pressed, the signal line is pulled to GND. When the red button is pressed, the 1 K resistor forms a voltage divider with the (hidden) output resistance, so something monitoring the signal line can tell the difference between near-zero volts and something higher like 2.5 V (if the output resistance also is 1 K).

If this all sounds right, then this is a more difficult problem to solve.

ak
 

MisterBill2

Joined Jan 23, 2018
17,774
OK, now we see that there is a large amount of limitation because both go to the same circuit. A whole lot of effort could have been saved if we had had this information earlier. If the second button was never used then the simple option would be to add a bypass for the resistor. Then both buttons would do the same thing. If the red button could be changed to a normally closed switch, then it could be arranged so that to start that second action both buttons would need to be pressed. That should be acceptable.
Actually, a capacitor across the green button would do the trick: When the green button was pressed the voltage will still immediately drp to zero, while when the red button is pressed the capacitor will need to discharge before the voltage reaches that intermediate point and the second function is enabled. And the good news is that the capacitor can be located in the "black box" because it is directly across the connection. So a larger capacitor can be used.
 

AnalogKid

Joined Aug 1, 2013
10,943
We don't know the threshold voltage for the red button to cause action. Using 50% as an example, that is 80% of one time constant. For a 1 second delay with a 1 K resistor, C = 1,250 uF. That's a lot, more than enough to weld or burn the contacts of a small signal switch when dead shorted several times.

For example, if the switch contacts have a resistance of 1.0 ohm, the peak short circuit current is 2,5 A; probably way above the switch rating. At 0.1 ohm the peak current is 25 A, definitely a problem. At 10 milliohm it is 250 A, but the capacitor's internal ESR probably is greater than this, helping out a bit.

ak
 
Last edited:

MisterBill2

Joined Jan 23, 2018
17,774
AK is right, presuming that perfect components are used. So probably a less than perfect capacitor with a series resistance will be a good start.
But other than that, the scheme will work. and it may well be that putting just 100 ohms in series with the green button will be adequate.
The fact is that we have no hint as to the physical nature of the button switches.
 
Top