# How to design a solenoid.?

I want to design a DC solenoid valve that could compress a spring under 5 kg of load. All I know is the voltage (12V), load (5kg), the current range (15-20), and the cross-sectional area of the winding. kindly help me with the number of turns, wire gauge, etc.

• I think you need to edit to add the required stroke. You should probably convert your load requirement to newtons (N). Multiply by g (9.81 m/s), so 50 N. You might also explain how you know both the voltage and current when you haven't done the calculations. If 15 - 20 A is the maximum available then state that. What research did you do and where are you stuck? – Transistor Feb 10 at 21:40
• Actually, I need a stroke of 10mm max and I want to operate it on a DC power supply having a rating of 12V and 15-20 amps. – اسامہ سجاد Feb 10 at 21:47
• So edit your question to state that. Don't hide important information in the comments. – Transistor Feb 10 at 23:00
• #اسامہ سجاد , Welcome and nice to meet you. Two years ago I played with solenoids to push/pull something and found them not so strong as I expected. Then I tried electromagnets and found them many times stronger. You might like to read my experiment blog posts: (1) Connecting electromagnet to pi - tlfong01 Rpi.org.forum, 2019mar05 raspberrypi.org/forums/…. Have a great project. Cheers. – tlfong01 Feb 11 at 2:00
• Check out some of the products at http://www.magneticsensorsystems.com/ ... that might give you some idea of scale. – Pete W Feb 11 at 2:16

This is something you'll likely need to do experimentally. Use a force gauge or a 5kg weight to find the needed number of turns and the current/torque needed.

You can do this experimentally, or look up someone who has done measurements and calculations and published them. One such reference is this one from 1910, when electromagnets and solenoids were hot stuff.

There is far too much there to distill into a reasonable length answer and I don't think it would be particularly helpful to others, so regrettably this will be essentially a link-only answer, and also I encourage you to search for other references which may be easier to use.

To add to the other answers here, this sort of a design problem is actually an excellent use case for the freeware magnetics simulator FEMM (Finite Element Method Magnetics): https://www.femm.info/wiki/HomePage

In particular, take a look at the "force on a plunger magnet" example: https://www.femm.info/wiki/RotersExample

FEMM can't do full 3D simulations, however, it can do axisymmetric simulations (ie: simulations with radial symmetry). Since pretty much any solenoid will by radially symmetric (barring some unusual geometries), it should work pretty well for your use case.

At minimum, you'd model two cases: one case where the armature is fully retracted (to ensure that the solenoid generates enough force to overcome the compressed return spring + required holding force of the mechanism), and one where the armature is out at full travel (to ensure that the solenoid has enough force to overcome the uncompressed spring). If you need to do more, you can also programmatically alter the geometry with MATLAB or Octave, so you can step the armature position and generate a force vs. position graph to ensure that you are generating enough force at every point through the stroke for your mechanism.

Force of solenoid comes from an effort to neutralize the unbalance magnetic force induced to the arm core inside the solenoid. That force will press or pull one side to make it center. In your case, it will press, press the spring which the load is 5kg (around 50N). Current (I) is number of voltage over resistor (V/R), which R is the resistor of the solenoid. For this R, you must measure it with AVO meter. Pick one size coil conductor then put to the equation below:

F = (N * I)^2 x magnetic constant * A / (2 * g^2),

Where:

^ is mean power of, power of 2 in this case.

F is the force exerted by the magnetic force inside the solenoid, which in your case is 5kg*9.81km/m^2 or around 50N.

magnetic constant=4pi10^-7 H/m (this is left question, why magnetic permeability of the core is always put air).

N is number of turn,

I is the current flow through the solenoid (V/R).

A is cross sectional area (assume you have cross sectional diameter = 5cm or 0.05m).

g is length of the solenoid, probably 1 cm or 2 cm (0.01m or 0.02m). It is normally denoted as l (small letter of L, while L capital is denoting inductance).

was also long time confusing for me about the gap, but thanks to Mr. David Cope in the reference 4 below that here wrote the equation, and we may compare it to Wikipedia to get what is it.

By knowing the parameters and by using calculator in reference 2 and 3 below, you may easily get the required.

Reference: How to Calculate the Force of an Electromagnet, Solenoid (Electromagnet) Force Calculator, Solenoid Electromagnetic Force Calculator, and compare the first reference to this answer by Mr. David Cope here and to this Wikipedia.

• Thanks Sir, it helped alot. – اسامہ سجاد Feb 11 at 6:47