The mystery of the restarting Arduino

Thread Starter

zeeman_effect

Joined Mar 28, 2021
4
I have a simple circuit, pictured below, that uses an Arduino to control two large bidirectional motors via 12V relays. Normally this works a treat, but sometimes the Arduino ends up resetting itself.

The resets themselves are sometimes frequent (~every 10 seconds) and sometimes infrequent (once every 5 min). Usually, the arduino restarts properly, but sometimes it becomes frozen and needs a hard reboot.

I think what's happening is that the motors eat up a lot of power when starting, causing the arduino to have a momentary loss of power wherein it resets. To remedy this, I added a 1000uF electrolytic capacitor, and a 22uF ceramic capacitor. Additionally, I "walled off" the arduino's power/ground planes with diodes so that the motors aren't able to steal charge from the arduino during a power drop.

Looking at the VIN/GND to the arduino, I still see the occasional power drop, but with the diodes/capacitors the spikes are very short and sharp. What's amazing is that these power drops don't always precede a restart as far as I can tell.

My current working theory is that the power drops are corrupting memory or just precipitating instability in the arduino, which is why power drops don't generally immediately cause a restart.

I've spent a few days struggling with this problem, and I'm still completely lost as to what I should do to fix it. Any and all help would be appreciated.

PCB.PNG
 

dl324

Joined Mar 30, 2015
12,790
Show us a schematic of how things are connected.

What is the maximum current draw of the motors? How are the grounds for the 12V and 5V supplies connected?

Is the vertical sensitivity on the scope picture 3V/division?
 

Thread Starter

zeeman_effect

Joined Mar 28, 2021
4
The scope is 3V/division, so the ambient level is around 12V (a bit less due to a v drop across the diodes).

I don't have a schematic at the moment, but here is the bottom layer of the PCB. I can draw out a schematic of any area that is unclear.

PCB_bottomlayer.PNG

There are two ground planes, one for the motors on the left, and one for the arduino on the right. The arduino/motor planes are connected at the bottom center of the PCB. To the right of which are the capacitors.
 

Thread Starter

zeeman_effect

Joined Mar 28, 2021
4
Here is the schematic for the motorMotor_Schematic.PNG
And here is the schematic for the arduino power
Arduino_pwr.PNG
The high side diode is to prevent the motors from stealing charge from the arduino, and the low side diode is to prevent the motors from moving the ground plane. I've tried without the low side diode, and there's still an issue with the restarts.

I'm running out of theories for what could explain this issue. It's very temperamental, sometimes it's quite stable and sometimes it immediately resets. I'm thinking that there may be some interference issue, possibly from the relays. But I'm not sure how to test that theory, and how I would fix the issue.
 
Top