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.
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.