I‘m trying to control a 12V Solenoid with an Arduino Nano. It is actually just controlling whether to lock or not; but what I need it to do is to snatch in when I push in the nose (doing that per default) and release that on command.
Code and wiring attached. Note: I‘m using a step up for the 12V, pulling in from 5v and gnd pins from the nano.
Input appreciated since I‘m going crazy here…
int Relay = 4;
void setup() {
Serial.begin(57600);
pinMode(6, INPUT_PULLUP); //Set Pin6 as output
pinMode(Relay, OUTPUT);
}
void loop() {
int singal=digitalRead(6);
Serial.println(singal);
digitalWrite(Relay, HIGH);
delay(2000);
digitalWrite(Relay, LOW);
delay(2000);
}
I hope you have a box of Arduino Nano's. A Power Supply the Arduino is NOT! Hooking a solenoid to the Arduino is a good way to fry the Arduino, it will not hurt the solenoid. If you have tried that it may already be fried. How are you going to power this thing? Without more information such as Current requirements, and links to technical information on the other items I will not even take a SWAG. I do not read pictures very well, an annotated schematic would help a lot.
Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.
Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.
Repeated duplicate posting could result in a temporary or permanent ban from the forum.
Could you take a few moments to Learn How To Use The Forum
It will help you get the best out of the forum in the future.
that's way too much from your poor little arduino...
1.5A x 12V is 18W being asked from your USB power supply which works at 0.5A x 5V = 2.5W and through your boost (not sure what it can provide)
Best case scenario is that drawing too much current will get the voltage to drop and your arduino to crash. Worst case is you damage the board.
The typical set up requires a dedicated power supply for your solenoid, with a freewheel diode and driving the solenoid through a power stage like a power transistor/mosfet
Thanks for your thoughts. Unfortunately I don’t have a circuit diagram, but I have this picture of the setup, from which it should be clear how things are wired. Hope it helps.
Btw I want to use this solenoid as the release mechanism of the parachute deployment system of my model rocket. So I’m kinda limited in regards of power supply and space. Hence I was trying to get the power from my arduino by pulling up the voltage to what is needed.
get a piece of paper, a pencil and a ruler and draw it. snap a picture and post it here. Not "rocket science" as you seem to be in that domain
forget the idea of getting the current from your Arduino. Take it directly from the power source, I assume you have batteries. add may be a decoupling capacitor and don't forget the freewheel/flyback diode
Since you cannot supply the needed information and prefer to just ask questions I will spend my time helping other. I will not do your research for you.
Dude what’s wrong with you, what’s that tone? I supplied all the information in the comments (except for the circuit diagram; due to the fact that I have not drawn one for aged and kinda forgot the syntax.) thankfully I got some inspiration from the other users and solved the issue.
Thanks again - I measured the Amps and it actually was too low. Now I have tried it again with a 12v 1A adapter from my keyboard and voila it works. I will have to think of a solution on how I can get a battery to replace the adapter…
Yes I thought about it but that would have at least added 70g to the system. And kinda felt like a „lazy“ solution since the infrastructure is already there to achieve the goal - it just needs the right setup… hmm