How to control a 12VDC latching solenoid from a standard 120V on/off wall switch

Thread Starter

Oldman52

Joined Aug 26, 2022
22
Let me explain what it is that I am trying to do. I have a fence around my house with a gate at the front. I want to be able to lock and unlock the gate (at night) without having to go outside. I would like to use a standard 120V on/off wall switch in the house that would activate a latching solenoid at the gate to control the locking and unlocking. I have found that most latching solenoids are 12VDC. What does the circuit look like that I need? And any input as to a good latching solenoid for this purpose would be appreciated.
 

Thread Starter

Oldman52

Joined Aug 26, 2022
22
To the same degree as a locked house door. I copied this from a google search. "A latching solenoid control circuit uses brief (20–50ms) voltage pulses to toggle between states, reversing polarity to switch between locked and unlocked. It requires an H-bridge or DPDT relay setup to manage current direction, providing high efficiency by eliminating continuous power consumption." I am looking for someone to translate that sentence into a wire diagram that I can make.
 

Thread Starter

Oldman52

Joined Aug 26, 2022
22
I see how the momentary DPDT center OFF toggle switch works in the diagram you provided. But that is not going to work in my application. In my application I am using a standard 120VAC wall light switch. "ON" could be push, and "OFF" could be pull. There is no momentary to it.
 

panic mode

Joined Oct 10, 2011
4,864
that means solenoid is to use spring-loaded and pressing button would make it overcome spring force to unlock.
1772049917873.png

in that case single button would be used like this:
1772050048338.png
EDIT:

for solenoid for gate, you would probably want heavy duty variant.
if the solenoid is getting hot when energized continuously ("unlock" state), current need to be limited after initial pulse.
the simplest option is with a series resistor, and to still have max pull force for unlocking.
this can be done with a timer or just large cap placed across resistor.
AC power can come from either simple power switch or timer output, makes no difference.

about sizing...
R should be bringing current to some 30-40% of max current that solenoid draws when powered by 12VDC.
or you can simply measure solenoid resistance directly. then make resistor about 1.5 - 2x larger.
for example chosen lock solenoid measures 45 Ohm. if powered by 12VDC, current draw is 12VDC/45 Ohm = 0.267A
resistor to be added is then 1.75*45 Ohm = 78.75 Ohm, just pick nearest value like 75 or 80 or 82 Ohm.
P=V^2/R = 12V*12V/80 Ohm = 1.8W. so pick anything larger, 2W and larger will be ok. this way resistor will not die even if solenoid is shorted.
capacitor can be 10000uF 16V (or 25V or higher).

1772128798394.png
 
Last edited:

sghioto

Joined Dec 31, 2017
8,633
I see how the momentary DPDT center OFF toggle switch works in the diagram you provided. But that is not going to work in my application. In my application I am using a standard 120VAC wall light switch. "ON" could be push, and "OFF" could be pull. There is no momentary to it.
Why can't the wall switch be replaced using the switch suggested?
Are you wanting to control the gate solenoid using 120VAC from the wall switch?
I have a circuit using relays to provide a H bridge. This is operated from a standard 3 way light switch but switches 12 volts DC.
 

B-JoJo-S

Joined Jan 3, 2026
208
Problem I'm seeing with using a regular light switch is that it's ON or OFF. Single pole single throw. Even a 3-way switch is still single pole, but it's double throw. Neither of those switches at any voltage will be of use to you, they don't have a center off. You need a momentary positive pulse to (let's say) Lock the gate and a momentary negative pulse to unlock it. To power it one way or the other all the time would be a waste of power AND likely to overheat the solenoid that does the locking.

A re-think is in order. @sghioto (post 6) is the right approach. As for attaining 12VDC from 120VAC is easy enough. You just need a 12 volt power supply. Only a few amps. 4 amps would be more than enough. Unless you have a very large solenoid.
 

sghioto

Joined Dec 31, 2017
8,633
I have a circuit using relays to provide a H bridge. This is operated from a standard 3 way light switch but switches 12 volts DC.
This configuration produces a short pulse to activate the relays via capacitors C1 or C2.
Diodes D1-D2 and resistors R1-R2 provide discharge paths for the capacitors
1772059237097.png
1772059692401.png
 

Thread Starter

Oldman52

Joined Aug 26, 2022
22
I hate to change something at this point with you all helping me out with my problem. When I first started this thread I simplified my explanation of what I wanted in order to minimize any confusion about the project. The 120VAC ON/OFF wall switch is not just an ordinary light switch but actually an ONÓFF wall switch with a timer built into it. The beauty of using this timer is that it saves me the trouble of having to think about the task of locking and unlocking each and every day. So the timer wall switch has to be 120VAC. Sorry about that.
 

B-JoJo-S

Joined Jan 3, 2026
208
I believe we understand. What you may be missing is that a switch that turns itself ON at a certain time means you are activating your system for the duration until the timer turns off. With @sghioto's circuit the capacitors will prevent the relays from being on all night (during the "Lock" time). But you're still powering a 12VDC power supply for the duration. That's not a big concern, but not a fact that should be overlooked.

This timer light switch: Is it installed at this time? Are you planning on installing it? If it's installed or will be installed, what is it connected to? Would make sense that it controls outdoor lighting. You'll have to plug a power supply into a light socket and run wires to the gate latch lock. It's all doable. Just hope you do it safely.
 

gaber2611

Joined Mar 14, 2013
321
What the Amp rating of the solenoid you have at the gate?, or power?, this will affect the wires goes from home to gate, wire thickness, we need information about the solenoid type you have at the gate, so we can help you with suitable control circuit for lock and unlock the gate
Take photo for nameplate at the solenoid for us please if you can
 

ronsimpson

Joined Oct 7, 2019
4,645
Looking back at post #11
One option is to use a switch like this. A Mom-off-Mom switch is spring loaded and returns back to the Off position.
1772123918651.png1772123954659.png
Another option is to use two push buttons. "Lock" and "Unlock".
1772124070307.png
Then remove R1, R2 and Short out C1, C2. This removes the time constant of the capacitors and uses your hand as how long the relays are powered.
 

sghioto

Joined Dec 31, 2017
8,633
I suggested the DPDT switch back in post #6.
The purpose of the capacitors is to prevent any additional current draw on the solenoid if the button switch is pressed unnecessary long.
Apparently this is all a mute point as the TS wants to use a wall switch timer
 

sghioto

Joined Dec 31, 2017
8,633
Suggestion #3:
Adding additional relay RL1.
When the wall timer switches ON that will power up the 12 volt supply and activated relay RL1.
RL2 will briefly activate as C1 charges through the relay coil and diode D1, sending a pulse to the solenoid to lock the gate.
When the timer shuts OFF RL1 will drop out returning the positive side of C1 back to NEG which will discharge C1 through D2 and the coil of RL3 briefly reversing the solenoid pulse to unlock the gate.
1772740418863.png
 
Last edited:

panic mode

Joined Oct 10, 2011
4,864
it would be nice if we knew what kind of lock TS has chosen. is it a door lock as is "as house main door lock" or automotive power door lock.
 
Top