Driving a solenoid

Thread Starter

STech2106

Joined Jul 8, 2023
43
Hi everyone,
I am trying to dimension a circuit for a 4-solenoid plunger (electronic locks). Each solenoid has the following characteristics.

Current consumption: 0.6A
Rated voltage: 12VDC

However, I do not know the inductance specifications. I could only derive the equivalent resistance. I read somewhere that it is advisable to insert a capacitor with a high capacitance in order to cope with short-term current variations. This baffles me.

\[ I(t)=\frac{V_b }L .t e^{-tR/L} \]

The current in the inductor at time t=0 should be zero so I could say that there is no inrush current in the circuit, so why is it advisable to introduce a capacitor with a high capacitance value between the 12V supply rails?
 

Jerry-Hat-Trick

Joined Aug 31, 2022
775
Your 12V DC power supply probably already has a smoothing capacitor across it's output. As you say, when connecting a voltage across a solenoid, the cureent will rise as a function of its inductance and settle to the value determined by the coil resistance, in your case R = V/I = 12/0.6 = 20 ohms. The essential additional component you need is a diode connected in parallel with the solenoid. When you disconnect the voltage the solenoid inductance tries to maintain the current that was flowing with a voltage spike in the opposite direction so the diode is there to catch this reverse voltage to protect everything else in the circuit.
 

Thread Starter

STech2106

Joined Jul 8, 2023
43
Your 12V DC power supply probably already has a smoothing capacitor across it's output. As you say, when connecting a voltage across a solenoid, the cureent will rise as a function of its inductance and settle to the value determined by the coil resistance, in your case R = V/I = 12/0.6 = 20 ohms. The essential additional component you need is a diode connected in parallel with the solenoid. When you disconnect the voltage the solenoid inductance tries to maintain the current that was flowing with a voltage spike in the opposite direction so the diode is there to catch this reverse voltage to protect everything else in the circuit.
Ok , but if there is a distance of 5 meters between the output of the switching power supply and the input of the board that handles the on/off of the solenoids, is it necessary to insert capacitances, or is it not necessary?
 

MisterBill2

Joined Jan 23, 2018
27,159
Before offering any GOOD advice, it is important to know what you will have the solenoids doing and what aspect of their performance is most important. Not all solenoid applications are the same.
In addition, how are the solenoids being controlled? By a switch, or by a transistor, or something else? Diode transient suppression may be required or maybe not. That depends entirely on the solenoid control system and the rate of change of the coil current.
Actually, at the first instant of power application, the current is limited only by the circuit's resistance, until the magnetic flux starts to increase. So the concept is that a large capacitance across the voltage source, close to the control switch, will reduce the voltage drop due to that greater current, and thus provide faster solenoid action. So really, the need for the capacitor depends quite a bit on the performance requirements. And so far the actual performance requirements are unknown to us.
 
Last edited:

Thread Starter

STech2106

Joined Jul 8, 2023
43
Before offering any GOOD advice, it is important to know what you will have the solenoids doing and what aspect of their performance is most important. Not all solenoid applications are the same.
In addition, how are the solenoids being controlled? By a switch, or by a transistor, or something else? Diode transient suppression may be required or maybe not. That depends entirely on the solenoid control system and the rate of change of the coil current.
Actually, at the first instant of power application, the current is limited only by the circuit's resistance, until the magnetic flux starts to increase. So the concept is that a large capacitance across the voltage source, close to the control switch, will reduce the voltage drop due to that greater current, and thus provide faster solenoid action. So really, the need for the capacitor depends quite a bit on the performance requirements. And so far the actual performance requirements are unknown to us.
The solenoid is controlled by a MOSFET logic driven by a 3.3v MCU.
 

Thread Starter

STech2106

Joined Jul 8, 2023
43
Hi ST,
Consider the effect of Lenz's law at the current switch off instant.
I would add a capacitor across the solenoid coil, as close possible to the solenoid, in order to minimise the back EMF from the coil that could damage the driving MOSFET.
Also, the capacitor will reduce any radiated EMF effecting other circuitry.

E
https://www.google.com/search?client=firefox-b-d&q=Lenz's+law
Thank you for your reply.

I had thought of putting to the current direction a flywheel diode in antiparallel. Do you think it is not enough? The capacitor should be inserted between the terminal of the solenoid and the drain of the MOSFET is that correct? How could I calculate it?
 

DC_Kid

Joined Feb 25, 2008
1,242
If I read all this right, you place cap from coil + to gnd as close to the coil terminal as possible.
nFET sink.
pFET source.

An inrush current may be much higher than the PSU can supply. A cap sized right on the Vcc feeding the coil allows the cap to dump joules fast when the FET turns on.

I also do recommend adding a pulldown (bleed-down) resistor from cap + to gnd, 10k maybe, this way when PSU goes off the coil won't be able to accidently turn on, just a safety factor in many cases.

Which FET is being used? I ask because 3.3v on gate sounds interesting. How many amps does this FET flow?
 

panic mode

Joined Oct 10, 2011
4,864
Ok , but if there is a distance of 5 meters between the output of the switching power supply and the input of the board that handles the on/off of the solenoids, is it necessary to insert capacitances, or is it not necessary?
in industrial automation 24VDC is the standard... and there are many products with inductive characteristic (relay/contactor coils, motor brakes, solenoid valves, door locks etc.). cable lengths in excess of 5m are very common. in this case i would consider 5m to be a relatively short run. what is the environment? unless this is something special (you mention this is just a solenoid lock) i would not bother with capacitor across load (suppression really should be at the load, not 5m away from it). for DC suppression it is more convenient and compact to use simple diode or varistor or anti-series zeners or RC element. later three are suitable if polarity of circuit is changing (AC circuit) or if it is something that can be tampered with (fly leads going to terminals instead of connector). you do not want to connect diode in reverse unless your driver/PSU can handle that. smoothing caps etc. should be at the PSU/Driver circuit.

keep in mind that in industrial automation, any such load may be switched very frequently and there are likely dozens if not hundreds of them in a single machine. that is plenty to evaluate things like reliability and possible interference. i guess your electronic lock is probably for cabinets or room doors. i do not see electronic lock being operated 1500 times per hour, 24/7/365.
 
Last edited:

KKRS_

Joined Oct 26, 2023
24
The RMS current rating of the input capacitor is a critical parameter and must be higher than the RMS input current. As a rule of thumb, select an input capacitor which has an RMS rating greater than half of the maximum load current. Due to large dI/dt through the input capacitor, electrolytic, or ceramics with low ESR should be used. If a tantalum capacitor is used it must be surge protected or else capacitor failure could occur. Using a ceramic capacitor greater than 10µF is sufficient for most applications.
If I refer to a DC-DC converter such as AP63205. I can see from the datasheet that a 10uF ceramic capacitor is recommended. How can I calculate a reasonable value so that the loads downstream of the converter are not affected by the current drawn by the 12V solenoids?
 

panic mode

Joined Oct 10, 2011
4,864
i don't understand, why use DCDC converter? if you already have higher DC voltage, why not try finding solenoid for that voltage? and if chosen solenoid is for 12V, why not use 12V supply? the capacitors shown in datasheets for converters like AP63205 show values that are supposed to provide good stability and filtering for max load (unless otherwise stated). so that capacitor is good for 2A load. to see how things look like when some length of wire is introduced, you need to measure or calculate voltage drop. for example:
1729620605711.png

and if you have loads that need stable voltage, unaffected by current draw or solenoid, use separate circuit or local voltage regulator or voltage sensing so that your voltage regulator can compensate for voltage drop....or... increase size of wires.
 

KKRS_

Joined Oct 26, 2023
24
i don't understand, why use DCDC converter? if you already have higher DC voltage, why not try finding solenoid for that voltage? and if chosen solenoid is for 12V, why not use 12V supply? the capacitors shown in datasheets for converters like AP63205 show values that are supposed to provide good stability and filtering for max load (unless otherwise stated). so that capacitor is good for 2A load. to see how things look like when some length of wire is introduced, you need to measure or calculate voltage drop. for example:
View attachment 334168

and if you have loads that need stable voltage, unaffected by current draw or solenoid, use separate circuit or local voltage regulator or voltage sensing so that your voltage regulator can compensate for voltage drop....or... increase size of wires.

Yes it is correct my solenoids work at 12V, but I also have an MCU that works at 3.3VDC and my doubt is that the solenoids when the switching happens, the input capacitor may discharge and create issues for the MCU.
12V --> solenoid
12V --> AP63205 -->LDO 3.3V --> MCU
The two 12V voltages are in common for both the solenoids and the input of AP63205.
 

DC_Kid

Joined Feb 25, 2008
1,242
Yes it is correct my solenoids work at 12V, but I also have an MCU that works at 3.3VDC and my doubt is that the solenoids when the switching happens, the input capacitor may discharge and create issues for the MCU.
12V --> solenoid
12V --> AP63205 -->LDO 3.3V --> MCU
The two 12V voltages are in common for both the solenoids and the input of AP63205.
What's the MCU doing? Put a 1kuF (maybe bigger) cap on MCU Vcc. If the issue is a dropout issue, then you have a "psu" problem to solve.
 

MisterBill2

Joined Jan 23, 2018
27,159
In ADDITION to that serious capacitor, I suggest an opto-isolator driven by the MCU output to prevent any transients from getting back to the MCU. Certainly it is less convenient and costs more, but the protection is probably worth it.
 

Thread Starter

STech2106

Joined Jul 8, 2023
43
In ADDITION to that serious capacitor, I suggest an opto-isolator driven by the MCU output to prevent any transients from getting back to the MCU. Certainly it is less convenient and costs more, but the protection is probably worth it.
Do you recommend this even though there is only one power supply and the grounding are in common?
 

MisterBill2

Joined Jan 23, 2018
27,159
Common grounding and a single power supply can lead to all sorts of "interesting" results. A shunt capacitor can serve as a stable voltage source when system loads change rapidly. Of course, at that point the connection scheme is also a large influence. And the effects of connections iis a large topic with a fair amount published.
 

crutschow

Joined Mar 14, 2008
38,316
at the first instant of power application, the current is limited only by the circuit's resistance, until the magnetic flux starts to increase.
Really?
That's the first I've ever heard of a delay in the magnetic flux starting to increase or an initial current spike from that.
Can you point to article that discusses that?
There could be a small initial current spike due to the stray inductor capacitance but not magnetic flux delay.
 
Top