MEGA2560 crashed when control a relay which control a motor

Thread Starter

LAOADAM

Joined Nov 21, 2018
166
The MEGA 2560 got crashed often, I series a 200u 200V capacitance and a 220 ohm and paralleled them to the contacts of the relay as shown below, seems it runs a little while? and then the motor becomes as: da da da da noise. why?
Thanks.post81.JPG
 

djsfantasi

Joined Apr 11, 2010
5,682
You don’t show the connections to the coil. They’re important!

At a minimum, you need to have a diode across the relay coil connections. The anode should be on the negative or ground connection of the coil.

Do you have such a diode? Post all the connections to the relay, it’s coil and the Mega!
 

Thread Starter

LAOADAM

Joined Nov 21, 2018
166
You don’t show the connections to the coil. They’re important!

At a minimum, you need to have a diode across the relay coil connections. The anode should be on the negative or ground connection of the coil.

Do you have such a diode? Post all the connections to the relay, it’s coil and the Mega!
Thank you.
Here is the full section of the drawing.
I didn't put a diode there cause of I only see a saying of a C+R. what else should I do?
post82.JPG
 

djsfantasi

Joined Apr 11, 2010
5,682
You need a diode across the relay coil as I said.

Also, unless RL2 is a low current, 5V relay, you need a transistor or MOSFET to drive that relay.

RL1 will do nothing if it’s really wired as in that diagram. And I’m not sure that R1 and C1 do anything either. Why do you have two relays?
 

MisterBill2

Joined Jan 23, 2018
3,972
The real question is what is the TS intending to have happen? Diode suppression of the inductive spike when a coil switches off is only one method, and it has the very serious consequence of causing problems if the diode is backward, or if the diode failures in a short circuit mode.A resistor, capacitor, or pilot lamp will also work, with the pilot lamp being the most useful choice. And no, the second circuit will not function because of no power source to drive that second relay. And that second relay does not need a coil diode because the control contacts can handle the spike very well. But, once again, what is the TS intending to have happen? I am presuming that The MEGA 2560 is some sort of microcontroller.
 

djsfantasi

Joined Apr 11, 2010
5,682
I am presuming that The MEGA 2560 is some sort of microcontroller.
Bill, the Mega 2560 is an Arduino board with greater capabilities than an Arduino Uno. For example, it has much more flash memory, 54 GPIO pins, double the number of analog pins, more PWM pins and 4 hardware serial ports.
 

Thread Starter

LAOADAM

Joined Nov 21, 2018
166
You need a diode across the relay coil as I said.

Also, unless RL2 is a low current, 5V relay, you need a transistor or MOSFET to drive that relay.

RL1 will do nothing if it’s really wired as in that diagram. And I’m not sure that R1 and C1 do anything either. Why do you have two relays?
Thank you.
1. Sorry about the drawing missed a power for RL1;
2. added diode1 and diode2 to the coil of the relays;
3. The RL2 is a 5 V low current relay, I added a transistor there;
4. R1 and C1 works as arc extinguishing, I heard the contact will generate arc?
5. The purpose to used two relays is try to isolate the electronic interference from RL1 which pass large current.
Thanks

POST85.JPG
 

Thread Starter

LAOADAM

Joined Nov 21, 2018
166
The real question is what is the TS intending to have happen? Diode suppression of the inductive spike when a coil switches off is only one method, and it has the very serious consequence of causing problems if the diode is backward, or if the diode failures in a short circuit mode.A resistor, capacitor, or pilot lamp will also work, with the pilot lamp being the most useful choice. And no, the second circuit will not function because of no power source to drive that second relay. And that second relay does not need a coil diode because the control contacts can handle the spike very well. But, once again, what is the TS intending to have happen? I am presuming that The MEGA 2560 is some sort of microcontroller.
Thank you.
the circuit is trying to use Arduino to control the 24VDC motor that need large current, I'll remove the diode for RL1? you mean?
 

djsfantasi

Joined Apr 11, 2010
5,682
Thank you.
1. Sorry about the drawing missed a power for RL1;
2. added diode1 and diode2 to the coil of the relays;
3. The RL2 is a 5 V low current relay, I added a transistor there;
4. R1 and C1 works as arc extinguishing, I heard the contact will generate arc?
5. The purpose to used two relays is try to isolate the electronic interference from RL1 which pass large current.
Thanks

View attachment 180005
The recent schematic is improved.

Physically, connect the diodes right at the coil contacts.

Now I understand R1 & C1. They are fine.

Leaving RL1 in your circuit is not necessary, but can’t hurt. On one hand, it complicates your circuit, adding another point of failure. On the other other hand, it is useful if the motor is remotely located. It allows a stronger signal to drive the motor and minimizes power runs to the motor. A shorter run minimizes power loss overnthe control wires.

I want to point out that @MisterBill2’s comments about other ways to suppress the inductive spike when the relay could turn off are also very good alternatives. The reverse diode is but the simplest.

Removing the diode on RL1 is possible. But leaving it in is not the wrong thing to do.
 

MisterBill2

Joined Jan 23, 2018
3,972
Bill, the Mega 2560 is an Arduino board with greater capabilities than an Arduino Uno. For example, it has much more flash memory, 54 GPIO pins, double the number of analog pins, more PWM pins and 4 hardware serial ports.
OK, and thanks for the clarification. I figured that it had to be some kind of microcontroller.
For total immunity to relay and load noise you need an isolated opto-device and a separate transistor to control the relay. If a FET device with the internal diodes is used then even a coil shunt device would not be needed.
 

djsfantasi

Joined Apr 11, 2010
5,682
The TS just stated that he was attempting to drive a high current 24V motor. We can assume that the motor does not need
to be reversed. We don’t know what kind of motor nor specifically how much current it needs? @LAOADAM , how much current are you switching?

I’ve driven multiple servos requiring a total of 8A with a Mega. I’ve also driven 5A of LEDs with a Uno. So it isn’t difficult.
 

Thread Starter

LAOADAM

Joined Nov 21, 2018
166
OK, and thanks for the clarification. I figured that it had to be some kind of microcontroller.
For total immunity to relay and load noise you need an isolated opto-device and a separate transistor to control the relay. If a FET device with the internal diodes is used then even a coil shunt device would not be needed.
thank you.
Can I use a mosfet to drive RL1 and remove RL2?

post87.JPG
 

Thread Starter

LAOADAM

Joined Nov 21, 2018
166
The TS just stated that he was attempting to drive a high current 24V motor. We can assume that the motor does not need
to be reversed. We don’t know what kind of motor nor specifically how much current it needs? @LAOADAM , how much current are you switching?

I’ve driven multiple servos requiring a total of 8A with a Mega. I’ve also driven 5A of LEDs with a Uno. So it isn’t difficult.
Thank you.
The motor is 24VDC Mower motor, the original circuit breaker is 30 A, that's why I think the largest current can be 30 A.
 

MisterBill2

Joined Jan 23, 2018
3,972
thank you.
Can I use a mosfet to drive RL1 and remove RL2?

View attachment 180009
Short answer is YES, BUT you will still be smart to have an opto-isolator because of the size of that relay. I had not realized that you were controlling such a big motor. And the mosfet you use will need to have adequate current and voltage ratings for the relay coil. The big deal with the motor is that the short term starting current will be quite high, possibly more than the 30 amps, but only for a few milliseconds. So it will be hard on relay contacts, meaning that you need a relay rated for starting that size of DC motor. Those are certainly available, but not everywhere. You may need to visit an auto parts store to find one locally. The circuit shown in post # 12 should work quite well if the ratings for that mosfet are adequate for the relay you use.
 

MaxHeadRoom

Joined Jul 18, 2013
19,155
The NFPA70 rule is that overloads for a motor circuit shall be between 115% to 140% FLA, depending on the motor rating, most installations I have been involved in has used the 140% - 150% rule.
Max.
 

MisterBill2

Joined Jan 23, 2018
3,972
The NFPA70 rule is that overloads for a motor circuit shall be between 115% to 140% FLA, depending on the motor rating, most installations I have been involved in has used the 140% - 150% rule.
Max.
In almost all instances I provide motor overload protection separately from the short circuit protection. Thus the code is satisfied while still allowing the motor to be adequately protected. There are two different goals and thus two different systems. My observation has been that "When one size fits all, it does not fit any of them very well." That is almost always correct, and yet never acknowledged by those who set the rules that we are forced to follow.
 
Top