Electrical – How to i stop DC motors from dropping out the arduino

arduinoback-emfdc motor

I am using a MX1508 DC motor driver module to power a couple of motors with an arduino pro mini as the controller. when i connect the circuit as per the schematic, the arduino resets every so often when changing the motor direction.i can rectify this problem by giving the arduino its own separate battery. my question is; is there any other way of 'isolating' the arduino from whatever problem is being caused by the motors or is a completely separate power source the only answer? i have created similar circuits with servos in the past and not had any problems…
Thanks.

enter image description here

update:

I have just found a solution to my problem; i briefly stop the motors (bring all pins low) before changing their directions. this seems to have worked. Any ideas what is going on 'under the hood' ?
Thanks

Best Answer

You have two issues here.

As Charles mentions, there are no free-wheeling diodes present.

In addition to that, when you reverse the polarity on the motor while spinning you effectively try to stack the back EMF on top of the supply rail. This also back-feeds the battery with a higher voltage.

You need to add some circuitry to isolate the supply during those transitions..

schematic

simulate this circuit – Schematic created using CircuitLab

Note the free-wheeling diode need to be duplicated for each motor.

See this cross-post.