Arduino resets itself when running motor drivers

Hello,

I'm trying to run a [motor driver](https://media.digikey.com/pdf/Data Sheets/DFRobot PDFs/DRI0018_Web.pdf) to operate a of pair of actuators using my arduino mega instead of the GPIO pins on my raspberry pi. Occasionally when the actuators increase their load, it causes my arduino to reset, but it doesn't happen when I use my raspberry pi. Does anyone know what might cause the difference between the two?

You have not told us how the motor driver is powered, how it is connected to the Arduino or posted your program.

...R

Sorry about that, I’m just using the demo program right now:

//Standard DLL Speed control
int E1 = 4; //M1 Speed Control
int E2 = 7; //M2 Speed Control
int M1 = 5; //M1 Direction Control
int M2 = 6; //M1 Direction Control
//When m1p/m2p is 127, it stops the motor
//when m1p/m2p is 255, it gives the maximum speed for one direction
//When m1p/m2p is 0, it gives the maximum speed for reverse direction
void DriveMotorP(byte m1p, byte m2p)//Drive Motor Power Mode
{
 digitalWrite(E1, HIGH);
 analogWrite(M1, (m1p));
 digitalWrite(E2, HIGH);
 analogWrite(M2, (m2p));
}
void setup(void) {
 int i;
 for(i=4;i<=7;i++)
 pinMode(i, OUTPUT);
 Serial.begin(19200); //Set Baud Rate
}

void loop(void) {
 if(Serial.available()){
 char val = Serial.read(); 
 if(val!=-1){
 switch(val){
 case 'w'://Move Forward
 DriveMotorP(0xff,0xff); // Max speed
 break;
 case 'x'://Move Backward
 DriveMotorP(0x00,0x00);
 ; // Max speed
 break;
 case 's'://Stop
 DriveMotorP(0x7f,0x7f);
 break;
 }
 }
 }
}

Here’s my circuit:

Schematics drawn on postage stamps just don't help a bit!
Paul

Please edit your post to upload a clear, hand drawn schematic directly to the forum, with pins and connnectors clearly identified.

Processor resets associated with motors, servos and actuators are almost always caused by power supply problems and poor system design. Use a separate power supply for high current loads, more than adequate for the maximum possible current draw, and don't forget to connect all the grounds.

I made an actual diagram including the 12V stepdown converter. If I need to actually handdraw it, let me know, I thought it would be easier with an actual drawing of the motor driver I'm using.

Many things could be wrong, but you have not provided enough information to guess.

The mystery step down converter may not be able to handle the total current draw by the mystery actuators.

Why does the motor driver need a connection to Arduino 5V, and how much current does it draw?

What does it mean that the motor driver inputs are "galvanically isolated", as described in the inadequate motor driver description? Post a circuit diagram of the motor driver.

jremington:
Many things could be wrong, but you have not provided enough information to guess.

The mystery step down converter may not be able to handle the total current draw by the mystery actuators.

Why does the motor driver need a connection to Arduino 5V, and how much current does it draw?

What does it mean that the motor driver inputs are “galvanically isolated”, as described in the inadequate motor driver description? Post a circuit diagram of the motor driver.

Here’s a [schematic](https://image.dfrobot.com/image/data/DRI0018/DC Motor Driver 2x15A_lite SCH.pdf) and the datasheet.

The schematic of the motor driver shows that the inputs are not galvanically isolated.

I give up. Good luck with the project.

jremington:
The schematic of the motor driver shows that the inputs are not galvanically isolated.

I give up. Good luck with the project.

Why are you giving up? I’m not giving up on you. Does it make a difference if the motor driver description isn’t accurate if you have the schematic anyway?

Here’s the actuator and converter that I’m using.

I'm not an expert but I wonder if @jremington means that the design of the driver allows noise due to the motor currents and voltages to interfere with the Arduino.

...R

The peculiar thing is that my raspberry pi doesn't restart when I hooked it up the same way using the gpio pins. The gpio pins have a max current draw of 16mA, while the arduino pins can handle 40mA.

Interference can have many different ways into a circuit, without good test gear you're
guessing what the actual problem(s) is, so you have to try everything.

This could be a ground loop issue due to the power supplies being linked, it
could be capacitive interference, inductive interference (maybe due to poor choice
of woring layout). A lack of decoupling could be leading to very noisy power supply
voltages.

With an oscilloscope you have the option to start probing the various power supplies
and signals for spikes and dropouts.

MarkT:
Interference can have many different ways into a circuit, without good test gear you're
guessing what the actual problem(s) is, so you have to try everything.

This could be a ground loop issue due to the power supplies being linked, it
could be capacitive interference, inductive interference (maybe due to poor choice
of woring layout). A lack of decoupling could be leading to very noisy power supply
voltages.

With an oscilloscope you have the option to start probing the various power supplies
and signals for spikes and dropouts.

I'm powering my arduino through the usb port that is connected to the raspberry pi I was talking about originally. Would that cause any issues?

Let’s see actual wiring ?

The first defences against EMI are shielding and distance - have you shielded your Arduino
circuitry? Is it as far from the high currents as possible? Is your high current wiring
twisted-pair? Are you following good layout practice (no accidental loop antennas)?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.