Trying to connect 5v solenoid to an arduino

I am using an Arduino Nano , a 5v solenoid , IRF520N mosfet, diode and a 10kohm resistor . I have attached pin4 to a 10kohm resistor to first pin of the Mosfet and the 3rd pin to ground . the 2nd pin is attached to a solenoid which has a diode in between them . the 5v pin is attached to the solenoid . the configuration is not working as intended and the solenoid is not pulling as strong and doesn't retract or push .

What are the power requirements of the solenoid and are you powering it with the arduino

hi pmagowan ,

the power requirements of the solenoid are 5v, I am powering it with the arduino currently , but I have tried powering it using the arduino and an external power supply of 6v but it has failed

Current?

The arduino can power a few LEDs nothing more

the current Is 1.1A at 5v

And there is your problem. What is the maximum current through the arduino pin on the datasheet for it

I can't find it , the arduino is an Arduino Nano 3 ,

can u send the circuit digram on how to connect using external powersupply

Google max current arduino nano 5v pin! A hint, it’s not 1.5m1A and whatever number google tells you is the theoretical maximum

Now look at your power source and see what current it can provide

1 Amp

So you are trying to power something that requires 1.1A (prob more) with a power supply that is inadequate which is throttled through a uC that can’t handle that power and will use some itself plus lose loads as it burns up

When you connect components together it is like the child’s toy with a coloured block and a coloured hole. The shape and colour must match. In electronics you need to look at Amps and Voltage among other things

if I connect the solenoid directly to power supply it works as normally. I am using 4, 1.5v
batteries

You seem to have all the bits to power your solenoid independent of the arduino using the pin to activate it through the FET assuming it is a logic level FET, check datasheet

The Vin pin goes to a step down voltage regulator. The minimum voltage that you can use there is 7V.

can any one send how to exactly to set it up

I checked and it s a power Mosfet, is that any problem

Doesn’t matter what it is called. It matters what requirements it has from your arduino pin. If it requires more than the arduino can provide then it is obviously no use

Are you certain the solenoid is 5v rated ..?

Use a logic level mosfet.

Take the mosfet source directly to the power supply, not via the tracks on the Arduino.
Also the Positive rail power to the solenoids, take directly from the power supply, not the Arduino.

Reduce the R1 resistor by a factor of 10.

Include a 10k gate to ground resistor on the mosfet.

What are R2 and R3 supposed to do....I'd chuck them as well.

Vin is normally the feed to the onboard regulator and requires around 7v to operate correctly.
Not a good setup as you have it.
If you have a clean 5v power, feed in to the 5v terminal on the Arduino.

Faster release time.
Leo..

inductive load from the coil would be crazy, and then a huge flyback when it switches off.

This wont fix your flyback but these are magic and will fix a lot of problems:
LCA717.pdf (120.5 KB)
can be placed ahead or behind the load (high or low side). also provide isolation and double the current in DC mode. Also parallel-able. keep in mind you are powering an LED so make sure to put a resistor in. 750 ohm worked the last time I used one.