Control 12V Solenoid with Nano

Hi guys

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);

} 

do you mean you take the 5V out of the 5V pin from the Nano and boost it up to 12V to power the 12V Solenoid?

how much current does this solenoid need ?

1 Like

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.

Here you can find all the specs

I have a micro usb adapter from which I can pull energy if that would help.

Here are the specs

Hi,
Can we please have a circuit diagram?
An image of a hand drawn schematic will be fine, include ALL power supplies, component names and pin labels.

This is not very helpful.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

2 Likes

@ynalyaseen

Your other topic on the same subject deleted.

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.

Thank you.

1 Like

Hi, yes that was exactly what I was doing. According to the manual it needs 1.5A.

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

see Solenoid Driver PCB – Arduino++ (first google hit, not a specific recommendation) as an example

1 Like

18W at the output of the 5V to 12V DC-DC, assume 100% efficiency.
18W input to the DC-DC converter.
P=V * I

I = P / V = 18 / 5 = 3.6A being asked of the USB port or 5V supply.
7 times the rated USB current.

Please @ynalyaseen can we please have a circuit diagram?

Tom.. :smiley: :+1: :coffee: :australia:

1 Like

Hi Tom

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 :slight_smile:

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

1 Like

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…

Look under the hood in your neighbor's car... :crazy_face:

1 Like

Side note : have you considered a small servo to trigger the release ?

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

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.