Simulate push button switch using relay (2)

Thread Starter

Cinematic6436

Joined Jun 30, 2023
11
Depending on what voltage you choose and which coil you get; this circuit will energize the relay for only as long as it takes for the cap to charge up triggering the relay until charged. The resistor needs to be large enough so that the coil doesn't remain active once triggered but small enough to allow somewhat rapid retriggering of the relay.

View attachment 281275
When you push and hold the button the cap will begin to charge, drawing a fair amount of current. That current (and proper voltage) will close the relay until the cap charges enough to drop the current below the Hold Threshold of the coil. If you're using an electronic signal to trigger the relay then that signal source needs to be able to supply sufficient current to drive the relay. The diode becomes even more important because it prevents back feeding of a high voltage spike which can damage your electronics. The relay contacts need to be rated to handle the amount and type of voltage AND current.
@Tonyr1084 Would it be possible to switch out the relay for a solenoid to simulate a physical button push? I'm trying to flip a switch up that simulates a one-second button push on a remote control, then flip the switch back down again to simulate another. It might be possible to hack the remote and use the relay method, but that might not be an option in this case.

Also apologies if reanimating this thread after 6+ months of inactivity is against the rules. If I need to start a new one I'll be happy to do that.
 

vu2nan

Joined Sep 11, 2014
340
Hi Cinematic6436,

Here's what you need.

1.png
In one position of the SPDT switch, the relay pulses as the capacitor charges through its coil.

In the other position the relay pulses again as the capacitor discharges through its coil.

The pulse width is determined by the time constant (relay coil resistance * capacitance).

Nandu.
 
Last edited:

Thread Starter

Cinematic6436

Joined Jun 30, 2023
11
Hi Cinematic6436,

Here's what you need.

View attachment 297430
In one position of the SPDT switch, the relay pulses as the capacitor charges through its coil.

In the other position the relay pulses again as the capacitor discharges through its coil.

The pulse width is determined by the time constant (relay resistance * capacitance).

Nandu.
Thank you for the quick response, Nandu! I found an SRD-S-112D relay (12A 125VAC/7A 250V, if it matters) left over from a previous project. The coil voltage is 12 volts. Do you know what voltage/uF capacitor I'd need? The one-second specification isn't critical -- it could be 1-5 seconds or even 1-10 if necessary.

Brian
 

MisterBill2

Joined Jan 23, 2018
16,473
If the circuit being switched is normally biased at 5 or 12 volts DC (sourcing load) then you can also probably simulate the push button with a capacitor of a much lower capacitance, ten microfarads or less. That has worked very well for other folks in the past. You will need to put a high value resistor ( 1 megohm )across the capacitor to discharge it. That will work because the load resistance of the circuit is much higher than the 400 ohm relay coil.
 

vu2nan

Joined Sep 11, 2014
340
Thank you for the quick response, Nandu! I found an SRD-S-112D relay (12A 125VAC/7A 250V, if it matters) left over from a previous project. The coil voltage is 12 volts. Do you know what voltage/uF capacitor I'd need? The one-second specification isn't critical -- it could be 1-5 seconds or even 1-10 if necessary.

Brian
Anytime, Brian!

Time constant = μF * MΩ

With the relay coil resistance being 400 Ω, a 2000 μF capacitor will give a 0.8 s pulse ( 2000 * 0.0004 = 0.8 s).

You may choose the required value of the capacitor by trial.

Nandu.
 

Thread Starter

Cinematic6436

Joined Jun 30, 2023
11
Anytime, Brian!

Time constant = μF * MΩ

With the relay coil resistance being 400 Ω, a 2000 μF capacitor will give a 0.8 s pulse ( 2000 * 0.0004 = 0.8 s).

You may choose the required value of the capacitor by trial.

Nandu.
@sghioto & @vu2nan

Thanks! Does voltage matter? I'm seeing 16v and 50v -- will anything over 12v be acceptable?
 

BobTPH

Joined Jun 5, 2013
8,069
Um, let’s take a step back. The relay is controlled via the internet, which means it is controlled by a microcontroller or other processor. Why are we talking about capacitors on the relay when the on time of the signal is completely controllable via software?
 

sghioto

Joined Dec 31, 2017
5,079
Um, let’s take a step back. The relay is controlled via the internet, which means it is controlled by a microcontroller or other processor. Why are we talking about capacitors on the relay when the on time of the signal is completely controllable via software?
That was from the original TS. The topic picked up again at post #14, not sure if this still involves the internet or software.
 

sghioto

Joined Dec 31, 2017
5,079
I should also mention that the 1 second time was measure not just calculated. Because the dropout voltage for the relay is lower then the pull-in voltage. Increasing the supply voltage will also extend the time.
 

Thread Starter

Cinematic6436

Joined Jun 30, 2023
11
Um, let’s take a step back. The relay is controlled via the internet, which means it is controlled by a microcontroller or other processor. Why are we talking about capacitors on the relay when the on time of the signal is completely controllable via software?
I actually don't need the wifi/internet elements, just a simulated button press (I intend to use a solenoid with the relay). Someone else started this thread, and I, uh, hijacked it.
 

Thread Starter

Cinematic6436

Joined Jun 30, 2023
11
So sorry, Brian, I missed mentioning the capacitor voltage rating. 16 V or 24 V should be okay.

Nandu.
Hello again --

Just a quick question. I found another relay lying around -- a Huike HK3FF-DC6V-SHG. Since it'll only be powered for a moment, would it be safe to swap the original 12 volt Sanyou SRD-S-112D relay we discussed with this 6 volt one, or would that be unsafe or unreliable in the long run?

If not, I can just buy another Sanyou.
 
Last edited:

sghioto

Joined Dec 31, 2017
5,079
That relay has a coil resistance of 100 ohms so would need a much larger cap to get a 1 second pulse. Would be safer installing a 47 ohm resistor in series with the relay coil.
 

Thread Starter

Cinematic6436

Joined Jun 30, 2023
11
That relay has a coil resistance of 100 ohms so would need a much larger cap to get a 1 second pulse. Would be safer installing a 47 ohm resistor in series with the relay coil.
Thanks for the suggestion. It doesn't need to be a full second -- it just needs to be long enough to trigger a solenoid to push the button on a remote control. I'll try it out tomorrow and see if it works. Hopefully I have that type of resistor in stock...
 
Top