Arduino resets when signal sent to relay

Per the diagram below, I have created a circuit which turns relays on and off based on button presses from an app. Here is the setup:

SETUP:
12.5V power source (car battery)
10V regulator between 12.5V battery and Arduino
Gnd on Arduino to Gnd on 8 channel 5V relay
5V on Arduino connected to Vin on Relay
HC-05 relay module connected to ground and Vin on Arduino
12.5V from battery connected to NO pins on relay board
Ground from 12.5V battery connected to NC pins on relay board

PROBLEM:
When I connect the Arduino and relay board as shown in the diagram below (without motors connected), and a signal is sent to the relay, it operates fine (relays click on and off). Once I connect the motors and send the signal, the lights on the relay flicker and click once the Arduino resets. If I connect a separate power supply for the Arduino (9v battery), everything works perfect even with the motors connected. I would really like to get this working with a single power source (12.5V battery). Any help on this would be greatly appreciated.

No mention of any decoupling, anywhere..... not good. Google is your friend.
by using 12V 'car battery', I hope you are not planning to migrate project to 12V (13.8V) automobile... lot's of fun!

"HC-05 relay module connected to ground and Vin on Arduino", well, how's that working out for you? and how many HC-05's do you have on hand?

Your 12 volt battery does not have sufficient ampacity to supply the loads being switched on or the wiring is not of a sufficient gauge. The result is the voltage being supplied to the Arduino is dropping to levels low enough to cause the reset.

If the above isn’t enough for you to solve the problem, post photo(s) of your installation showing the battery, wiring and all components.

You need a snubber circuit across the relay contacts on the side of the load.

I have had this problem and it’s a common one. The emf when you open the relay is resetting the Arduino. You should maybe have a decoupling cap also but that isn’t the main problem from my experience.

Snubbers can be frowned upon though because they let voltage across the snubber at all times. It will work for you application though.

Clamp the voltage spike on the motors and your golden.

ssnaples:
5bac520d2e57e02658f72f6384a99a73596f3f3d.jpg
5V on Arduino connected to Vin on Relay

This is another issue. Your Arduino may be able to power one relay, but the moment it has to power more than one the regulator will be overloaded. Connect your relay board to a separate power supply.

That board says it needs a 1.5A 5v supply.

Suggest you just get one of these DC-DC converters or something like it, and power both Arduino and the board with it. I have used them with 5V automobile projects with good results.

But you certainly want those commutating (snubber) diodes/circuits recommended by Jayman across the relay contacts.

Thanks for all the feedback everyone. I will definitely add the snubber and decoupling to the circuits. Thanks for the suggestion on the 5V regulator. I actually already added that to the setup after writing this post. I will work on this and report back with a revised diagram/ pictures of the setup. I am currently using 16ga wire for all the relays.

Hi,
Can you post a schematic, not a fritzy picture, in CAD or a picture of a hand drawn circuit in jpg, png?

Keep the switched 12V wires and 12V wires supplying the outputs of the relays away from the UNO wiring.
Connect your relay 12V directly to the battery and the 12V DC-DC converter inputs directly to the battery terminals. (In a star formation).

Have you got a fuse on the 12V to DC-DC converters?

Thanks .. Tom.. :slight_smile:

Yes, I have a fuse on all + leads coming from the 12v battery. I will also try the star formation connections mentioned above. Traveling for the next week, so won't have any feedback for a few days. Post back with some results and updates diagram shortly. Thanks again for all the input. Excellent ideas here.

I have reworked the circuits (attached) based on the above comments, but I am still getting resets. The one item that I have not included (and most likely the culprit) are flyback diodes on the relays. As I understand, I need these across the relays, but for the life of me, I cannot figure out where the diodes need to be placed. Does it go at across the + and - leads coming from the 12V power source to the relay board (across NO and NC)?
Please keep in mind that I am relatively new to electronics but have put in considerable hours researching this. Any help in guiding me in the right direction would be greatly appreciated.
{added image tags - Moderator}

That board has diodes on the relay coils already, you should not need them.

It appears you want the ability to reverse the motor direction.

Is this necessary?

Try a 30 MOV/Bidirectional Transorb across the motor terminals and or 100nF cap @ 40V.

It is useless to feed 5v into Vin.

.

Yes, the motors are reversing and will be required. I will try the 30 NOV as well.

What do you mean the 5v vin is useless. Isn't this required for the relay board to function properly?

NOV
MOV :wink:

You have 5v from the regulator going to Vin on the UNO.

You need this to be 'at least' 7 to 8V if you use Vin on UNO.

Hi,
Can you post a picture of your project please?
So we can see your component layout.

What are the specs/data on the motors?
Do you have a DMM?

Thanks.. Tom.. :slight_smile:

If your trying to input 5v I am pretty sure it needs to go to the 5v pin. Can someone correct me if I am wrong?

Yes 5v can go to the 5v pin, but don’t use the USB or power inputs then.

JayMan:
If your trying to input 5v I am pretty sure it needs to go to the 5v pin. Can someone correct me if I am wrong?

You are right, if you put 5V to Vin the onboard 5V regulator will not be able to give a regulated 5V output.
5V supply must got to 5V pin.
Tom... :slight_smile:

Just curious if the resets are happening when a motor starts or when a motor stops?

larryd:
NOV
MOV :wink:

You have 5v from the regulator going to Vin on the UNO.

You need this to be 'at least' 7 to 8V if you use Vin on UNO.

Yes, I meant MOV... auto correct gets me every time.

I actually have 2 regulators coming off the 12v supply. 1 is a 5V regulator which powers only the bluetooth module and the relay board. The other is a 10V regulator which powers the arduino.