This is a really good video. Very clearly explained, in a nice, even manner. At first I didn't think I wanted to watch a 20 minute video, but once it started, I didn't think twice about it
You might not be an electrical engineer but you helped me in my EE senior design :) Thanks a lot for the thorough walkthrough and multiple revisions, as well as having links to the parts used!
Appreciate you showing the simpler circuit (before the mosfet was added), most people skip that kind of stuff but it's very useful for understanding things!
@@MattInglot can i use Adriuno in place of costly PLC to manage a DIY project comprising of 4 dc outputs and 3 ac outputs (0.2 - 9 amp via ssr) and 7 dc inputs....using relay module ? (my plc ladder has 58 rungs in total )
@@anandjoshi8554 Yep. I'm not experienced with PLCs but Arduino can certainly control all this stuff. Just keep in mind that PLCs are very different than Arduino, again not experienced with them but my understanding is they are built to withstand harsh environments and be super reliable and all that.
When I bought my little pack of mosfets, I worked out that a relay that could handle the same current (70A) would probably cost a good bit more than the 10 I bought put together. Relays, of course, tend to have higher voltage ratings and I hear they're not too fond of PWM switching roles... 😁
Optocouplers are your best friend if going from digital electronics to power electronics, I'd look them 👍🏾🙂 Edit: they basically completely isolate the input signals from the output. It does that by converting electrical signals to light, then back to electrical signals. This means no voltage ot current spikes will damage low power electronics Note: With opto-couplers, you *don't* want to connect grounds or power sources to each other, otherwise you'll defeat the purpose of the chip.
To overcome the limited duty cycle of a solenoid just double the voltage capacity of the solenoid. In other words, on a 12 volt supply just use a 24 volt solenoid. As a builder of solenoid engines this video is great. Thanks a bunch.
Very educational and practical video considering that solenoids are also used in locks. Thank you for the detailed explanation and the schematic. This is a great electronics project.
Excellent presentation. Be careful using a solderless breadboard for this: Many are rated to 0.5 Amps, though there are some high quality ones rated to 2 Amps. As Sean Ocansey said in the comments, the next step is to use an optoisolator. Since you won't have to connect the grounds together, your sensitive Arduino electronics will be better protected from the spikey and noisy electromechanical circuit. Many of the solenoids in a pinball machine are switched on only briefly, but flippers are trickier. Since the player may hold the flipper up for an arbitrary amount of time, there's a risk of exceeding the duty cycle of the solenoid. So many (all?) pinball machines initially power the flipper at its full voltage when the player first presses the button, but then switches to a lower voltage if the player holds the button in. The full voltage gives the flipper the power to bat the ball, and the lower voltage is enough to keep the flipper up. At the lower voltage, the solenoid will generate less heat, so it can be kept on without exceeding the duty cycle.
The 10K from Gate to ground pulls the Gate down after the drive signal is released. if you use a resistor on the drive side, you get a potential divider. If that resistor is 10K, the Gate gets only half the drive voltage. Using 100 ohms puts the level much higher, making it turn on better. If the gate signal is being driven by a logic output, such as the Arduino, you may not _need_ either of those resistors, but it's a good idea to have them for "failsafe".
I want to make A mini jackhammer out of a push pull solenoid. I don't know how to make it work like a jackhammer?? like 'Push and pull' is one cycle like a jackhammer. I have been trying to find out how for like 4 days now. is there a little pcb board that can do this or control it?
One concept that you might like to know about is opto isolation. This is where you don't want to commingle your power supplies which can keep you from blowing up your controller due to large switching currents. Use an optoisolator. Your micro turns on a LED which then turns on a light sensitive transistor in the separate circuit.
@dylans voice it depends upon what you are thinking of in terms of switching currents . If you mean external circuits that are not connected to the circuit and power supply then bypassing the power lines and shielding the board within a metal enclosure will probably work. If the anticipated noise is due to induced ground currents then the way to proceed is to insure that there are no non isolated connections to the power to the external controls and that the ground for the controller is only connected to the power supply directly.
You can use PWM to change the strength of the magnet which would in turn affect the velocity of the plunger, and maybe more importantly, how much force it hits things with (in the case of an application like a pinball machine flipper). Don't expect any fine control over this though! If you want that, you should really be looking at a stepper motor instead. Solenoids are great when you need that little bit of very sudden (and strong) movement. But you frequently see people trying to use them in places where a stepper is the better solution (and vice versa). Why controlling velocity of a solenoid is a funny thing: The acceleration changes with how much of the plunger is within the magnetic coil vs outside of it, because then more of the plunger has a magnet acting on it, and you get exponentially more force. Acceleration determines the change in velocity. So if the acceleration gets faster and faster as more of the plunger enter the magnetic coil, the velocity also gets faster and faster as the plunger enter. Put in simpler terms, when the solenoid activates, the plunger is initially moving very slowly (relatively speaking) and by the time it plunges all the way, it's moving extremely fast. It's not a linear speed. You can see force charts for some solenoids in their datasheet. Don't think you can see acceleration or velocity normally, but it's going to be a similar idea. All the action happens towards the end of the plunge.
I was always told that common practise was to add a fuse on the positive side, But it would work on the negative . In fact fuses on both side would be ok too. Can you tell me why you use the negative? On a vehicle I use a standard Relay as a switch, They are rated up to 30 Amps 12 volts. yet only need less than 1/2 amp to operate.
I hate to say it but it's what was convenient at the time with the layout on the breadboard/it was an afterthought. That's all. If I had to do it again I would put it on the positive side, as this would be clearer, especially on schematics. And in some cases which you choose matters (see automative wiring). Also note that this circuit is DC. In AC there is no +/- and you very much want to put the fuse on the hot side to ensure parts of the circuit before the fuse aren't live (disclaimer: don't mess with mains voltage).
@@MattInglot Thanks for the reply, Good job by the way. Just fitting a new solenoid to my RV fridge (it opens the gas valve until the main valve senses the flame, It's an aftermarket item (They don't sell the original anymore) so I'm fitting a relay and diode to bring it up to standard. Thanks for your help and Hi from France :-)
Wow this video took off more than I expected. Schematic is now in description. If I missed any detail from the video in it someone let me know ;) It's been a while!
Hi Matt, thank you so much for the video..could you please explain where the 12V powering the solenoid is coming from? Is it possible to use rechargeable batteries? I have a project where we have to power 2 of these simultaneously, any advice please?
The 12V supply can come from anywhere, as long as it can handle the current requirements. I believe I was just using one of the 12V power supply bricks. Battery would be fine too just keep in mind that conventional batteries (such as AAs) tend to not put out a lot of current, so your solenoid might not be able to fire as well. LiPo batteries have no problems with that, but there are serious safety issues to consider and you should not use them without thoroughly understanding how to do so safely. You can control as many solenoids as you want. With the setup I showed, you basically need a MOSFET and separate PWM pin for each solenoid you wish to control (only needs PWM if you want to control the power, else can be a regular output pin). All the solenoids can be wired in parallel to the same power source. But to control them individually you need the separate mosfet and pin. Work it out, I'm sure you can do it.
Would love to know how it works out for you. If you just want to test actuations, you might actually prefer a servo. But on the other hand, solenoid could be great for really testing durability. Think people mashing buttons on an elevator! I would put some sort of soft tip on the plunger of course, and have the plunger touching the button in the depressed state so it doesnt ram into it.
It seems the final schematic that you posted a link to calls for two resistors but I only see one here when you are using the arduino board. Am I missing something?
It's explained in the errata section of the video description, but tl;dr that 150ohm resistor is recommended and something I worked out after shooting the video.
@josefzammit3059 keep in mind the Mosfet in the circuit is the switch that turns power to the solenoid on and off. So what you are really asking is can I turn on 5 solenoids with a single switch. And the answer is yes as long as the current capacity of the mosfet can handle it (typically that also means using a heatsink). But now what happens when you turn this switch on? All 5 solenoids activate. Whereas if you use 5 mosfets connected to 5 different pins, you have the ability to individually control each solenoid. Which is probably more useful.
Hi matt thanks for you reply. Perfectly understood. The idea is not to fire them at once but rather connect them to different pins into the arduino and fire them accordingly
Assuming you don't need the near-instant actuation, a stepper motor would do a great job. Or even a regular motor with the right gearing. See how smart locks work on doors.
Hello Matt, your video is awesome. Thank you for sharing. One thing, with this set up, do you think we can actually control the speed (force) of the solenoid?
Thanks Jean. You absolutely can, that's actually one of the benefits of this setup (as opposed to using a relay). Look up PWM - Pulse Width Modulation. This is what modern pinball machines do to allow the operator to adjust the strength of the flippers for example.
If you move a magnet through a coil of wire, you will induce current in that coil (the magnet must be moving). So yes, if you were to replace the plunger with a magnet and move it back and forth, you should be able to measure some current. Tonnes of sources online if you want to read about that further, such as www.electronics-tutorials.ws/electromagnetism/electromagnetic-induction.html In fact, when you cut power to the solenoid, the magnetic field collapses, and that does induce current, which is what the diode is there to protect against. It gives it somewhere to go other than your Arduino or power supply.
The one thing you need to explain about Voltages is that is is basically a -potential difference-. So 12V can be the difference between 0 and 12, but also the difference between 100 and 112. Your Arduino will be fried by 100V, so to make sure that your negative side of your 12V potential difference = 0, and not some random value, you ground everything together. Hence the name common ground.
Technically yes, but uhh what are we vibrating here? When I think "vibration" I think either a speaker, or a I think of a DC motor with an uncentered mass attached to it that vibrates when it spins. Solenoid will bang around until the frequency exceeds how quickly it can retract, but I'm having trouble picturing where that would be desirable.
Great video. Thank you. I’m a complete newbie to arduino, but I’m working on a project that would require the solenoid to be activated by a remote control, is that something that is possible? Thank you.
Absolutely! You can control a solenoid with an Arduino, and you can send signals to an Arduino via remote control, therefore you can control a solenoid via remote control. May options for this. I believe the various Arduino kits come with an IR remote. Personally I think the nrf24l01 modules are a better option, but they are a little more advanced to get working correctly. Good luck.
So im using a ardino to fire a solinoid 15 ms on 30ms off repetivly at the comand of a button Qestion is is it benificial to use a diode in my solinoid circuit off the mos fet and is it still desirable to ground out the mosfet gate.
Yes. You'll probably get away without the grounded gate if you have the Arduino hooked up to it, but I don't see a reason not to ground it. If you leave the diode out, you will potentially fry your Arduino.
how would i control 3 solenoids switching off/on hold order with two buttons? one cycles up then 4 or 5 clicks then the other cycles down. hard set rules of not breaking the solenoid on off order tho...
First off- This video was very helpful! I am building a visual pinball controller and am using solenoids for haptic feedback. I built the circuit as you showed last night and everything worked great... with one small exception. As per your video description, there isn't a resistor between the arduino pin and the gate. I added a 100k resistor (closest I had to a 150k) and the circuit didn't seem to work. However, removing the resistor (like you have shown in the video) and everything seems to run great. How important is adding in a resistor between the arduino and the gate? Perhaps I installed it wrong or the 100k wasn't what is needed?
@@MattInglot Doh! Of course! Thanks and I will do that. One more question.. I currently do not have a fuse installed either. Can that be any 3amp fuse or something? and do I just solder wires to both ends? Sorry- I'm still a bit new to hobby electronics (I know just enough to be dangerous)
@@eric3dee You want to size it to the load. You can calculate that, or measure the current the circuit actually draws with a multimeter. Then you want a fuse that's 1.25-1.5x that. I should add (and I don't think I mentioned this in the video), that a slow blow fuse is probably your best bet to avoid the sudden inrush current from blowing it.
Excellent and clear spoken diagrams explanations, without anoying music, easy to understand, many thanks for posting `! PLease explain how to retain the solenoid for 3 seconds ? Now its acting more like pulse latching
Thanks for sharing! Humbly asking: how comes you fit a 3A fuse and a solenoid that will draw 2A on a breadboard that is probably not rated for those values? (At least you didnt mention the specs).
Thanks. You want the fuse to blow as a protection measure if the load on the circuit is higher than expected, which most likely means something has shorted out and will draw all the current the power supply can put out (until the supply's own fuse blows). So if we assume that solenoid was indeed 2A, you want something higher. I eyeballed 3A because it gives the margin of error, but should still blow if the circuit has a serious fault (again almost certainly a short because something got plugged in wrong or loose). The goal is protect the power supply and possibly prevent a fire if you're using a supply that can put out way more current than you need (think those DIY ATX ones without current limiting). That said, fuses are complicated: th-cam.com/video/WG11rVcMOnY/w-d-xo.html As for the breadboard: it was there to demo only, yes I should have pointed it out. Basically you might not get full power from your solenoid if you use a breadboard because of the high resistance it has.
Quick question if I wanted to run a solenoid that would ring a bell like a fire alarm how would I do that? Also being able to change the Hz frequency up and down to adjust the bell hits slower or faster. A variable power supply would be used so the voltage can be increased to make the bell hits harder and louder.
What a great question. You got me so curious about this that I looked up how those old school fire alarm bells work and you're not far off with your idea. I managed to find this article: www.aplustopper.com/working-of-an-electric-bell/ It looks like these types of bells already use electromagnets to function (remember, that's really all a solenoid is...), and there are different ways of making that mechanism work. What I love about the one in that article is that it naturally creates the ringing by interrupting the circuit when it the hammer hits the bell, which allows it to retract back, which closes the circuit and activates the electromagnet, which brings the hammer back to the bell, and so on. You could very easily swing a hammer with a solenoid in a similar way. Just have the hammer pivot on something, so that when the solenoid pulls down the hammer swings and hits the bell. You could then vary the frequency with how often you pull down the solenoid (eg. fire it once a second, twice a second, etc). You are correct that you can control the strength of the hit by varying the voltage, however you don't need a variable power supply. If you're using an Arduino like in my example, just make sure you connect the solenoid to a PWM pin, then use Arduino PWM functionality to simulate the voltage change (eg. 50% PWM would effectively give you half the voltage). Note that you won't necessarily have a linear correlation between PWM frequency and volume so if you're building a volume knob or something you will have to experiment with how to map the PWM frequency to the desired volume. Keep in mind that the purpose built fire bell mechanisms like the one I linked have a very small amount of travel, which allows them to ring at a (relatively) high frequency. If you buy an off the shelf solenoid, like the ones on Amazon, those things take a (relatively) long time to plunge back up after plunging down so that will limit the frequency. That should really be it. Be sure to watch the video because that Arduino circuit is exactly what you need, and the rest is just building the mechanical piece. Good luck!
The resistor numbers aren't particularly critical in this case. About 10K from Gate to ground pulls the Gate down after the drive signal is released, and the 100 ohm from signal to Gate is just a little protection. If the gate signal is being driven by a logic output, you may not need either of those resistors.
There are fuses that already come with leads attached, and there are also fuse holders that will fit in a breadboard. That said, the breadboard is for experimentation and testing, but if you want something more permanent you *will* want to solder everything onto perfboard.
@@MattInglot Hi, its me again. I have troubles powering solenoid with Arduino. It seems there isnt enough power. I have 12V 2A power source. I dont use resistor on pin and gate to Arduino. What would happen if I changed 10k resistor for 1k?
hi, i bought some IRFP260Ns before watching this vid, and im having trouble getting the program to work. Im starting to worry that it might not be logic level capable, but i dont know how to find out for sure
Hey man, I also don't know much about circuits and am planning on making my own pinball machine, I'm going to use a 320w 48v power supply. You said you was using a power supply too, I was wondering if you would be able to show that so I can see the full connections as I'm confused to where the wires that go off screen go too and where to power supply is connected too to power the solenoid, Many thanks!
If you don't know much about electronics and are building a pinball machine then the good and bad news is that you will end up learning a lot about electronics ;) Here are a couple good resources that include wiring up power supplies, I think these will be a lot more helpful a lot faster than me typing up the same info in a TH-cam comment: mjrnet.org/pinscape/BuildGuideV2/BuildGuide.php?sid=powerSupplies pinballmakers.com/wiki/index.php?title=Construction#Power_Supplies Note that Pinball wiring and electronics can be dangerous (risk of shock from mains power, risk of fire from failing electronics). You may wish to get the proper training to work on some of this stuff, or partner up with someone who knows how to do it safely. Good luck.
Of course you can. Whether it's practical or not is a different question. It's going to need to be a pretty big and powerful solenoid, especially if you're hooking the weight directly to the plunger because you've got no mechanical advantage. I have no idea what your application is, but there's a good chance you would be better served by something else like a servo motor which will be a fraction of the cost and size to lift 5kg (at the disadvantage of taking a lot longer to lift the load).
Awesome video! Thanks for the details. I am currently trying to learn how to wire and code something similar, except I want to reduce the current at end of stroke using the PWM outputs on my control board. Ill look around your channel! I can hopefully find something because it's a head scratcher for me using a 2 pin solenoid. Basically just hoping to hold the solenoid (and flipper bat) in its extended position without burning out the coil. Thanks again!
good video I ask you a question is it possible to control an electromagnet through an arduino but using pulses instead of the classic turn off and turn on as if it were a led
Thanks. Yes you can build the exact circuit I show and just make sure to hook up the mosfet gate to a PWM enabled pin on the Arduino. Then you can use PWM to control the strength of the electromagnet.
Thanks for the clear explanation! Would it be possible to connect the Arduino as well as the solenoid to the same power supply (in parallel), such as a simple battery holder? Because that way the voltage comes straight from the source itself, instead of going through the Arduino first, while still connecting both grounds.
I don't see why not. Give it a shot and if you run into issues go down the troubleshooting rabbit hole until you figure it out. One thing I'd wonder about is voltage drop on the battery when firing the solenoid, and needing to throw some capacitors in to counteract that. I may play around with this one day with my scope hooked up, just haven't had a chance to do it. If I do it I'll make a video. But for sure play around, have fun, see what you learn.
Thanks for the great explanation video. From my limited understanding, the main danger I see here, is the danger of having an issue on the arduino side that leave the digital pin on for the solenoid. (Could be a programming error, or something that crash at the wrong time) There is nothing then to shut it down and prevent it from over heating.
I'm going to try the middle circuit with a 12v 8A dc supply to power a 12v 8A solenoid, apart from changing to a bigger fuse do you think I need to change any other component on the circuit? :)
You'll want a bigger power supply than 8A for that. Breadboard won't work either, you'll need to solder or use appropriately rated connectors. Watch the gauge of your wires. Check every component to make sure it's rated (well above) 8A. If you don't need to run off 12V, this sounds like a job better suited for 24V. You would need about half the current with the right solenoid. Might make your life easier.
@@MattInglot oh nice one! Ok well probably won't go that route then. Actually I was thinking of using an airsoft lipo battery 2250mAh 11.1V and just using a 12v 8A solenoid to power it, what do you think? I mean your solenoid looks quite powerful and that's just a 12v 2A one isn't it? I just need to add some recoil to a fake rifle really.
@@KobraVR cool idea. If the battery can supply 8A then sure, I don't see why not. Having lower voltage shouldnt be a problem (just slightly weaker). You will have to experiment to see what gives you a "good recoil". I bet if you look online you will find someone has already tried something like this and you can see what works (or why it doesnt work maybe)
@@MattInglot I think im going for an 11.1v lipo battery 2250mAh 35C to power a 12v 2A solenoid. That way I think I can pretty much your 2nd circuit and components without having to worry about changing things by much. I'll have to see if the 2A solenoid is powerful enough but yours looked pretty snappy in the video. Thanks for getting back to me I'm excited to test things out! :)
@@MattInglot sorry to pick your brains a bit, if I used a 12v DC mains supply at 2A would that be OK to drive the 12V 2A solenoid? I'm a bit confused as you said for the 12v 8A solenoid I would need more than the 12V DC 8A mains to run it?
Hey Matt! Super solid video but I was wondering why you ended up switching the MOSFET in your final iteration from the first one. Would your circuit still work with the original MOSFET?
Hey Jason I do explain that in the video. The issue is if you want to use the MOSFET with an Arduino, you need to be able to switch the gate with the 5V output of the MOSFET. So I switched in a "logic level" mosfet that is capable of being driven with a lower voltage.
Not very large! I've only found the small blue ones like you see in the vid. I got my big bois off Digikey. I'm sure there are other suppliers as well.
Hey Matt! This is excellent video of an introduction on using Solenoids for Arduino projects! I do have a request on the other hand! Are you able to make a video on how to make a midi Solenoids instruments by using a Arduino and using a music program like fl studio or ableton to run the midi file onto a Solenoid?
i want to activate pin 8 via wifi. I found that the esp32 has a wifi function but i dont know how to hook it up to the arduino. Is there any simple tutorial for this?
An ESP 32 is also a micro controller, just like an Arduino. So if you want to "activate" something with ESP32, there shouldn't be a need to also involve an Arduino. Unfortunately helping you here is out of scope of the video but hopefully that clarifies things.
@@MattInglot thanks alot. I found a webserver scrip wich gives you the option to activate a pin, so i dont need any other code than that and the ciruit. But still without this video i wouldnt even think of anything like this! :)
You could swap out the mosfet with a relay *module* pretty easily (the kind where it's a PCB with the relay and other components already on it and you can just hook it up directly with microcontroller). You can't swap all that just with a bare relay though, since there's a few components needed to drive a relay correctly with a microcontroller. You also still want the diode to avoid damaging anything.
Hi, How could you make it to oscillate at a certain frequency (like ultrasonically) ? Would be an interesting idea to make an ultrasonic knife out of it. Thanks ! 😇🤗 Best Regards,
You can certainly use Arduino to pulse it very very quickly and have some fun figuring out how fast you can make the solenoid go. BUT... I doubt you'll get even close to ultrasonic. I looked it up and ultrasonic is considered above 20khz so let's assume you want to hit 20khz. That means that the solenoid plunger has to plunge and retract 20,000 times per second. That means each cycle of plunging and retracting has to happen in just 0.000050 seconds. That plunger needs to MOVE, and it can't move very far. It would be interesting to see how fast you could get it moving if you start playing with the variables: I would try a very strong spring, and block the plunger from moving out all the way (maybe like 10% of the normal travel distance). That way it's always mostly inside the coil (much faster acceleration), and also doesn't have to travel very far.
All the black wires go to ground. This one appears to be connected to the fuse. There is a schematic you can download in the video comments that may help.
@@MattInglot No, sorry, not the third _black_ wire, I meant the third wire *including* red. It's the third wire but the second black wire from the left. It's not connected to the fuse
@@dizzyrocket2000 ah ok! That one is just... chilling out. As you can see on the breadboard it's not connected to anything, so I think that was a leftover from one of the previous versions I showed, or something for easy testing. I must have missed removing it.
@@MattInglot will do! I have a suggestion for you though - you should make project tutorials and go really in depth with them. I’ll be starting to make some in the future when I can have my workbench spot finally, but until then, I gotta wait cause I can’t use any of my tools. People want to see things that they can make and copy. Also you can try to remake popular products!
Hi Matt, great video! Quick question -- What is the voltage across breadboard 26e (or simply row 26) and row 21 when no voltage is supplied to the gate on the Mosfet (output pin 8 removed)? I have more or less replicated what you have but am finding that when 0V is supplied to the Gate, the voltage on the load is still around 2V… when I supply 3V to the Gate, the voltage on the load is 12V as expected. Trying to understand why there is always 2V even when the Arduino is not supplying any output. Was expecting the voltage to be 0 or close to it. Thanks!
Hey Chris, it's been a while since I've played with this circuit but taking a quick look at my schematic again (which you can download in the video description by the way, may help to make sure everything is wired up right), I'm pretty sure it's because the load isn't part of a complete circuit when the Gate is pulled down to 0V. So you're getting some potential differences but they should be meaningless. If you try to connect your meter in series with the load and measure current you can verify that nothing is happening. All that said, if you're using two power supplies like I did in my project, make sure the GNDs of the supplies are tied together so that they agree on what 0V is. Or you will get all sorts of interesting measurements and very possibly damage the Arduino. Good luck!
Haha! That would be interesting to try. And to compare using solenoids vs servo motors for this. I'm not really convinced that the solenoid's ability to deliver energy rapidly is very beneficial here. Compare that to a servo which would operate more slowly, but can leverage tremendous mechanical advantage.
@@MattInglot On my channel I recently built a flip top tool cart. I am trying to automate the flipping of the cart. I am going to use solenoids as the locking mechanism.
Generally speaking any DC solenoid, including DC solenoid valves, should work. However you need to make sure you pick components suitable for your application, and if this is something that will impact the ability of the car to function or could otherwise damage property/cause injury then you really need to speak to a professional versed in what you are trying to do. All the considerations there (such as even proper choice of wiring) is beyond this video.
I wanted to use these on my diy drywasher, but seems like they were too small for my project. I wanted to hang a shaker table from the solenoids and turn solenoids on and off at high frequency to create vibration, by liftingthe table up and down. But looks like the shaker table is too heavy for them to work properly. I used 6v and 12 v ,but 12v solenoid was too weak and i connected 12v source to the other 6v solenoid and it heated up very fast ,but I was able to get some motion, but my ampmeter showed 6amps. So 6×12=72 watts. This got me confused, because I thought instead using a motor hanging the table from solenoids will be more efficient ,but looks like it's not... not sure
Solenoids are great for short bursts of motion or force. Something like continuous vibration can be done of course, but feels like barking up the wrong tree. At minimum you will need a much stronger solenoid as you've found out. A big problem is that you can get much better performance out of a solenoid if it doesn't need to be continuously operating. You experienced this with your 12V to 6V solenoid experiment. If you had an application where that solenoid had to impart a lot of power but fire infrequently, using it this way would be totally legit.
hi and thank you...i'm not sure if i'm seeing this wrong, having trouble following the breadboard wiring...the flyback diode should t not be in parallel to the solenoid? also the fuse should it not be on the input rather than the output?
The diode polarity should be opposite that of the solenoid, else you basically create a short (sorry I THINK that's what you are asking). As for the fuse, take a look at the schematic posted in the description. When the fuse pops, does it create an open circuit?
I'm looking at these to activate a pull pin on a rc 1/10 winch can I just hook up the positive to a switch turn on stays pulled in until switch is turned off then springs back then opersite way wind winch in 🤔
EDIT: TIT I put 2 as the initial value not 20 in the code Lol works great thanks so much! Hi so I did get round to building this circuit, almost identical to yours but I only have IRL540N mosfet so I ordered the logic level one you have, waiting for that. In the mean time though when I power the circuit on it pulses but very weak, far too weak to move the solenoid, it's like a buzz noise each tick thats all. Is this due to the wrong type of Mosfet do you think? The 12v dc 3A supply is ample to throw the solenoid when I just hook it up directly. This breadboard seems to suck the life out of it though, I have an ammeter which part would be best to check? If you are too busy to answer don't worry and thanks again for the ace video!
@@MattInglot thanks I love it! I was wondering if I could hook up a 24v power supply with a larger solenoid with exact same layout would that do without switching any components do you think? 🤔
@@KobraVR As long as all your components are rated for it (preferably with some margin of safety) then that's totally fine. One thing to pay attention to in addition to voltage is current. Make sure you're in spec on everything there (that goes for whatever solenoid you're using, regardless of voltage). Breadboards in particular can't handle much current (I was probably pushing it with my demo) so if you're having issues then soldering it together on a perf board would be the better idea.
@@MattInglot Matt that's really helpful thanks. One last thing (like Columbo!) something I just noticed which is really bloody odd...I only seem to be having 6v through the solenoid? Its 12v DC 3A supply. I hooked it up just like yours the only thing that is different is I am not using a logic level mosfet (they are on order). Is it possible that mosfet is doing some kind of voltage divider thing with my circuit? It seems too convenient to be around 6v you know?
@@KobraVR it's honestly too hard to try to debug people's circuits over YT comments, but you have some good ideas. Putting in a logic level MOSFET would be a good start.
that helped a lot... i am also on a pinball project... the issue where i am from is its difficult to get high power solenoids... have you tried using high speed servos instead?
I hear you on the solenoids being a pain to source - I think it's largely because pinball has relatively niche and unusual requirements vs the way solenoids are normally used. I haven't tried servos specifically. I did try car lock actuators which *sort of* worked, and you can find a video somewhere on YT of someone having done this, but I never got satisfactory force and kind of expected they would fail quickly since no one expects car door locks to be actuated many times a minute for potentially hours at a time. Rather than speculating on something I haven't tried, I'll suggest you try it in the name of science and let us know what happens! Would be fun to know and even if it fails there's always something to learn. Alternatively you can get more creative with finding the solenoids. For example you could use actual pinball mechanisms - you can buy those parts new or strip down an existing machine that's in bad shape/cheap.
Matt Inglot thanks Matt for your suggestions.. I'm right now in Dubai and pinball isn't popular here at all.. Sourcing has become almost impossible due to the curfew... Lemme try with the servos in the name of science 🤪.. Will keep you posted
The circuit demonstrated only works with DC. You can't directly control AC with a mosfet. Your best and simplest bet if you don't need PWM control over the solenoid is to use a relay module. If done right, that will have the added benefit of isolating the two supplies. There are videos by other people on YT that demonstrate how to do this with a relay. Good luck!
@@MattInglot Thank you. I was using garbage cheap relay boards from Ebay. They backfed noise all through my setup and reset the board with each firing of the solenoids. I tried better (branded) relay boards and everything is working great now. My trees will finally get consistent water!
@@drsnooz8112 sounds like they may have been missing a flyback diode. That's also why a board, rather than just a bare relay, is important (in case anyone else is reading this). You can't just connect the Arduino directly to the relay and expect it to work reliably. There are nuances to controlling relays. Glad your plant watering system is working.
Hey Matt great video!! I found this video through search and I’m looking to build a project using a sollinoid. I saw that you have a fairly new channel so I thought I’d help you out with a comment, like, and a new subscriber! Great job man!
No worries, it's tricky when you don't know the name of something! This is a screw terminal, I'm just using it to connect the positive and negative wires from my power supply to the bread board. All it does.
@@jonathansiskind8315 If you search glass fuse with axial leads you should find them. Or get fuse holders which are actually the better solution for anything more permanent.
so couldn't you just use a 12v LED( light emitting Diode) instead of the rectifying diode? Since all that it is doing is stopping the voltage from back feeding. If thats possible to use an LED. Then I assume just use it like normal that when you push the button the LED will turn on, while also stopping the reverse flow of electricity?
As an experiment to see if you can catch it lighting up when power is stopped? Sure, give it a try and let us know what happens. As a practical thing? It's not something you'd want to do. Regular diodes are cheaper and actually meant for this purpose. Stuff that could be a problem with using LEDs: - LEDs have very low current limits. You could burn it out either immediately or over time. - LEDs have fairly low reverse voltage, so that could be a problem very quickly, and if you hit that threshold then you'll probably burn out the LED instantenously. - You mention a 12V LED, so that implies several LEDs in series to get 12V. I have NO idea how that affects the scenario and would love to find out. Alas I think it means nothing good :D Give it a try and let us know!
@@bananasplit4037 You should be able to find tutorials very easily on how to detect switch presses on Arduino, along with sample code. Then all you need is logic in your code that checks if the switch is pressed, then triggers the solenoid.
You should be able to adjust the strength of it by attaching it a PWM-capable pin on Arduino and using analogWrite. A stronger spring would do this to some extent as well. Note that no matter what you do, this thing will fire in a fraction of a second so if you're talking speed as in you slowly want it to depress down then this would not be a good component to use. You would be looking at a servo or stepper motor, both of which are capable of much slower movement.
An LED is a diode, but it's not a diode that has the right specifications to make it an effective fly back diode. For example, most LEDs have a pretty low reverse voltage (let's say 5v). Since the flyback diode is wired in reverse, it means that reverse voltage is very important because let's say it's a 12V solenoid, you've gone far past the reverse voltage and blown up your LED. Always easier to learn by doing though and LEDs are cheap, so experiment with it, blow up a few, and see what happens!
Hi Matt, I hope your pinball project went well! I'm about to follow this project as part of my University final year project but can't find out what the components you have used are. What's the name of the blue piece that takes the power supply? And how have you exposed 2 wires from the power supply also? I have a 12v power lead with the regular power jack which without changes cannot be used to power the breadboard. The solenoid I am using is also 12v.
If you Google "screw terminal block" you should be able to find them. Or if your power supply already has a different connector (sounds like a barrel jack most likely), then you could get the female barrel jack connector for your breadboard and use that. That will actually be a more reliable connection if you're trying to build something more permanent.
I have a question. I bought 12V/2A solenoid and have 8 AA batteries to provide 12V. Can I connect batteries directly to solenoid and solenoid will only pull max 2A as its designed, or will it take all the power it can causing it to overheat. Would I need to put some resistors on the batteries first or just directly 12V to solenoid would be fine?
A power source being able to supply MORE current than your load needs is not a problem. The solenoid has a certain resistance, which in turn determines how much current it will draw thanks to Ohm's law. So the load determines the current drawn, not the supply. Of course you're probably asking this because you've seen resistors being a requirement for using LEDs, because otherwise the LED WILL blow itself up very quickly. That's because diodes (including LEDs) have very little internal resistance and will happily burn themselves out immediately without a resistor to limit the current. So if you hook up your LED without a resistor, you have a load with very little resistance and hence it will draw a lot of current (again Ohm's law comes into the picture), and the LED will blow up. Your problem might be that 2A is a lot of current for a AA battery. You can actually look up datasheets for batteries and see what that looks like, but 2A seems like a lot. At the very least I would expect it to discharge quickly. THAT said, if you are only pulsing the solenoid for short periods, it may be totally fine and you may still get adequate performance.
This is a really good video. Very clearly explained, in a nice, even manner. At first I didn't think I wanted to watch a 20 minute video, but once it started, I didn't think twice about it
Thanks!
You might not be an electrical engineer but you helped me in my EE senior design :) Thanks a lot for the thorough walkthrough and multiple revisions, as well as having links to the parts used!
That makes me really happy to hear! Good work getting through your project! I'm glad the video helped.
Appreciate you showing the simpler circuit (before the mosfet was added), most people skip that kind of stuff but it's very useful for understanding things!
Glad it helped!
@@MattInglot i am using three power supply 5, 12 and 24 vdc, should i connect all 0 ve /grd together, to be given to the diffrent powered dc outputs ?
@@MattInglot can i use Adriuno in place of costly PLC to manage a DIY project comprising of 4 dc outputs and 3 ac outputs (0.2 - 9 amp via ssr) and 7 dc inputs....using relay module ? (my plc ladder has 58 rungs in total )
@@anandjoshi8554 Yes absolutely. If using multiple supplies in the same circuit, tie the grounds together.
@@anandjoshi8554 Yep. I'm not experienced with PLCs but Arduino can certainly control all this stuff. Just keep in mind that PLCs are very different than Arduino, again not experienced with them but my understanding is they are built to withstand harsh environments and be super reliable and all that.
This is what I've been looking for! Best video on TH-cam for using solenoids with Arduino. Thanks a lot!!
You helped me in my BME senior design. Thanks for the thorough walkthrough and multiple revisions and tips. Excellent content, greetings from México!
That's really wonderful to hear! Nice work!
Wow, I always see someone using a relay for this and honestly never thought of using a MOSFET. It was a great video, you deserve more subscribers.
Thanks so much I really appreciate it! More vids are coming soon too.
When I bought my little pack of mosfets, I worked out that a relay that could handle the same current (70A) would probably cost a good bit more than the 10 I bought put together. Relays, of course, tend to have higher voltage ratings and I hear they're not too fond of PWM switching roles... 😁
I have to be honest man: this video is one of the best videos for describing a project for arduino! I really really have to say: Thank you man!
Optocouplers are your best friend if going from digital electronics to power electronics, I'd look them 👍🏾🙂
Edit: they basically completely isolate the input signals from the output. It does that by converting electrical signals to light, then back to electrical signals. This means no voltage ot current spikes will damage low power electronics
Note:
With opto-couplers, you *don't* want to connect grounds or power sources to each other, otherwise you'll defeat the purpose of the chip.
optocouples dont take much amps, because the optic part of them burns out. but they are cool.
Finally, my issue is solved with the solenoid, all thanks to you! You got a new subscriber and lots of respect
Nicely done!
Thanks, this was really helpful!! Also probably the best intro on any TH-cam video I've seen!
Thank you!
To overcome the limited duty cycle of a solenoid just double the voltage capacity of the solenoid. In other words, on a 12 volt supply just use a 24 volt solenoid.
As a builder of solenoid engines this video is great.
Thanks a bunch.
Thanks and great tip!
My GOSH! your presentation skills are Awesome.. Please don't ever stop what you're doing
Thank you so much!
Very educational and practical video considering that solenoids are also used in locks. Thank you for the detailed explanation and the schematic. This is a great electronics project.
Thank you so much!
Excellent presentation.
Be careful using a solderless breadboard for this: Many are rated to 0.5 Amps, though there are some high quality ones rated to 2 Amps.
As Sean Ocansey said in the comments, the next step is to use an optoisolator. Since you won't have to connect the grounds together, your sensitive Arduino electronics will be better protected from the spikey and noisy electromechanical circuit.
Many of the solenoids in a pinball machine are switched on only briefly, but flippers are trickier. Since the player may hold the flipper up for an arbitrary amount of time, there's a risk of exceeding the duty cycle of the solenoid. So many (all?) pinball machines initially power the flipper at its full voltage when the player first presses the button, but then switches to a lower voltage if the player holds the button in. The full voltage gives the flipper the power to bat the ball, and the lower voltage is enough to keep the flipper up. At the lower voltage, the solenoid will generate less heat, so it can be kept on without exceeding the duty cycle.
Lots of great points thanks!
The most complete and easy to get explination I've seen,thanks
Thanks!
The 10K from Gate to ground pulls the Gate down after the drive signal is released.
if you use a resistor on the drive side, you get a potential divider. If that resistor is 10K, the Gate gets only half the drive voltage. Using 100 ohms puts the level much higher, making it turn on better.
If the gate signal is being driven by a logic output, such as the Arduino, you may not _need_ either of those resistors, but it's a good idea to have them for "failsafe".
That's a great point.
I want to make A mini jackhammer out of a push pull solenoid. I don't know how to make it work like a jackhammer?? like 'Push and pull' is one cycle like a jackhammer. I have been trying to find out how for like 4 days now. is there a little pcb board that can do this or control it?
This was an awesome video, that answered about 5 questions that I had, and I only came to this video hoping to find 1 of those answers, thank you!!!
Thanks this made my day!
One concept that you might like to know about is opto isolation. This is where you don't want to commingle your power supplies which can keep you from blowing up your controller due to large switching currents. Use an optoisolator. Your micro turns on a LED which then turns on a light sensitive transistor in the separate circuit.
100% That's a good approach too.
@dylans voice it depends upon what you are thinking of in terms of switching currents . If you mean external circuits that are not connected to the circuit and power supply then bypassing the power lines and shielding the board within a metal enclosure will probably work. If the anticipated noise is due to induced ground currents then the way to proceed is to insure that there are no non isolated connections to the power to the external controls and that the ground for the controller is only connected to the power supply directly.
@dylans voice plenty fast for this application. Look at the data sheet for the one you choose for performance data.
This is great. Do you have any video's on how to vary the velocity of the solenoid?
You can use PWM to change the strength of the magnet which would in turn affect the velocity of the plunger, and maybe more importantly, how much force it hits things with (in the case of an application like a pinball machine flipper).
Don't expect any fine control over this though! If you want that, you should really be looking at a stepper motor instead. Solenoids are great when you need that little bit of very sudden (and strong) movement. But you frequently see people trying to use them in places where a stepper is the better solution (and vice versa).
Why controlling velocity of a solenoid is a funny thing:
The acceleration changes with how much of the plunger is within the magnetic coil vs outside of it, because then more of the plunger has a magnet acting on it, and you get exponentially more force. Acceleration determines the change in velocity. So if the acceleration gets faster and faster as more of the plunger enter the magnetic coil, the velocity also gets faster and faster as the plunger enter.
Put in simpler terms, when the solenoid activates, the plunger is initially moving very slowly (relatively speaking) and by the time it plunges all the way, it's moving extremely fast. It's not a linear speed.
You can see force charts for some solenoids in their datasheet. Don't think you can see acceleration or velocity normally, but it's going to be a similar idea. All the action happens towards the end of the plunge.
Hi Matt, it's a fascinating project... and you are an amazing teacher!
Thank you!
Great job Matt, clear explanations, did not felt like a 20 min video.
Thanks that's really appreciated!
I was always told that common practise was to add a fuse on the positive side, But it would work on the negative . In fact fuses on both side would be ok too. Can you tell me why you use the negative?
On a vehicle I use a standard Relay as a switch, They are rated up to 30 Amps 12 volts. yet only need less than 1/2 amp to operate.
I hate to say it but it's what was convenient at the time with the layout on the breadboard/it was an afterthought. That's all. If I had to do it again I would put it on the positive side, as this would be clearer, especially on schematics. And in some cases which you choose matters (see automative wiring). Also note that this circuit is DC. In AC there is no +/- and you very much want to put the fuse on the hot side to ensure parts of the circuit before the fuse aren't live (disclaimer: don't mess with mains voltage).
@@MattInglot Thanks for the reply, Good job by the way. Just fitting a new solenoid to my RV fridge (it opens the gas valve until the main valve senses the flame, It's an aftermarket item (They don't sell the original anymore) so I'm fitting a relay and diode to bring it up to standard. Thanks for your help and Hi from France :-)
@@SlimTortoise awesome to hear :)
Very good explanation and demo of the circuit. Should mention that the MOSFET is a type of transistor.
Yes good point! Thank you!
Awesome easy to follow tutorial. And great humor at the very beginning😂😂
Good vid btw, a bit of constructive criticism, I'd try to draw diagrams or Schematics to help explain what you're doing 👍🏾
Thanks Sean. Yes that's a good idea, I hope to do this at some point.
@@MattInglot If you provide the schematics i'll subscribe to your channel :D lol
thanka for the video tho great stuff!
Wow this video took off more than I expected. Schematic is now in description. If I missed any detail from the video in it someone let me know ;) It's been a while!
It was a pleasure to watch this video and to listen to your clear explanations. Thank you!
Hi Matt, thanks for this video. This helped me a lot with my newest project.
You're a hero. Got my valve working now. Thank you
Thank you very much Matt. Appreciate you going through everything step by step.
Thank you :)
Hi Matt, thank you so much for the video..could you please explain where the 12V powering the solenoid is coming from? Is it possible to use rechargeable batteries? I have a project where we have to power 2 of these simultaneously, any advice please?
The 12V supply can come from anywhere, as long as it can handle the current requirements. I believe I was just using one of the 12V power supply bricks. Battery would be fine too just keep in mind that conventional batteries (such as AAs) tend to not put out a lot of current, so your solenoid might not be able to fire as well. LiPo batteries have no problems with that, but there are serious safety issues to consider and you should not use them without thoroughly understanding how to do so safely.
You can control as many solenoids as you want. With the setup I showed, you basically need a MOSFET and separate PWM pin for each solenoid you wish to control (only needs PWM if you want to control the power, else can be a regular output pin). All the solenoids can be wired in parallel to the same power source. But to control them individually you need the separate mosfet and pin. Work it out, I'm sure you can do it.
@MattInglot Thank you!!!
Thx, great tutorial that highlights important aspects that I might have missed otherwise.
Excellent video. I need to make a button pusher for a durability test. This will help if I decide to do it this way.
Would love to know how it works out for you. If you just want to test actuations, you might actually prefer a servo. But on the other hand, solenoid could be great for really testing durability. Think people mashing buttons on an elevator! I would put some sort of soft tip on the plunger of course, and have the plunger touching the button in the depressed state so it doesnt ram into it.
It seems the final schematic that you posted a link to calls for two resistors but I only see one here when you are using the arduino board. Am I missing something?
It's explained in the errata section of the video description, but tl;dr that 150ohm resistor is recommended and something I worked out after shooting the video.
Hi Matt nice video thanks, re: MOSFET, can I ask if you could hook up 1 MOSFET with 5 solenoids or it should be 1 with every Solenoid?
@josefzammit3059 keep in mind the Mosfet in the circuit is the switch that turns power to the solenoid on and off. So what you are really asking is can I turn on 5 solenoids with a single switch. And the answer is yes as long as the current capacity of the mosfet can handle it (typically that also means using a heatsink). But now what happens when you turn this switch on? All 5 solenoids activate.
Whereas if you use 5 mosfets connected to 5 different pins, you have the ability to individually control each solenoid. Which is probably more useful.
Hi matt thanks for you reply. Perfectly understood. The idea is not to fire them at once but rather connect them to different pins into the arduino and fire them accordingly
What component would you use if you want the latch to travel a much longer distance?
Assuming you don't need the near-instant actuation, a stepper motor would do a great job. Or even a regular motor with the right gearing. See how smart locks work on doors.
Hello Matt, your video is awesome. Thank you for sharing. One thing, with this set up, do you think we can actually control the speed (force) of the solenoid?
Thanks Jean. You absolutely can, that's actually one of the benefits of this setup (as opposed to using a relay). Look up PWM - Pulse Width Modulation. This is what modern pinball machines do to allow the operator to adjust the strength of the flippers for example.
Hi, mine wasn't working until i removed the resistor from 1st pin of mosfet to ground. Thanks for your help.
Its really good. I have doubt regarding this instead of giving supply to solenoid can we attach magnet to the solenoid and generate AC output ?
If you move a magnet through a coil of wire, you will induce current in that coil (the magnet must be moving). So yes, if you were to replace the plunger with a magnet and move it back and forth, you should be able to measure some current. Tonnes of sources online if you want to read about that further, such as www.electronics-tutorials.ws/electromagnetism/electromagnetic-induction.html
In fact, when you cut power to the solenoid, the magnetic field collapses, and that does induce current, which is what the diode is there to protect against. It gives it somewhere to go other than your Arduino or power supply.
@@MattInglot Thank you so much sir !!
The one thing you need to explain about Voltages is that is is basically a -potential difference-.
So 12V can be the difference between 0 and 12, but also the difference between 100 and 112.
Your Arduino will be fried by 100V, so to make sure that your negative side of your 12V potential difference = 0, and not some random value, you ground everything together. Hence the name common ground.
Can these solanoid used to make a vibration? Like keep on for 20ms and off for 20ms. Repeat it continuously
Technically yes, but uhh what are we vibrating here? When I think "vibration" I think either a speaker, or a I think of a DC motor with an uncentered mass attached to it that vibrates when it spins. Solenoid will bang around until the frequency exceeds how quickly it can retract, but I'm having trouble picturing where that would be desirable.
Great video. Thank you. I’m a complete newbie to arduino, but I’m working on a project that would require the solenoid to be activated by a remote control, is that something that is possible? Thank you.
Absolutely! You can control a solenoid with an Arduino, and you can send signals to an Arduino via remote control, therefore you can control a solenoid via remote control. May options for this. I believe the various Arduino kits come with an IR remote. Personally I think the nrf24l01 modules are a better option, but they are a little more advanced to get working correctly. Good luck.
@@MattInglot Thanks Matt, that’s great. I’ll look into that.
So im using a ardino to fire a solinoid 15 ms on 30ms off repetivly at the comand of a button
Qestion is is it benificial to use a diode in my solinoid circuit off the mos fet and is it still desirable to ground out the mosfet gate.
Yes. You'll probably get away without the grounded gate if you have the Arduino hooked up to it, but I don't see a reason not to ground it. If you leave the diode out, you will potentially fry your Arduino.
how would i control 3 solenoids switching off/on hold order with two buttons? one cycles up then 4 or 5 clicks then the other cycles down. hard set rules of not breaking the solenoid on off order tho...
First off- This video was very helpful! I am building a visual pinball controller and am using solenoids for haptic feedback. I built the circuit as you showed last night and everything worked great... with one small exception. As per your video description, there isn't a resistor between the arduino pin and the gate. I added a 100k resistor (closest I had to a 150k) and the circuit didn't seem to work. However, removing the resistor (like you have shown in the video) and everything seems to run great. How important is adding in a resistor between the arduino and the gate? Perhaps I installed it wrong or the 100k wasn't what is needed?
Awesome! I'm glad to hear it helped you out. You want a 150 ohm resistor, not 150,000 ohm resistor. ;)
@@MattInglot Doh! Of course! Thanks and I will do that. One more question.. I currently do not have a fuse installed either. Can that be any 3amp fuse or something? and do I just solder wires to both ends? Sorry- I'm still a bit new to hobby electronics (I know just enough to be dangerous)
@@eric3dee You want to size it to the load. You can calculate that, or measure the current the circuit actually draws with a multimeter. Then you want a fuse that's 1.25-1.5x that. I should add (and I don't think I mentioned this in the video), that a slow blow fuse is probably your best bet to avoid the sudden inrush current from blowing it.
Excellent and clear spoken diagrams explanations, without anoying music, easy to understand, many thanks for posting `! PLease explain how to retain the solenoid for 3 seconds ? Now its acting more like pulse latching
Thanks for sharing!
Humbly asking: how comes you fit a 3A fuse and a solenoid that will draw 2A on a breadboard that is probably not rated for those values? (At least you didnt mention the specs).
Thanks. You want the fuse to blow as a protection measure if the load on the circuit is higher than expected, which most likely means something has shorted out and will draw all the current the power supply can put out (until the supply's own fuse blows). So if we assume that solenoid was indeed 2A, you want something higher. I eyeballed 3A because it gives the margin of error, but should still blow if the circuit has a serious fault (again almost certainly a short because something got plugged in wrong or loose). The goal is protect the power supply and possibly prevent a fire if you're using a supply that can put out way more current than you need (think those DIY ATX ones without current limiting).
That said, fuses are complicated: th-cam.com/video/WG11rVcMOnY/w-d-xo.html
As for the breadboard: it was there to demo only, yes I should have pointed it out. Basically you might not get full power from your solenoid if you use a breadboard because of the high resistance it has.
Quick question if I wanted to run a solenoid that would ring a bell like a fire alarm how would I do that? Also being able to change the Hz frequency up and down to adjust the bell hits slower or faster. A variable power supply would be used so the voltage can be increased to make the bell hits harder and louder.
What a great question. You got me so curious about this that I looked up how those old school fire alarm bells work and you're not far off with your idea. I managed to find this article:
www.aplustopper.com/working-of-an-electric-bell/
It looks like these types of bells already use electromagnets to function (remember, that's really all a solenoid is...), and there are different ways of making that mechanism work. What I love about the one in that article is that it naturally creates the ringing by interrupting the circuit when it the hammer hits the bell, which allows it to retract back, which closes the circuit and activates the electromagnet, which brings the hammer back to the bell, and so on.
You could very easily swing a hammer with a solenoid in a similar way. Just have the hammer pivot on something, so that when the solenoid pulls down the hammer swings and hits the bell. You could then vary the frequency with how often you pull down the solenoid (eg. fire it once a second, twice a second, etc).
You are correct that you can control the strength of the hit by varying the voltage, however you don't need a variable power supply. If you're using an Arduino like in my example, just make sure you connect the solenoid to a PWM pin, then use Arduino PWM functionality to simulate the voltage change (eg. 50% PWM would effectively give you half the voltage). Note that you won't necessarily have a linear correlation between PWM frequency and volume so if you're building a volume knob or something you will have to experiment with how to map the PWM frequency to the desired volume.
Keep in mind that the purpose built fire bell mechanisms like the one I linked have a very small amount of travel, which allows them to ring at a (relatively) high frequency. If you buy an off the shelf solenoid, like the ones on Amazon, those things take a (relatively) long time to plunge back up after plunging down so that will limit the frequency.
That should really be it. Be sure to watch the video because that Arduino circuit is exactly what you need, and the rest is just building the mechanical piece.
Good luck!
How does one determine the size of the resistors and the type of.diode to use,. Can this design incorporate a break beam sensor
The resistor numbers aren't particularly critical in this case. About 10K from Gate to ground pulls the Gate down after the drive signal is released, and the 100 ohm from signal to Gate is just a little protection.
If the gate signal is being driven by a logic output, you may not need either of those resistors.
Hi, how did you connect the fuse ? Is soldering required? Thank you
There are fuses that already come with leads attached, and there are also fuse holders that will fit in a breadboard. That said, the breadboard is for experimentation and testing, but if you want something more permanent you *will* want to solder everything onto perfboard.
@@MattInglot Hi, its me again. I have troubles powering solenoid with Arduino. It seems there isnt enough power. I have 12V 2A power source. I dont use resistor on pin and gate to Arduino. What would happen if I changed 10k resistor for 1k?
hi, i bought some IRFP260Ns before watching this vid, and im having trouble getting the program to work. Im starting to worry that it might not be logic level capable, but i dont know how to find out for sure
Hey man, I also don't know much about circuits and am planning on making my own pinball machine, I'm going to use a 320w 48v power supply.
You said you was using a power supply too, I was wondering if you would be able to show that so I can see the full connections as I'm confused to where the wires that go off screen go too and where to power supply is connected too to power the solenoid,
Many thanks!
If you don't know much about electronics and are building a pinball machine then the good and bad news is that you will end up learning a lot about electronics ;)
Here are a couple good resources that include wiring up power supplies, I think these will be a lot more helpful a lot faster than me typing up the same info in a TH-cam comment:
mjrnet.org/pinscape/BuildGuideV2/BuildGuide.php?sid=powerSupplies
pinballmakers.com/wiki/index.php?title=Construction#Power_Supplies
Note that Pinball wiring and electronics can be dangerous (risk of shock from mains power, risk of fire from failing electronics). You may wish to get the proper training to work on some of this stuff, or partner up with someone who knows how to do it safely.
Good luck.
Can we make a solenoid which can lift around 5kg with the same pull push solenoid but with stroke length of 150mm
Of course you can. Whether it's practical or not is a different question. It's going to need to be a pretty big and powerful solenoid, especially if you're hooking the weight directly to the plunger because you've got no mechanical advantage. I have no idea what your application is, but there's a good chance you would be better served by something else like a servo motor which will be a fraction of the cost and size to lift 5kg (at the disadvantage of taking a lot longer to lift the load).
Please. What diode should I use for a 24 volt 2 amp solenoid? Thank you
Awesome video! Thanks for the details. I am currently trying to learn how to wire and code something similar, except I want to reduce the current at end of stroke using the PWM outputs on my control board. Ill look around your channel! I can hopefully find something because it's a head scratcher for me using a 2 pin solenoid. Basically just hoping to hold the solenoid (and flipper bat) in its extended position without burning out the coil. Thanks again!
Hello! I have a question.. I got my hands on a IRF520 module, can it do the work for me if I add a diode?
What solenoid shoild i use, planing to make a gear shifting mechanism for my motorcycle
good video I ask you a question is it possible to control an electromagnet through an arduino but using pulses instead of the classic turn off and turn on as if it were a led
Thanks. Yes you can build the exact circuit I show and just make sure to hook up the mosfet gate to a PWM enabled pin on the Arduino. Then you can use PWM to control the strength of the electromagnet.
hi.. i want to control 3 solenoid valves at the same time and connect the same to the water level indicator please help
Thanks for the clear explanation! Would it be possible to connect the Arduino as well as the solenoid to the same power supply (in parallel), such as a simple battery holder? Because that way the voltage comes straight from the source itself, instead of going through the Arduino first, while still connecting both grounds.
I don't see why not. Give it a shot and if you run into issues go down the troubleshooting rabbit hole until you figure it out. One thing I'd wonder about is voltage drop on the battery when firing the solenoid, and needing to throw some capacitors in to counteract that. I may play around with this one day with my scope hooked up, just haven't had a chance to do it. If I do it I'll make a video.
But for sure play around, have fun, see what you learn.
Thanks for the great explanation video.
From my limited understanding, the main danger I see here, is the danger of having an issue on the arduino side that leave the digital pin on for the solenoid. (Could be a programming error, or something that crash at the wrong time)
There is nothing then to shut it down and prevent it from over heating.
Yep. Mosfet could fail as well and cause the same issue. Something that does happen on pinball machines.
I'm going to try the middle circuit with a 12v 8A dc supply to power a 12v 8A solenoid, apart from changing to a bigger fuse do you think I need to change any other component on the circuit? :)
You'll want a bigger power supply than 8A for that. Breadboard won't work either, you'll need to solder or use appropriately rated connectors. Watch the gauge of your wires. Check every component to make sure it's rated (well above) 8A.
If you don't need to run off 12V, this sounds like a job better suited for 24V. You would need about half the current with the right solenoid. Might make your life easier.
@@MattInglot oh nice one! Ok well probably won't go that route then.
Actually I was thinking of using an airsoft lipo battery 2250mAh 11.1V and just using a 12v 8A solenoid to power it, what do you think?
I mean your solenoid looks quite powerful and that's just a 12v 2A one isn't it? I just need to add some recoil to a fake rifle really.
@@KobraVR cool idea. If the battery can supply 8A then sure, I don't see why not. Having lower voltage shouldnt be a problem (just slightly weaker). You will have to experiment to see what gives you a "good recoil". I bet if you look online you will find someone has already tried something like this and you can see what works (or why it doesnt work maybe)
@@MattInglot I think im going for an 11.1v lipo battery 2250mAh 35C to power a 12v 2A solenoid. That way I think I can pretty much your 2nd circuit and components without having to worry about changing things by much. I'll have to see if the 2A solenoid is powerful enough but yours looked pretty snappy in the video.
Thanks for getting back to me I'm excited to test things out! :)
@@MattInglot sorry to pick your brains a bit, if I used a 12v DC mains supply at 2A would that be OK to drive the 12V 2A solenoid? I'm a bit confused as you said for the 12v 8A solenoid I would need more than the 12V DC 8A mains to run it?
Hey Matt! Super solid video but I was wondering why you ended up switching the MOSFET in your final iteration from the first one. Would your circuit still work with the original MOSFET?
Hey Jason I do explain that in the video. The issue is if you want to use the MOSFET with an Arduino, you need to be able to switch the gate with the 5V output of the MOSFET. So I switched in a "logic level" mosfet that is capable of being driven with a lower voltage.
Hey, what's the largest push-pull solenoid you managed to find in Aliexpress?
Not very large! I've only found the small blue ones like you see in the vid. I got my big bois off Digikey. I'm sure there are other suppliers as well.
@@MattInglot That's a boomer. Thanks for the answer.
Hi there I need 12v small one that pushes when I turn power off
Hey Matt! This is excellent video of an introduction on using Solenoids for Arduino projects!
I do have a request on the other hand! Are you able to make a video on how to make a midi Solenoids instruments by using a Arduino and using a music program like fl studio or ableton to run the midi file onto a Solenoid?
i want to activate pin 8 via wifi. I found that the esp32 has a wifi function but i dont know how to hook it up to the arduino. Is there any simple tutorial for this?
An ESP 32 is also a micro controller, just like an Arduino. So if you want to "activate" something with ESP32, there shouldn't be a need to also involve an Arduino. Unfortunately helping you here is out of scope of the video but hopefully that clarifies things.
@@MattInglot thanks alot. I found a webserver scrip wich gives you the option to activate a pin, so i dont need any other code than that and the ciruit. But still without this video i wouldnt even think of anything like this! :)
Can a relay be used in place of a diode, resistor and transistor?
You could swap out the mosfet with a relay *module* pretty easily (the kind where it's a PCB with the relay and other components already on it and you can just hook it up directly with microcontroller). You can't swap all that just with a bare relay though, since there's a few components needed to drive a relay correctly with a microcontroller.
You also still want the diode to avoid damaging anything.
@@MattInglot thanks for the advice
Hi,
How could you make it to oscillate at a certain frequency (like ultrasonically) ? Would be an interesting idea to make an ultrasonic knife out of it.
Thanks ! 😇🤗
Best Regards,
You can certainly use Arduino to pulse it very very quickly and have some fun figuring out how fast you can make the solenoid go. BUT...
I doubt you'll get even close to ultrasonic. I looked it up and ultrasonic is considered above 20khz so let's assume you want to hit 20khz. That means that the solenoid plunger has to plunge and retract 20,000 times per second. That means each cycle of plunging and retracting has to happen in just 0.000050 seconds. That plunger needs to MOVE, and it can't move very far.
It would be interesting to see how fast you could get it moving if you start playing with the variables: I would try a very strong spring, and block the plunger from moving out all the way (maybe like 10% of the normal travel distance). That way it's always mostly inside the coil (much faster acceleration), and also doesn't have to travel very far.
@@MattInglot Wow ! Hey thanks again for the in-depth explanation. 😨😊👍👏
This really helped me understand how apply the use of a transistor!
Awesome, I'm so glad to hear :D
What is the third wire from the left doing (short black wire) at 12:39 ?
All the black wires go to ground. This one appears to be connected to the fuse. There is a schematic you can download in the video comments that may help.
@@MattInglot No, sorry, not the third _black_ wire, I meant the third wire *including* red. It's the third wire but the second black wire from the left. It's not connected to the fuse
@@dizzyrocket2000 ah ok! That one is just... chilling out. As you can see on the breadboard it's not connected to anything, so I think that was a leftover from one of the previous versions I showed, or something for easy testing. I must have missed removing it.
@@MattInglot Ok, thanks for clarifying 👍
Your channel is underrated :( you make great videos and only have a small amount of subscribers
Thanks kindly! I think it's my fault for being so slow with videos but yes please subscribe and more content will come :)
@@MattInglot will do! I have a suggestion for you though - you should make project tutorials and go really in depth with them. I’ll be starting to make some in the future when I can have my workbench spot finally, but until then, I gotta wait cause I can’t use any of my tools. People want to see things that they can make and copy. Also you can try to remake popular products!
@@realdenzity2144 Video on my dog collar light project is coming out soon. That's not too far from what you describe.
Hi Matt, great video! Quick question -- What is the voltage across breadboard 26e (or simply row 26) and row 21 when no voltage is supplied to the gate on the Mosfet (output pin 8 removed)?
I have more or less replicated what you have but am finding that when 0V is supplied to the Gate, the voltage on the load is still around 2V… when I supply 3V to the Gate, the voltage on the load is 12V as expected. Trying to understand why there is always 2V even when the Arduino is not supplying any output. Was expecting the voltage to be 0 or close to it. Thanks!
Hey Chris, it's been a while since I've played with this circuit but taking a quick look at my schematic again (which you can download in the video description by the way, may help to make sure everything is wired up right), I'm pretty sure it's because the load isn't part of a complete circuit when the Gate is pulled down to 0V. So you're getting some potential differences but they should be meaningless.
If you try to connect your meter in series with the load and measure current you can verify that nothing is happening.
All that said, if you're using two power supplies like I did in my project, make sure the GNDs of the supplies are tied together so that they agree on what 0V is. Or you will get all sorts of interesting measurements and very possibly damage the Arduino.
Good luck!
Please make a solenoid hole puncher. A strong enough one to make a hole in plastic aswell.
Haha! That would be interesting to try. And to compare using solenoids vs servo motors for this. I'm not really convinced that the solenoid's ability to deliver energy rapidly is very beneficial here. Compare that to a servo which would operate more slowly, but can leverage tremendous mechanical advantage.
Thank you so much for the video. Can we control pneumatic solenoid only with arduino and relay
This is exactly the video I needed for my project. Thanks!! 🙏
Awesome! What are you building?
@@MattInglot On my channel I recently built a flip top tool cart. I am trying to automate the flipping of the cart. I am going to use solenoids as the locking mechanism.
@@FirthFabrications Cool! That sounds like a great use for one.
can i use the same technique to control automotive solenoid valve?
Generally speaking any DC solenoid, including DC solenoid valves, should work. However you need to make sure you pick components suitable for your application, and if this is something that will impact the ability of the car to function or could otherwise damage property/cause injury then you really need to speak to a professional versed in what you are trying to do. All the considerations there (such as even proper choice of wiring) is beyond this video.
@@MattInglot thanks matt
I wanted to use these on my diy drywasher, but seems like they were too small for my project. I wanted to hang a shaker table from the solenoids and turn solenoids on and off at high frequency to create vibration, by liftingthe table up and down. But looks like the shaker table is too heavy for them to work properly. I used 6v and 12 v ,but 12v solenoid was too weak and i connected 12v source to the other 6v solenoid and it heated up very fast ,but I was able to get some motion, but my ampmeter showed 6amps. So 6×12=72 watts. This got me confused, because I thought instead using a motor hanging the table from solenoids will be more efficient ,but looks like it's not... not sure
Solenoids are great for short bursts of motion or force. Something like continuous vibration can be done of course, but feels like barking up the wrong tree. At minimum you will need a much stronger solenoid as you've found out.
A big problem is that you can get much better performance out of a solenoid if it doesn't need to be continuously operating. You experienced this with your 12V to 6V solenoid experiment. If you had an application where that solenoid had to impart a lot of power but fire infrequently, using it this way would be totally legit.
@@MattInglot probably I'll just use a motor attached to the center with off balance weight to make vibration. It seems to be more efficient.
hi and thank you...i'm not sure if i'm seeing this wrong, having trouble following the breadboard wiring...the flyback diode should t not be in parallel to the solenoid? also the fuse should it not be on the input rather than the output?
The diode polarity should be opposite that of the solenoid, else you basically create a short (sorry I THINK that's what you are asking). As for the fuse, take a look at the schematic posted in the description. When the fuse pops, does it create an open circuit?
I'm looking at these to activate a pull pin on a rc 1/10 winch can I just hook up the positive to a switch turn on stays pulled in until switch is turned off then springs back then opersite way wind winch in 🤔
How did you decide what resistors to use? Was it decided arbitrarily?
EDIT: TIT I put 2 as the initial value not 20 in the code Lol works great thanks so much!
Hi so I did get round to building this circuit, almost identical to yours but I only have IRL540N mosfet so I ordered the logic level one you have, waiting for that. In the mean time though when I power the circuit on it pulses but very weak, far too weak to move the solenoid, it's like a buzz noise each tick thats all. Is this due to the wrong type of Mosfet do you think? The 12v dc 3A supply is ample to throw the solenoid when I just hook it up directly. This breadboard seems to suck the life out of it though, I have an ammeter which part would be best to check?
If you are too busy to answer don't worry and thanks again for the ace video!
Haha that would do it! Nice work!
@@MattInglot thanks I love it! I was wondering if I could hook up a 24v power supply with a larger solenoid with exact same layout would that do without switching any components do you think? 🤔
@@KobraVR As long as all your components are rated for it (preferably with some margin of safety) then that's totally fine. One thing to pay attention to in addition to voltage is current. Make sure you're in spec on everything there (that goes for whatever solenoid you're using, regardless of voltage). Breadboards in particular can't handle much current (I was probably pushing it with my demo) so if you're having issues then soldering it together on a perf board would be the better idea.
@@MattInglot Matt that's really helpful thanks. One last thing (like Columbo!) something I just noticed which is really bloody odd...I only seem to be having 6v through the solenoid? Its 12v DC 3A supply. I hooked it up just like yours the only thing that is different is I am not using a logic level mosfet (they are on order). Is it possible that mosfet is doing some kind of voltage divider thing with my circuit? It seems too convenient to be around 6v you know?
@@KobraVR it's honestly too hard to try to debug people's circuits over YT comments, but you have some good ideas. Putting in a logic level MOSFET would be a good start.
that helped a lot... i am also on a pinball project... the issue where i am from is its difficult to get high power solenoids... have you tried using high speed servos instead?
I hear you on the solenoids being a pain to source - I think it's largely because pinball has relatively niche and unusual requirements vs the way solenoids are normally used. I haven't tried servos specifically. I did try car lock actuators which *sort of* worked, and you can find a video somewhere on YT of someone having done this, but I never got satisfactory force and kind of expected they would fail quickly since no one expects car door locks to be actuated many times a minute for potentially hours at a time.
Rather than speculating on something I haven't tried, I'll suggest you try it in the name of science and let us know what happens! Would be fun to know and even if it fails there's always something to learn. Alternatively you can get more creative with finding the solenoids. For example you could use actual pinball mechanisms - you can buy those parts new or strip down an existing machine that's in bad shape/cheap.
Matt Inglot thanks Matt for your suggestions.. I'm right now in Dubai and pinball isn't popular here at all.. Sourcing has become almost impossible due to the curfew... Lemme try with the servos in the name of science 🤪.. Will keep you posted
@@4seekers719 Look forward to hearing about your results!
you deserve more subs my man
Thanks I appreciate it :)
How to reduce solenoid load current using pwm?
Can you post a video for controlling solenoid with a wireless remote please ?
If your 2nd power supply is 24VAC vs. your Arduino's 5VDC, do you still wire the grounds together? Or will that cook your board?
The circuit demonstrated only works with DC. You can't directly control AC with a mosfet. Your best and simplest bet if you don't need PWM control over the solenoid is to use a relay module. If done right, that will have the added benefit of isolating the two supplies. There are videos by other people on YT that demonstrate how to do this with a relay. Good luck!
@@MattInglot Thank you. I was using garbage cheap relay boards from Ebay. They backfed noise all through my setup and reset the board with each firing of the solenoids. I tried better (branded) relay boards and everything is working great now. My trees will finally get consistent water!
@@drsnooz8112 sounds like they may have been missing a flyback diode. That's also why a board, rather than just a bare relay, is important (in case anyone else is reading this). You can't just connect the Arduino directly to the relay and expect it to work reliably. There are nuances to controlling relays. Glad your plant watering system is working.
Hey Matt great video!! I found this video through search and I’m looking to build a project using a sollinoid. I saw that you have a fairly new channel so I thought I’d help you out with a comment, like, and a new subscriber! Great job man!
Thanks so much that's really awesome of you. What is your project?
this is an incredibly dumb question but what is that blue box thing with two screws in it that goes up to the power supply?
sorry for my stupidity
No worries, it's tricky when you don't know the name of something! This is a screw terminal, I'm just using it to connect the positive and negative wires from my power supply to the bread board. All it does.
@@MattInglot thank you so much
@@MattInglot Also, how did you get the glass fuse to fit into the breadboard? I can't seem to find any like that
@@jonathansiskind8315 If you search glass fuse with axial leads you should find them. Or get fuse holders which are actually the better solution for anything more permanent.
@@MattInglot thanks man! you're a godsend
Hello sir, I am curious about how you obtain the power supply 12V. Did you use transformer to step down the voltage? Thank you 😊
Just a 12V power adapter. Those black bricks that you can buy off Amazon for example. I did not build my own if that's what your asking.
what kind of power sorce are you using? how much volt?
I was using a 12V supply for the solenoid but that will vary depending on the solenoid you choose. For the Arduino it's 5V.
so couldn't you just use a 12v LED( light emitting Diode) instead of the rectifying diode?
Since all that it is doing is stopping the voltage from back feeding.
If thats possible to use an LED. Then I assume just use it like normal that when you push the button the LED will turn on, while also stopping the reverse flow of electricity?
As an experiment to see if you can catch it lighting up when power is stopped? Sure, give it a try and let us know what happens.
As a practical thing? It's not something you'd want to do. Regular diodes are cheaper and actually meant for this purpose.
Stuff that could be a problem with using LEDs:
- LEDs have very low current limits. You could burn it out either immediately or over time.
- LEDs have fairly low reverse voltage, so that could be a problem very quickly, and if you hit that threshold then you'll probably burn out the LED instantenously.
- You mention a 12V LED, so that implies several LEDs in series to get 12V. I have NO idea how that affects the scenario and would love to find out. Alas I think it means nothing good :D
Give it a try and let us know!
How can I use the circuit paired with the Arduino with a NC microswitch as a trigger, where pressing the switch runs the code to the solenoid
NO( normally open
@@bananasplit4037 You should be able to find tutorials very easily on how to detect switch presses on Arduino, along with sample code. Then all you need is logic in your code that checks if the switch is pressed, then triggers the solenoid.
Great explanation, really liked the video
Thanks so much!
Is there any way to adjust the speed? Springs? Weights?
You should be able to adjust the strength of it by attaching it a PWM-capable pin on Arduino and using analogWrite. A stronger spring would do this to some extent as well. Note that no matter what you do, this thing will fire in a fraction of a second so if you're talking speed as in you slowly want it to depress down then this would not be a good component to use. You would be looking at a servo or stepper motor, both of which are capable of much slower movement.
@@MattInglot Ah ok. Thanks!
yoo do you know if i can use an LED instead of a diode?
An LED is a diode, but it's not a diode that has the right specifications to make it an effective fly back diode. For example, most LEDs have a pretty low reverse voltage (let's say 5v). Since the flyback diode is wired in reverse, it means that reverse voltage is very important because let's say it's a 12V solenoid, you've gone far past the reverse voltage and blown up your LED.
Always easier to learn by doing though and LEDs are cheap, so experiment with it, blow up a few, and see what happens!
Awesome! Thanks for the step by step. Also, do you have labelled circuit diagrams?
Working on it :)
@@MattInglot Can you send me the labelled circuit diagram? Thanks! And really great work here with the project and the teaching skills!!
@@edfl4913 It's there in the video description.
Is this solved with a relay?
Hi Matt, I hope your pinball project went well!
I'm about to follow this project as part of my University final year project but can't find out what the components you have used are. What's the name of the blue piece that takes the power supply? And how have you exposed 2 wires from the power supply also? I have a 12v power lead with the regular power jack which without changes cannot be used to power the breadboard. The solenoid I am using is also 12v.
If you Google "screw terminal block" you should be able to find them. Or if your power supply already has a different connector (sounds like a barrel jack most likely), then you could get the female barrel jack connector for your breadboard and use that. That will actually be a more reliable connection if you're trying to build something more permanent.
I have a question. I bought 12V/2A solenoid and have 8 AA batteries to provide 12V. Can I connect batteries directly to solenoid and solenoid will only pull max 2A as its designed, or will it take all the power it can causing it to overheat. Would I need to put some resistors on the batteries first or just directly 12V to solenoid would be fine?
A power source being able to supply MORE current than your load needs is not a problem. The solenoid has a certain resistance, which in turn determines how much current it will draw thanks to Ohm's law. So the load determines the current drawn, not the supply.
Of course you're probably asking this because you've seen resistors being a requirement for using LEDs, because otherwise the LED WILL blow itself up very quickly. That's because diodes (including LEDs) have very little internal resistance and will happily burn themselves out immediately without a resistor to limit the current. So if you hook up your LED without a resistor, you have a load with very little resistance and hence it will draw a lot of current (again Ohm's law comes into the picture), and the LED will blow up.
Your problem might be that 2A is a lot of current for a AA battery. You can actually look up datasheets for batteries and see what that looks like, but 2A seems like a lot. At the very least I would expect it to discharge quickly. THAT said, if you are only pulsing the solenoid for short periods, it may be totally fine and you may still get adequate performance.