Relay Module causing Arduino Reset

I'm using a Mega 2560 & controlling a 12v linear actuator via an optocoupled 8 relay bank module. It has worked fine for over a year but has just started causing the Mega2560 to reset itself. The relay can happily switch the actuator on and off maybe 20 times in succession but then will randomly cause a reset, which happens precisely at the moment the control signal goes HIGH and the contacts get flipped from NC to NO (active high device). If I disconnect the actuator from the output terminals the reset problem stops happening. I've checked there's no electrical connection back between the 12v (battery operated) and 5v circuits, so can't work out what's destabilising the Mega2560. Any help appreciated.

Your problem seems to me to be a typical case of a project without the use of snubbers on relay contacts operating inductive loads.
If there are no snubbers, I am surprised that this project has worked for so long without problems.
So that we can better identify the possible problem, please publish a schematic of your project.

1 Like

Did you use a kickback diode across the actuator motor.
How did you power the Mega.
How did you power the eight relay coils (8 * 75mA).
A connection diagram would clear things up.
Leo..

Thanks for your reply. Will do that Asap. Cheers.

Thanks for your reply, I'll post a schematic tomorrow. I have no kickback diode on the motor, sorry my knowledge is a bit lacking - I thought the relay bank had all the protection it needed at the 5v side (optocouplers / flyback diodes etc.) I've used a further 2 of the relays in the bank to create a polarity switch but this itself doesn't seem to be the cause of the issue. I'm powering the module with a similar breadboard power supply to that supplied with the Elegoo kit (700mA, 5v). I've checked the supply current does indeed increase in multiples of 75mA on activation of the coils as you say but there are never more than 3 relays activated at any time. I've checked the current being drawn at the inputs as roughly 1.7mA which seems in order and also that all the 5v stuff shares a common ground. I'm powering the Mega2560 via the usb of my laptop. Cheers.

That 700mA is only possible with a 6volt input, and drops to 100mA with 12volt input.
Due to thermal limitations, which are conviniently not mentioned in the spec sheet.
Leo..

Interesting! ... I've been powering the psu with a 9v mains adapter, but it looks like the regulator's gone on it - it's sending out about 14v. Will swap the adapter, see what happens!

You are correct most of the relay modules provide this, however I know of none that provide protection on the contact side other then Solid State Relays. Consider using a solid state relay in place of the mechanical for the problem circuit. Posting your schematic will help us get you a better answer.

Thanks, yes will post the schematic tomorrow. Cheers.

Hi, here it is. This is a much simplified schematic of a section of a wood routing machine I'm making. The diagram supplied relates to the side feed assembly - there are two actuators, so a total of 6 relays used. Ideally I'd like to be able to activate all 6 at once. I'm disabling the motor then using a delay before switching polarity, then a further delay before enabling again - as a means of protecting against short circuiting. Thanks for your advice re the solid state relays. I'm actually using an L298N controlling two actuators to raise/lower the height of a router tray. I could maybe use another of these for the side feed motors in place of the relay arrangement I have? (my reason for using the relays was to avoid the 2v voltage drop from the L298N) Cheers.

Hi Leo, Have posted the diagram, see accompanying text for more info. I tried another adapter which I've tested at 9v output. Same problem persists. I'm thinking I will get a good quality bench power supply. Let me know your suggestions re snubber circuit on the motor side. Cheers. Paul.

So obviously something failed.
When you disconnect the actuator it doesn't reset and you jumped to the conclusion that it is the relay. Maybe it's the motor, 12V battery, wiring, or something else.

Sorry yes, I should have said the control signal going HIGH causes the reset. I'm still narrowing down what part of the system is problematic.

Try this:`

Hi, @rowyrowson

Can you post some images of your project?
So we can see your component layout.

Have you got the 12V power wiring away from the other wiring, especially the sensor wiring?

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

With problems that occur randomly it can take some time to find the actual cause.
No hurry.

Hi, yes the 12volt wiring is entirely separate from the rest of the circuitry and doesn't run alongside any of the sensor wiring. I'm wondering if maybe some RF interference from sparking relay contact could be to blame. Will try connecting diode as advised by @ruilviana and also it seems I have some power supply issues to address. Will post pictures soon. Cheers.

Then why didn't it happen a year ago?

also it seems I have some power supply issues to address

Power for the Arduino?

Many thanks @ruilviana I will try what you suggest and also address the power supply issue. Is there a particular diode spec/value I should use?

Wish I knew lol. Possibly the Mega2560 has become damaged in some way or some other factor has rendered it more sensitive to RF - only a guess. As you say, could be a slow process getting to the root of this. But I now have a few pointers / things to try. I also had this project running on an Arduino UNO before I decided to increase the number of sensors - never had a problem then re resetting mid program.