Powering a Solenoid with a Capacitor - Page 1
Forum section: electronics / beginners

author: jimbycat
author_rank: Contributor
timestamp: July 11, 2020, 09:23:03 pm
content: Hi,I have successfully built a project that turns on a solenoid every 30 seconds (for half a second) with a microcontroller (using a transistor, diode, and resistors). The solenoid I am using is 6V and draws 1 amp. My working proof of concept uses a power supply that can handle several amps, but the final product must use a power supply that is limited to 0.5 amps. I was wondering if it is possible and practical to use a capacitor to bridge the ~0.5 amp current deficit? If so, how would the required capacitance value be calculated?

author: Manul
author_rank: Super Contributor
timestamp: July 11, 2020, 10:28:34 pm
content: It is possible, but you would need to step up and then step down voltage and this is too complex. Or use a supercapacitor, like 0.5 to 1F. But then again it is not without problems, for eg. long startup time. Because it needs to charge from zero to working voltage with limited current when you turn on the device. It may take up to tens of seconds, depending on charging arangement (resistor limiter, proper constant current driver, etc). It does not look rational to me personaly. Only if there is no other way.

author: sahko123
author_rank: Frequent Contributor
timestamp: July 11, 2020, 10:41:26 pm
content: It also really depends on how long the solenoid needs to be powered on for

author: langwadt
author_rank: Super Contributor
timestamp: July 11, 2020, 10:42:09 pm
content: make some experiments to see how much voltage/current you really need to keep the solenoid pulled in once you have moved it

author: jimbycat
author_rank: Contributor
timestamp: July 11, 2020, 10:49:12 pm
content: The solenoid only needs to be on until it fully actuates (10 mm). I can do some experimentation to determine the shortest time in order to accomplish this.

author: jimbycat
author_rank: Contributor
timestamp: July 11, 2020, 11:22:49 pm
content: If the solenoid needed to be turned on every 30 seconds for 250 milliseconds, with a 1 amp current draw, how would I determine the capacitance required if the power supply could only supply a maximum of 0.5 amps?

author: Whales
author_rank: Super Contributor
timestamp: July 11, 2020, 11:43:36 pm
content: I would start by calculating the energy (joules) that the specified event requires, total.You also need to look into what the "tolerable" range of voltages for your solenoid is (unless you want the extra complexity of switchmode power supplies). A capacitor drops in voltage as you drain it, you need to define a maximum permissible starting point and a minimum permissible ending point that your solenoid will work with.Once you have done both of those things: I think the standard capacitor equations will help you join the two.

author: Manul
author_rank: Super Contributor
timestamp: July 11, 2020, 11:46:40 pm
content: The thing is that "0.5A supply" is not a full characteristic of practical power supply. So I suggest to first ignore it. Rough calculation:250ms, 1A current is 0.25 coulombs of charge. Lets say you want capacitor to provide all of that alone. Lets say you want to keep voltage within 10%, so at the end it will drop no more then 0.6V and will be 5.4V. 0.25C / 0.6V = 0.42 farads. Of course your power supply will help this process. Idealy you will need just 0.21F (0.5 amp comes from capacitor, 0.5 amp from power supply). Practicaly it is hard to say and depends a lot on your power supply and how efficiently it "helps". Also solenoid current will not be constant with droping voltage, but that is kinda negligible if voltage difference is small.

author: Seekonk
author_rank: Super Contributor
timestamp: July 12, 2020, 01:20:32 pm
content: Quote from: jimbycat on July 11, 2020, 10:49:12 pmOne method is to pulse the solenoid and look at the current on the scope. you will see a bend in the slope where the solenoid stops traveling as an inductance change. I did a bunch of high speed pulse solenoid driving. I would hit the 6V coils with 60V and then limit the current.

author: jimbycat
author_rank: Contributor
timestamp: July 12, 2020, 10:25:11 pm
content: Thank you everyone for all of the great replies!At the moment I have no way to measure current or power usage because I do not own an oscilloscope, or even a multimeter for that matter. I ordered a Keithley DMM6500 yesterday, so I should be able to measure these things after it arrives.Thanks again for taking the time to help me out.

author: Kleinstein
author_rank: Super Contributor
timestamp: July 13, 2020, 08:59:14 am
content: Many power supplies can deliver more than there rated current for a few seconds. So it depends on the type of supply. The type of supply also makes a different of combining the supply with the capacitor is easy, or more complicated. One could likely use more than a 10% drop in the capacitor voltage - this would allow to use a smaller capacitor, though possibly with higher voltage.

author: max_torque
author_rank: Super Contributor
timestamp: July 13, 2020, 09:57:55 am
content: If you have little in the way of measurement equipment to characterise the solenoid against its load (and you don't want to try to simulate it in s/w) then a simple test is to get some capacitors, put them in place after your power supply, but put a large value resistor upstream of the capacitor. That resistor will allow the capacitor to "trickle" charge up to the supply voltage, but not allow a large current spike.You can also simply measure the voltage across that resistor to estimate the current being pulled from itBy messing around with the size of the capacitor and resistor, you can find the sweet spot, in terms of supplying enough energy to 'fire' the solenoid against its load (what its load actually is is quite important of course, and who much energy the load takes to move, or MAY take to move, ie does the load change?)For example, for a 12v supply, a 24 ohm resistor will limit the absolute max current flow to 500mA, even with the output shorted to ground.

author: max_torque
author_rank: Super Contributor
timestamp: July 13, 2020, 10:12:52 am
content: A quick look with LTspice suggests for a solenoid of a reasonable size, then you'd need a fair amount of capacitance to drive it (the energy in the capacitor gets converted into the magnetic field in the solenoid, to the bigger the solenoid, the larger the cap required!

author: calzap
author_rank: Frequent Contributor
timestamp: July 13, 2020, 03:06:27 pm
content: Is there any practical way to capture some of the inductive surge from the solenoid coil when it's depowered ... the captured surge going into a capacitor? Then it would be an energy ping-pong with only the resistive and conversion losses needing to be resupplied.Mike in California

author: Renate
author_rank: Super Contributor
timestamp: July 13, 2020, 07:13:54 pm
content: The current requirement for pull-in is much more than the current for hold.Take that into consideration and your power requirements will be less.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 13, 2020, 08:12:43 pm
content: If you have a capacitor of 1F, and there is a current of 1A going through it, then by definition the voltage will change by 1V/s.

author: nfmax
author_rank: Super Contributor
timestamp: July 13, 2020, 09:06:31 pm
content: Many years ago, I made a design that did just this: a low-pressure differential pressure transmitter for HVAC applications. The idea was to auto-zero a drifty (but cheap) pressure sensor using a solenoid valve to temporarily equalise the two ports' pressures, and enable an auto-zero circuit using a CMOS counter & DAC (no microcontroller!) The whole thing ran from, IIRC, 12V @10mA. I can't remember how big the capacitor was, but it was nothing extraordinary.The key is that the 'hold' current of the solenoid is much less than the pull-in current, so although the capacitor voltage decays, the solenoid holds on for just long enough. I think it was about a second or so, every 20 minutes.Rendered obsolete before it left the lab, as the zero stability of cheap semiconductor pressure sensors quickly improved

author: Seekonk
author_rank: Super Contributor
timestamp: July 15, 2020, 12:11:50 am
content: This is probably obsolete for years, but I remember the LM1949 solenoid driver data sheet had a lot of useful explanations on driving solenoids. It would be a good read on understanding solenoids.

author: WattsThat
author_rank: Frequent Contributor
timestamp: July 15, 2020, 12:31:46 am
content: Quote from: jimbycat on July 12, 2020, 10:25:11 pmSo a $1000+ 6-1/2 digit touchscreen digital meter is your first test equipment purchase?All I can say is... WTF

author: Renate
author_rank: Super Contributor
timestamp: July 15, 2020, 12:55:17 am
content: Quote from: WattsThat on July 15, 2020, 12:31:46 amI have a Velleman DVM890L.You can usually find it for under $20.

author: VooDust
author_rank: Regular Contributor
timestamp: July 15, 2020, 01:41:03 pm
content: Hi JimbycatI drive my 12V solenoid with capacitors. For this purpose I bought a couple of 6800uF capacitors, and determined by experiment how many are required. In my case, 2x6800uF in parallel were sufficient.Then I constructed a control circuit with two mosfets: One mosfet detached the capacitors from the supply line, the other mosfet short circuited the capacitors across the solenoid to actuate it.However, this is only a sort of one time action. When you want to recharge the capacitors by reconnecting them to the supply line, it would brown out your microcontroller because the discharged capacitors act as a short circuit at first, dropping the complete supply voltage.Luckily, I found a current limiting circuit that only requires two NPN transistors:https://www.homemade-circuits.com/universal-high-watt-led-current-limiter/amp/This limits the surge current of the capacitors to a sensible value for your power supply.If I were to build this circuit again, I would experiment with some kind of voltage doubler: Charge two capacitors in parallel, but for the discharge action, put them in series: Now you have double the voltage for actuating the solenoid. This can reduce the total capacitance needed, because the 6800uF capacitors are quite bulky.Don't forget the flyback diode for your solenoid.

author: Renate
author_rank: Super Contributor
timestamp: July 15, 2020, 02:23:12 pm
content: Quote from: VooDust on July 15, 2020, 01:41:03 pmWell, 1/2 * 2 * 6800 µF * (12 V)^2 = 1 Joule (approx)2 x 6800 µF is pretty large.Electrolytic (spatial) volume is somewhere in the realm of CVElectrolytic energy storage is CV^2So, obviously we want to use the highest voltage possible.1/2 * 10 µF * (450 V)^2 = 1 JouleOk, so you will need a circuit to turn 450 V into 12 VAnd you will need something to charge the capacitor to 450 VThere are issues here, but it is possible.

author: VooDust
author_rank: Regular Contributor
timestamp: July 15, 2020, 02:53:52 pm
content: Quote from: Renate on July 15, 2020, 02:23:12 pmI have no idea tf you are talking about. All I can say is my solenoid is happy to see me:By "power line" I didn't mean mains power line but supply line instead. I have edited my post to be more clear.

author: Renate
author_rank: Super Contributor
timestamp: July 15, 2020, 08:55:28 pm
content: Quote from: VooDust on July 15, 2020, 02:53:52 pmMy comment was earnest. And no, I didn't misunderstand you.Quote from: VooDust on July 15, 2020, 02:53:52 pmThen all is good.

author: jimbycat
author_rank: Contributor
timestamp: July 16, 2020, 08:35:40 pm
content: Quote from: WattsThat on July 15, 2020, 12:31:46 amIt does seem crazy, but compared to the DMM7510, seems inexpensive.After spending a couple of hours with it... money well spent.

author: Renate
author_rank: Super Contributor
timestamp: July 16, 2020, 08:43:08 pm
content: Quote from: jimbycat on July 16, 2020, 08:35:40 pmWell $20 for 3-1/2 digits is 175 digits/$1000, much higher accuracy.