Absolutely best desciption on Arduino and solenoids. I've been confused reading tutorials but you're video was the one that made it finally click for me. Thanks very much for sharing.
Thank you for this video. It would be great if you could do a similar one here. Its for a arcade gun recoil. After watching your video I wonder if it requires a diode. Maybe you could show us how you would make this. “The Ne555 boards are easy to hook up. They only have 3 pins. You have 5v and ground in which you'll take from the UHID. Then ground out and power out. Power out is the 3rd pin. Ground out shares the middle pin with ground in. I.e. you have two wires connected to one pin for ground. The output from the Ne555 board goes to a DC DC solid state relay. You should have one that can be triggered by as little as 3v. Connect ground out (from the ne555) to - and ne555 power output to +. At this point you should be able to activate the solid state relay by pressing the trigger or whatever button you have hooked up to the UHID (one that is set to trigger 5v on your chosen pin). Connect one of the wires from your solenoid power supply to one of the output pins on the relay. The other one goes to the solenoid. I usually have the relay connect the - and have the + from my 24v psu go directly to the solenoid. You can try it the other way if you want (or need) to. Then it's just a case of adjusting the two pots on the ne555 until the full auto feel is to your liking. The solenoid should be triggered 7-14 times per second to feel authentic th-cam.com/video/8gx00X9qgzM/w-d-xo.html
Hi , Thank you for the video, i have a question, if we are hier using the VIN Pin (12V) can we get rid of the 5v (red one ) or what is hier the role of the 5V Pin
Great video! Very clear instructions. Quick semi-related question about power supply: Assuming it's the correct voltage for the solenoid I'm using ... can I hack apart my old laptop power supply by snipping off the cylindrical plug at the end (the part that would plug into the laptop)? Would that reveal the hot/ground wires needed to work with the breadboard? (I suppose I should just bite the bullet and try it myself, but I'm too nervous to ruin the power supply, lol.) Thanks again!
Yes, that should work as long as the voltage is correct. The ground wire may present itself as a braided shield around the outside, but you should be able to connect it to a leaf wire using solder and some shrink tubing for insulation.
Yes, that should work as long as the voltage is correct. The ground wire may present itself as a braided shield around the outside, but you should be able to connect it to a leaf wire using solder and some shrink tubing for insulation.
Yes, that should work as long as the voltage is correct. The ground wire may present itself as a braided shield around the outside, but you should be able to connect it to a leaf wire using solder and some shrink tubing for insulation.
Yes, that should work as long as the voltage is correct. The ground wire may present itself as a braided shield around the outside, but you should be able to connect it to a leaf wire using solder and some shrink tubing for insulation.
Yes, that should work as long as the voltage is correct. The ground wire may present itself as a braided shield around the outside, but you should be able to connect it to a leaf wire using solder and some shrink tubing for insulation.
Hi, iam using a solenoid valve (5v), and i want to use this method i think it should work, the only difference is the 12v power supply that i dont need it because the arduino can work with 5v, now my question is to control the valve like you did (on & of) i should do the exact thing that you did just without using the power supply is that right?
You would still need a 12 volt power supply to power the solenoid. 5volts is probably not enough. Check the specs for your solenoid to know what power it requires.
@@jpconn1 Hi Jim, i found the same circuit that been used in the video without the 12v power supply and with a 5v solenoid, the only difference is that he used another value of the diode and the transistor.. ( core-electronics.com.au/tutorials/solenoid-control-with-arduino.html)
@@hamzi586 For an application like this there are a bunch of different transistors and diodes that would work. The same idea applies; using a small voltage to switch a higher voltage through a transistor. If your solenoid is 5V, I'm not really sure why you need the transistor.
For this particular application a relay would work just as well. The benefit to using a transistor is the speed at which it can be switched, the smaller form factor, the quietness of the switching operation, and the durability of the transistor over the relay due to not having any moving parts.
Would this work with a 12v 5-2 solenoid valve that connects to a larger pneumatic cylinder and an air compressor. Would I just neee a different transmitter
Question, I would like the solenoid to open/close repeatedly every half second or so when I press a button. Can I simply add a micro switch into the circuit to the 5v +/-? As note the solenoid will be powered @ 10v using a dc power adapter via the VIN.
Yes, this should work, although I would prefer to control the solenoid through the code. You would need to just condition the opening and closing of the solenoid by reading the state of the button. I have a separate video that explains how to use switches and buttons with the Arduino.
I'm confused, what is the 5v from the arduino connecting to? I see you have it going to the rail but there's nothing else connecting to the rail.??? please answer
I have a much larger solenoid and when plugged into a similar circuit the solenoid stays on, not caring about the transistor and the transistor rapidly heats up, is there a way around this?
Next question - why is the transistor tied into the negative side of the solenoid rather than the positive? Also, why is the resistor needed? I saw another video that did not use one.
Its really a great explaination! I have a question.. if i have to actuate 2 or more solenoids, connections would be the same? and if yes can i give Vin supply to other diodes too?? offcourse i will be using buck converter for regulating the voltage..
Sure, you can activate almost as many as you want as long as you have enough current(amps) from your power supply and enough digital pins on the Arduino to switch the transistors. I'm not sure why you would want to power any diodes from the VIN since that would be 12V. If you are talking about Light Emitting Diodes (LEDS) you would only want about 1 - 3 volts depending on the diode. These would be more easily powered by the Output pins on the Arduino. You could certainly power them from VIN, which is essentially directly from your power supply, and regulate the voltage through a buck converter and your only limitation would be the current(AMPS) supplied by your power supply.
Without a Barrel Jack you would need to connect your 12V power supply to the VIN Pin(Positive) and the Ground Pin. This will power the Arduino, the Arduino will convert the 12V from the Barrel Jack to 5V needed by the board. In this setup, you could also follow the instructions just as they are and hook up the solenoid and transistor through the VIN pin, but it is probably easier to just connect it directly to the power supply or 12V rail.
Wait, isn't the stripe on the diode indicate the cathode? I searched for that specific diode that you have and indeed the stripe indicates the cathode. Was it different back then?
@@DIYTechGuyShow ok, actually I am doing a circuit that is 12V, 2A solenoid lock control through RFID, I am doing it through the H-bridge circuit, but my output is not coming. can you help me out with this?
I want to use 5v solenoid in a control circuit of an air mattress , should i connect the solenoid directly to the ardunio ? And does the 5v solenoid even work for such circuit?
the solenoid should be connected through a transistor, even if you have a 5v solenoid, powering from the Arduino will pull way too much current. I also doubt a 5v solenoid would be able to operate a valve. The biggest thing I have been able to do with a 5V solenoid is to ring one of those hotel bells.
I have a separate video that explains how to use buttons. The button video shows how to control an LED using a button. To apply it to the transistor example you would run the 5V to the transistor signal pin instead of the LED. Here is a link to the video. th-cam.com/video/skUlztFyJac/w-d-xo.html
hi i have an output of 1.8v 200ms low. during this time I want to de-energise a 3v relay can I use the transistor to switch off BCS the 200ms not enough to de-energise the 3v relay
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?
I have never seen a push/pull solenoid. They are usually just push or pull. The reverse direction is handled by a spring. A solenoid that pushed and pulled would actually be 2 solenoids working together to give force in either direction.
I don't think you can control an AC solenoid through a transistor. A simple solution to get around this would be to use a DC relay to control the AC current. I have a separate video explaining how to do this. studio.th-cam.com/users/videoKlxFC89gqpk/edit In that video I control a 120V lightbulb, but you could use the same design and relays to control 230V.
Sure, you could just wire the battery to the solenoid through a pushbutton. This would allow you to simply control the solenoid manually. The Arduino allows you to programmatically control the solenoid. In this case we have a timer that activates the solenoid on a repeating basis, but it could also be used to read input from the environment and activate the solenoid based on those external inputs.
12V would burn up the solenoid. You might be okay for short bursts, but you definitely wouldn't want to use it in an application where power is continuously applied.
You could use a larger solenoid and possibly some type of lever mechanism to translate the 1 inch throw of the solenoid to something 2 to 3 times greater.
Of Course. I use a breadboard only for demonstration purposes. You could certainly wire and solder everything directly, but I would suggest soldering to a protoboard for stability and ease of installation into a project box or something.
No, not in this project. I imagine it would If I had more current running through the transistor. In cases like that, you would want to attach the tab of the transistor to a larger heatsink using some thermal compound.
Forgive my rookie question (i'm not trained on electronics but can follow instructions). I don't have an IN4001 diode but I have some others. Can I substitute an IN4007?
Yes, that should work. You'll know something is wrong if the Arduino resets itself when the solenoid fires. I always add some code to blink an LED a few time during initialization, that way it is very clear that the Arduino is resetting.
I'm not familiar with those boards, but I would assume you would tie it in directly from the power supply. I sort of cheated a bit by using the VIN pin, since I know it connected to the positive side of the barrel jack. The VIN pin is actually supposed to be used to power the board when you don't have a barrel jack or if you wanted to position the barrel jack on the outside of the case or something.
Yes, you can connect as many solenoids as you have digital pins, just use a different pin for each solenoid or group of solenoids that you want to independently control. You will need a power supply large enough for all 6 solenoids if they will be used simultaneously.
Will it not upload or not compile. The upload button actually does both, compiles, then uploads. If it won't compile, your issue is somewhere in your code. If it won't upload, there are a few issues that could be causing this. 1st is a bad Arduino Board, 2nd is if the wrong board is chosen under the Tools Menu, this needs to match the board you are using (Arduino Nano, Arduino Uno, etc.). The Processor chosen under the Tools menu could also be an issue, Uno should be one of the ATMega 328, and the Nano would be one of the ATmega 128. The Programmer chosen might also cause upload issues, I currently have mine set for AVRISP mkII. I hope this helps, please respond with whatever it is that fixes your issue.
@@DIYTechGuyShow so I went to tools your and right the board was the wrong selection. I am using a Mega 2560 so I selected that and it ran the code but the solenoid did not open (its and old solenoid I took out of an old appliance so could be siezed shut). I am also using a TIP 121 transistor. Besides that everything is identical. Thank you for your help by the way. Im a Mechanical engineerinf student and its so hard to find people who know what they are doing when it comes to arduino.
@@c.moh8842 well, the first thing you should check is to make sure the solenoid is functional, the easiest way to do that is to just connect it directly to the power supply and see if it activates. If it doesn’t, it is probably a bad solenoid or more likely you aren’t providing enough current. Voltage and current are very different and I this scenario you wouldn’t be able to operate a moderate sized solenoid with 8 aaa batteries. Even though you have. 12 volts, the aaa batteries won’t provide the current(amps) required. You would generally need a larger power supply the size of a laptop charger maybe. It’s tough when pulling parts from existing products to truly know the specs, but you can always hook up a larger amperage power supply, NOT VOLTAGE, just to make sure it works.
@@DIYTechGuyShow Yes i think you are right, its not getting the correct amount of current through the coild. Can you recommend a 12v solenoid that would work through arduino? I can get my hands on a 12v - 300mA valve. Would this work?
Any 12V solenoid will work using the Arduino, you just need a large enough 12V power supply. You just need to power the solenoid separately and just use the Arduino and Transistor to switch the ground connection. The limitation is not the Arduino, it is your power supply that is the limitation.
Good Question, not sure how I missed this in the diagram. You use a 12V power supply to power the arduino through the barrel jack. The Arduino brings this down to 5V to power the arduino logic, but still provides the full 12V power to the VIN pin on the arduino. You can see this with the purple wire that powers the Solenioid.
I used a TIP102 transistor, but almost any NPN transistor could have worked for this application. The TIP102 has a max current of 8 amps which is overkill for this project, but I just happen to have a few extra ones lying around. You can see the full datasheet on the TIP102 here: www.utmel.com/components/tip102-npn-transistor-datasheet-pinout-and-application?id=799
The Arduino can't output 12V through it's controlled pins. I just connected the solenoid to the 12V on the input side of the Arduino. The Arduino can accept 12V, but it steps it down to the usable 5V for the processor. The VIN Pin is connected to the barrel jack connecter prior to the step down in voltage. The reason for this is that the Arduino can be powered from either the Barrel Jack or the VIN and GND pins. By connecting my Solenoid to the VIN pin I eliminated the need to splice the incoming wire going to the barrel jack.
Absolutely best desciption on Arduino and solenoids. I've been confused reading tutorials but you're video was the one that made it finally click for me. Thanks very much for sharing.
Great video, super clean control. Thank you so much!
Thanks, it works! Greetings from Gdynia Maritime University!
Great video! Thank you for helping me understand how to use a solenoid. Your video was clear, quick, and understable.
I tried two other tutorials on youtube to no avail. This worked in an instant! Thank you!
Glad it helped!
Thank you for this video. It would be great if you could do a similar one here. Its for a arcade gun recoil. After watching your video I wonder if it requires a diode. Maybe you could show us how you would make this.
“The Ne555 boards are easy to hook up. They only have 3 pins.
You have 5v and ground in which you'll take from the UHID. Then ground out and power out. Power out is the 3rd pin. Ground out shares the middle pin with ground in. I.e. you have two wires connected to one pin for ground.
The output from the Ne555 board goes to a DC DC solid state relay. You should have one that can be triggered by as little as 3v.
Connect ground out (from the ne555) to - and ne555 power output to +. At this point you should be able to activate the solid state relay by pressing the trigger or whatever button you have hooked up to the UHID (one that is set to trigger 5v on your chosen pin).
Connect one of the wires from your solenoid power supply to one of the output pins on the relay. The other one goes to the solenoid. I usually have the relay connect the - and have the + from my 24v psu go directly to the solenoid. You can try it the other way if you want (or need) to.
Then it's just a case of adjusting the two pots on the ne555 until the full auto feel is to your liking.
The solenoid should be triggered 7-14 times per second to feel authentic
th-cam.com/video/8gx00X9qgzM/w-d-xo.html
Hi , Thank you for the video, i have a question, if we are hier using the VIN Pin (12V) can we get rid of the 5v (red one ) or what is hier the role of the 5V Pin
Great video! Very clear instructions. Quick semi-related question about power supply: Assuming it's the correct voltage for the solenoid I'm using ... can I hack apart my old laptop power supply by snipping off the cylindrical plug at the end (the part that would plug into the laptop)? Would that reveal the hot/ground wires needed to work with the breadboard? (I suppose I should just bite the bullet and try it myself, but I'm too nervous to ruin the power supply, lol.) Thanks again!
Yes, that should work as long as the voltage is correct. The ground wire may present itself as a braided shield around the outside, but you should be able to connect it to a leaf wire using solder and some shrink tubing for insulation.
Yes, that should work as long as the voltage is correct. The ground wire may present itself as a braided shield around the outside, but you should be able to connect it to a leaf wire using solder and some shrink tubing for insulation.
Yes, that should work as long as the voltage is correct. The ground wire may present itself as a braided shield around the outside, but you should be able to connect it to a leaf wire using solder and some shrink tubing for insulation.
Yes, that should work as long as the voltage is correct. The ground wire may present itself as a braided shield around the outside, but you should be able to connect it to a leaf wire using solder and some shrink tubing for insulation.
Yes, that should work as long as the voltage is correct. The ground wire may present itself as a braided shield around the outside, but you should be able to connect it to a leaf wire using solder and some shrink tubing for insulation.
Thank you for the great helps on Arduino controls solenoid.
im confused where did you use the external power source
Hi, iam using a solenoid valve (5v), and i want to use this method i think it should work, the only difference is the 12v power supply that i dont need it because the arduino can work with 5v, now my question is to control the valve like you did (on & of) i should do the exact thing that you did just without using the power supply is that right?
You would still need a 12 volt power supply to power the solenoid. 5volts is probably not enough. Check the specs for your solenoid to know what power it requires.
@@jpconn1 Hi Jim, i found the same circuit that been used in the video without the 12v power supply and with a 5v solenoid, the only difference is that he used another value of the diode and the transistor.. ( core-electronics.com.au/tutorials/solenoid-control-with-arduino.html)
@@hamzi586 For an application like this there are a bunch of different transistors and diodes that would work. The same idea applies; using a small voltage to switch a higher voltage through a transistor. If your solenoid is 5V, I'm not really sure why you need the transistor.
Great video! Quick question, why would someone use this transistor method over a 5v relay module? Thanks
For this particular application a relay would work just as well. The benefit to using a transistor is the speed at which it can be switched, the smaller form factor, the quietness of the switching operation, and the durability of the transistor over the relay due to not having any moving parts.
yeaahh you helped us really well, thanks for the video man!!!
Would this work with a 12v 5-2 solenoid valve that connects to a larger pneumatic cylinder and an air compressor. Would I just neee a different transmitter
@@nathanaelculak7541 sure works just fine
Question, I would like the solenoid to open/close repeatedly every half second or so when I press a button. Can I simply add a micro switch into the circuit to the 5v +/-? As note the solenoid will be powered @ 10v using a dc power adapter via the VIN.
Yes, this should work, although I would prefer to control the solenoid through the code. You would need to just condition the opening and closing of the solenoid by reading the state of the button. I have a separate video that explains how to use switches and buttons with the Arduino.
Question: Can I use solenoid for a water despenser that will automatically stop when a cup is about to get full?
I'm confused, what is the 5v from the arduino connecting to? I see you have it going to the rail but there's nothing else connecting to the rail.??? please answer
Yea I noticed that too and got me confused. It looks like an open circuit with nothing connecting to the positive on the board.
I have a much larger solenoid and when plugged into a similar circuit the solenoid stays on, not caring about the transistor and the transistor rapidly heats up, is there a way around this?
Great video. Thanks for sharing.
A year on but could you wire up a switch to turn off and on the solenoid
I want to ask you if I don’t have TIP102 Transistor which other type I can use?
Next question - why is the transistor tied into the negative side of the solenoid rather than the positive?
Also, why is the resistor needed? I saw another video that did not use one.
Its really a great explaination! I have a question.. if i have to actuate 2 or more solenoids, connections would be the same? and if yes can i give Vin supply to other diodes too?? offcourse i will be using buck converter for regulating the voltage..
Sure, you can activate almost as many as you want as long as you have enough current(amps) from your power supply and enough digital pins on the Arduino to switch the transistors. I'm not sure why you would want to power any diodes from the VIN since that would be 12V. If you are talking about Light Emitting Diodes (LEDS) you would only want about 1 - 3 volts depending on the diode. These would be more easily powered by the Output pins on the Arduino. You could certainly power them from VIN, which is essentially directly from your power supply, and regulate the voltage through a buck converter and your only limitation would be the current(AMPS) supplied by your power supply.
@@DIYTechGuyShow ok I am clear now. thanks for ur reply 👍
How would this work if I was using a board that didn't have a Barrel Jack?. Could I just plug the V+ of the solenoid into a common 12v rail?
Without a Barrel Jack you would need to connect your 12V power supply to the VIN Pin(Positive) and the Ground Pin. This will power the Arduino, the Arduino will convert the 12V from the Barrel Jack to 5V needed by the board. In this setup, you could also follow the instructions just as they are and hook up the solenoid and transistor through the VIN pin, but it is probably easier to just connect it directly to the power supply or 12V rail.
Wait, isn't the stripe on the diode indicate the cathode? I searched for that specific diode that you have and indeed the stripe indicates the cathode. Was it different back then?
I'm confused, what is the 5v from the arduino connecting to? I see you have it going to the rail but there's nothing else connecting to the rail.
Yes, that Cable is unnecessary... it leads to Nirvana :-)
Nice info, thanks for sharing it :)
hello is this lock is working on Positive and Negative Pulse.
No, It is a simple solenoid that works off of the current from the power supply.
@@DIYTechGuyShow ok, actually I am doing a circuit that is 12V, 2A solenoid lock control through RFID, I am doing it through the H-bridge circuit, but my output is not coming. can you help me out with this?
I want to use 5v solenoid in a control circuit of an air mattress , should i connect the solenoid directly to the ardunio ?
And does the 5v solenoid even work for such circuit?
the solenoid should be connected through a transistor, even if you have a 5v solenoid, powering from the Arduino will pull way too much current. I also doubt a 5v solenoid would be able to operate a valve. The biggest thing I have been able to do with a 5V solenoid is to ring one of those hotel bells.
Could you explain how you would add a button to this setup?
I have a separate video that explains how to use buttons. The button video shows how to control an LED using a button. To apply it to the transistor example you would run the 5V to the transistor signal pin instead of the LED. Here is a link to the video. th-cam.com/video/skUlztFyJac/w-d-xo.html
@@DIYTechGuyShow Thank you.
hi i have an output of 1.8v 200ms low. during this time I want to de-energise a 3v relay can I use the transistor to switch off BCS the 200ms not enough to de-energise the 3v relay
can i use IRLZ34N MOSFET instead of TIP102 transistor does it also work with DC 12v solenoid valve???
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?
I have never seen a push/pull solenoid. They are usually just push or pull. The reverse direction is handled by a spring. A solenoid that pushed and pulled would actually be 2 solenoids working together to give force in either direction.
IN4001 diode works with 5VDC.
How to connect 230VAC solenoid? I have these controller reset effects..
I don't think you can control an AC solenoid through a transistor. A simple solution to get around this would be to use a DC relay to control the AC current. I have a separate video explaining how to do this. studio.th-cam.com/users/videoKlxFC89gqpk/edit In that video I control a 120V lightbulb, but you could use the same design and relays to control 230V.
Could you do this same circuit without the arduino? Just with the push button, and the other components?
Sure, you could just wire the battery to the solenoid through a pushbutton. This would allow you to simply control the solenoid manually. The Arduino allows you to programmatically control the solenoid. In this case we have a timer that activates the solenoid on a repeating basis, but it could also be used to read input from the environment and activate the solenoid based on those external inputs.
Sir can u please explain how do i connect 2 solenoid valves , in the same setup.
Question. Will it be okay if i use a 12v adapter with a 6v solenoid?
12V would burn up the solenoid. You might be okay for short bursts, but you definitely wouldn't want to use it in an application where power is continuously applied.
Hello Sir .. we would like to use solenoid as shooting mechanism in small robot .. which way do you suggest to improve the return Force?
You could use a larger solenoid and possibly some type of lever mechanism to translate the 1 inch throw of the solenoid to something 2 to 3 times greater.
How do I simulate solenoid valve in proteus program?
is it possible to control 2 or more solenoids with just 1 arduino, like can i add another solenoid in your demonstration?
This shouldn't be a problem at all, the limiting factor will be your power supply and whether is can handle the current load.
do we really have to use that transistor?
Is it possible to do this without that bread board?
Of Course. I use a breadboard only for demonstration purposes. You could certainly wire and solder everything directly, but I would suggest soldering to a protoboard for stability and ease of installation into a project box or something.
Does your heatsink on your transistor get super hot quickly during this?
No, not in this project. I imagine it would If I had more current running through the transistor. In cases like that, you would want to attach the tab of the transistor to a larger heatsink using some thermal compound.
Forgive my rookie question (i'm not trained on electronics but can follow instructions). I don't have an IN4001 diode but I have some others. Can I substitute an IN4007?
Yes, that should work. You'll know something is wrong if the Arduino resets itself when the solenoid fires. I always add some code to blink an LED a few time during initialization, that way it is very clear that the Arduino is resetting.
For trinket and trinket pro, how do I power the 12 v solenoid
I'm not familiar with those boards, but I would assume you would tie it in directly from the power supply. I sort of cheated a bit by using the VIN pin, since I know it connected to the positive side of the barrel jack. The VIN pin is actually supposed to be used to power the board when you don't have a barrel jack or if you wanted to position the barrel jack on the outside of the case or something.
You don't need to connect a wire from the Arduino 5V to the breadboard. It's not being used at all.
Yes, good point. since the transistor is getting it's 5v from the pin, there is no need to power the rail.
can we connect 6 solenoids with arduino uno
Yes, you can connect as many solenoids as you have digital pins, just use a different pin for each solenoid or group of solenoids that you want to independently control. You will need a power supply large enough for all 6 solenoids if they will be used simultaneously.
Hello Tech guy. I am trying to get this working for a college project. The code will not upload and its the xact same as your code. Any ideas?
Will it not upload or not compile. The upload button actually does both, compiles, then uploads. If it won't compile, your issue is somewhere in your code. If it won't upload, there are a few issues that could be causing this. 1st is a bad Arduino Board, 2nd is if the wrong board is chosen under the Tools Menu, this needs to match the board you are using (Arduino Nano, Arduino Uno, etc.). The Processor chosen under the Tools menu could also be an issue, Uno should be one of the ATMega 328, and the Nano would be one of the ATmega 128. The Programmer chosen might also cause upload issues, I currently have mine set for AVRISP mkII. I hope this helps, please respond with whatever it is that fixes your issue.
@@DIYTechGuyShow so I went to tools your and right the board was the wrong selection. I am using a Mega 2560 so I selected that and it ran the code but the solenoid did not open (its and old solenoid I took out of an old appliance so could be siezed shut). I am also using a TIP 121 transistor. Besides that everything is identical.
Thank you for your help by the way. Im a Mechanical engineerinf student and its so hard to find people who know what they are doing when it comes to arduino.
@@c.moh8842 well, the first thing you should check is to make sure the solenoid is functional, the easiest way to do that is to just connect it directly to the power supply and see if it activates. If it doesn’t, it is probably a bad solenoid or more likely you aren’t providing enough current. Voltage and current are very different and I this scenario you wouldn’t be able to operate a moderate sized solenoid with 8 aaa batteries. Even though you have. 12 volts, the aaa batteries won’t provide the current(amps) required. You would generally need a larger power supply the size of a laptop charger maybe. It’s tough when pulling parts from existing products to truly know the specs, but you can always hook up a larger amperage power supply, NOT VOLTAGE, just to make sure it works.
@@DIYTechGuyShow Yes i think you are right, its not getting the correct amount of current through the coild. Can you recommend a 12v solenoid that would work through arduino? I can get my hands on a 12v - 300mA valve. Would this work?
Any 12V solenoid will work using the Arduino, you just need a large enough 12V power supply. You just need to power the solenoid separately and just use the Arduino and Transistor to switch the ground connection. The limitation is not the Arduino, it is your power supply that is the limitation.
Where to apply 12 v?
Good Question, not sure how I missed this in the diagram. You use a 12V power supply to power the arduino through the barrel jack. The Arduino brings this down to 5V to power the arduino logic, but still provides the full 12V power to the VIN pin on the arduino. You can see this with the purple wire that powers the Solenioid.
What is the rating on the transistor?
I used a TIP102 transistor, but almost any NPN transistor could have worked for this application. The TIP102 has a max current of 8 amps which is overkill for this project, but I just happen to have a few extra ones lying around. You can see the full datasheet on the TIP102 here: www.utmel.com/components/tip102-npn-transistor-datasheet-pinout-and-application?id=799
Wait so you said the arduino can't provide 12v then you connected 12 volts to it?
The Arduino can't output 12V through it's controlled pins. I just connected the solenoid to the 12V on the input side of the Arduino. The Arduino can accept 12V, but it steps it down to the usable 5V for the processor. The VIN Pin is connected to the barrel jack connecter prior to the step down in voltage. The reason for this is that the Arduino can be powered from either the Barrel Jack or the VIN and GND pins. By connecting my Solenoid to the VIN pin I eliminated the need to splice the incoming wire going to the barrel jack.
Is solenoide a 12v?
Yes, it is a 12V solenoid.
Thanks ✋❤
Can Someone copy and paste the code. i hat copy from videos i always mess up thx
Champ🏆
Can u give the circuit diagram of it?
The circuit diagram is in the video.
thanks