Problem with Arduino losing power due reley activation and not working until reseting! Flyback diode?

I have a problem! When I connect the selonoid lock it simply draws too much current which causes the whole arduino to go crazy and not want to read cards anymore until I reset it again! I also bought a 1n4007 diode because I was going to install it because I thought that was the problem but I don't know how to install it properly! Also when the relay is activated and the selenoid lock is disconnected it draws so much current that my lcd goes a little black and dims and when the relay returns to the off state then it comes back to the normal position! If someone could help me it would be great! Also any other suggestions are welcome! Here is also the curcuit that I was working my project based on!

The relay needs external power. The Nano should control the relay (not supply power to it).

This is the scheme that I found on the internet! Can you try to show on the scheme what should I do in oreder to make it work?

The power supply must be the same as the relay. Read the white printing on your relay... If it says "5VDC"... you need a 5VDC power supply. The Nano can not source/output enough power to energize the relay, and goes into "brownout" (draws power to a "reset" level) and resetting when the command is given to enable the relay pin.

I am not working with a Nano! But can I try just using 5V from Arduino UNO just for the reley and using VIN pin for everything else? And do you think it will solve the problem of Arduino reseting when I use solenoid lock when it uses too much voltage from Arduino? Some other people told me that my Arduino resets probably because of the spikes from it when it turns off. Thanks in advance!

You showed a Nano, what was I to expect?

No.

NO.

Did you try an external power supply?

I didn't try external supply! What do you think I should do next? To buy 5V external supply to power reley just or something else?

Read the printing on your relay.

It says 5V DC

If you have a USB power adapter you can modify a USBA cable to be your 5VDC power supply. USB power adapters usually can source 1.0A, some can source 2.4A. That should be enough to energize the relay... maybe 70mA.

If this does not solve the power issue, address solenoid flyback by placing your diode across the solenoid. Diode cathode (-) to solenoid (+), diode anode (+) to solenoid (-). Search: "arduino solenoid flyback diode"

1 Like

Just take note of what others have advised.
And don't take what you find on the Internet as Gospel truth.
As a general rule, let the Arduino do the controlling and keep the higher power stuff separate.
Relays and solenoids should always have a diode across the coil to protect the MC.
I expect that Keyes module has a diode on it and it does no harm to add one to the solenoid.
And try it with the solenoid disconnected. If that doesn't fix it, disconnect the Keyes module.
Remove items until it does work and pin down what is causing the problem.

2 Likes

Diode cathode (-) to solenoid (+), diode anode (+) to solenoid (-). Search: "arduino solenoid flyback diode". I have already tried to do this and it didn't work. Thanks for your guys help but I didn't manage to solve problem today! Eventualy I will try to buy extra power supply. I thought that I am going to solve everything with flyback diode but I solved nothing! I will try to conect it again but I just need to find a new way!ž

No, you did not.

No, I said that I tried this "Diode cathode (-) to solenoid (+), diode anode (+) to solenoid (-). Search: "arduino solenoid flyback diode"".

So, you do not want to follow advice? Message received.

What? I just said that I already tried this metod with diode and it didn't work for me! You got everything wrong. I followed your advice and I tried that before you told me and didn't work.

@luka,

Remove the relay. use a led and resistor in place of your relay.

Test , if it works OK, follow the advice already given to you. (PSU for your relay).

Good luck………..

1 Like

Don''t use those 9V batteries, and use a seperate PSU for the motor.

1 Like

You will not gain friends and get help with that attitude.

I can assure you that if you follow the advice of everyone here, not using a smoke detector 9V battery, a separate PSU for any motor or some number of RGBs, and you wire it correctly, NOT on a breadboard, but soldered and the correct code, it will work.

That is both the statement of the problem, and the solution. You need more power/current than what a 9V battery can supply.