Go Down

Topic: Arduino freezes/crashes without reset when switching relays on for motors. (Read 161 times) previous topic - next topic

skurwa

Hi,

My setup involves using a 12V 10A power supply to power an Arduino Mega, 2 smaller 5V motors, 2 larger 12V motors, a 5V OLED character display, and a couple buttons. The 5V components receive their power through a 12V to 5V buck converter.

The motors are switched on/off via a 4-channel 5V relay module.

In the relay module, the Arduino provides 5V VCC for the control signal reference, but the JD_VCC comes from the 5V supply from buck converter to optically isolate the Arduino.

For a process, I require that all 4 motors run at once. However, when I switch the motors on at once, the Arduino freezes/crashes in the state that it was in and corrupted data is displayed on the OLED display. To mitigate this, I tried switching the relays individually with 5 second pauses between each switch to prevent the sudden inrush load of all 4 motors, but even then, the Arduino freezes/crashes and the OLED displays corrupted data.

I have also added snubber diodes between the 12V motor terminals to control the back EMF from the larger motors.

All the components are currently sharing a common ground. If the Arduino is optically isolated, what could be causing the sudden crashes? Is it possible that it is not optically isolated?

It is also worth noting that if I remove power to the 12V motors and run the process, the Arduino does not crash. This indicates to me that the code and the Arduino itself is running appropriately (without large loads).

Thanks in advance for any tips/guidance!

jremington

Voltage spikes can be communicated via capacitive coupling, or radio interference. Try putting the Arduino in a grounded metal box, and use grounded, shielded wiring for the (optoisolated) relay connections.

Use twisted pair on all power wiring and keep it as far from the digital circuitry as possible.

Wawa

Need to see a circuit diagram.
You say you have opto isolation.
So you're using three independent power supplies (not connected, no grounds shared),
and you didn't connect relay ground to Arduino ground...

A picture of the setup might help.
Leo..

MarkT

All the components are currently sharing a common ground. If the Arduino is optically isolated, what could be causing the sudden crashes? Is it possible that it is not optically isolated?
If you are shared ground, it is not isolated...

Fully isolated may not fully fix the problem, especially if the layout is poor.

Try to keep all the high current stuff well away from the more sensitive circuitry, for instance
never run motor wiring alongside logic wiring.

Also high current wiring to supplies and motors should always be twisted pair - loose random wiring is
the worst, a group of magnetic loop antennas all overlapping(!).
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up