how should I connect arduino to 4 geared motors?

Hello

I had a project last semester where I had to build a robot that had 4 geared motors. I used l293b as I did not care for the direction of the motors. Somewhere in the middle of the project the Arduino stopped working so I had to get another one. I think the ATmega328 chip burned out.

Anyway I decided to expand the project now on my own so I'm using L293d. The problem is that it is the 3rd Arduino Uno that stops working. I can't seem to find out why.

I am connecting 2 motors to pins 3 and 6 of the hbridge and the other 2 motors to pin 11. The signal pins (2, 7, 10) are connected to the arduino directly so I can control the direction by setting HIGH and LOW to them.

This works a few times then all of a sudden the Arduino is damaged. Stops uploading and the I/O pin stops lighting.
I am using 12v battery for the whole circuit.
The motors have 60 rpm and very high torque.

Please can you tell me what am I doing wrong?

It would help if you showed the wiring, or a photo of the wiring..
Why don't you use a motor driver/shield?

zaxarias:
It would help if you showed the wiring, or a photo of the wiring..
Why don't you use a motor driver/shield?

Thanks for replying
The motor driver shield is not available where I live but thank you for the suggestion anyway.

I will attach a photo but I will explain my connections further cz perhaps the photo is not clear.
The motors are under the plate.

2 left motors have negative connected to ground and positive to pin 11 of l293d so when its HIGH they turn forward and when its LOW they are off.
2 right motors have positive on pin 3 and negative on pin 6 of l293d so I can control the direction.
Pins 2,7,10 of l293d which send signal to pins which are connected to the motor are connected directly to arduino digital pins 4,5,8 respectively.

well it seems fine..
Do you use one battery for arduino and L293D ?
I would suggest you to use separate supplies, also if you are familiar with a multimeter , you should check the voltages and current of the system...

Those L293d are very low power, I think 600ma. It will run two motors at best, not four of them.
Where is the 12 volts attached + and -

steinie44:
Those L293d are very low power, I think 600ma. It will run two motors at best, not four of them.
Where is the 12 volts attached + and -

The problem, as pat868686 says, is that arduino's stop working one after the other..
So what has to do if L293D is for low power? 8) 8) He doesn't mention any problem with the motors..
If the pins where attached reversed, arduino wouldn't work at all..
The problem is somewhere else... :grin: :grin:

Firstly it sounds like you've got 12V going back to the Arduino somehow. That
would invariably kill it.

Here's a way to reduce the chances of that happening:

Wire the signal connections from Arduino to L293D using 10k series resistors,
common the grounds, but don't connect the Arduino 5V to Vss, keep the power
separate (I think the L293D can have Vss = Vs quite happily).

Now you have a connection where no power supply from the motor driver can get
back to the Arduino board, and even if the L293D fries and dies the signal pins
cannot push enough current back into the Arduino to damage it.

Also power the Arduino from a powered USB hub and you protect your computer's
USB port from damage to the Arduino.

Note that if you are using a 12V SLA battery to power the circuit you must use some
sort of protection, be it a quick-blow fuse, polyfuse or current monitoring. Overcurrent
from a SLA or LiPo battery can release kW of power. Always wear eye-protection
if working on high-current batteries or circuits.

MarkT:
Firstly it sounds like you've got 12V going back to the Arduino somehow. That
would invariably kill it.

Here's a way to reduce the chances of that happening:

Wire the signal connections from Arduino to L293D using 10k series resistors,
common the grounds, but don't connect the Arduino 5V to Vss, keep the power
separate (I think the L293D can have Vss = Vs quite happily).

Now you have a connection where no power supply from the motor driver can get
back to the Arduino board, and even if the L293D fries and dies the signal pins
cannot push enough current back into the Arduino to damage it.

So I assume the high current is what's killing my arduino? Will the 10k resistors be sufficient? Shouldn't I be using transistors?

Also I did not get the first part. Shouldn't the battery be connected to arduino? It's actually connected to the breadbaord and from the breadboard to Vin of arduino. And the grounds are common.

Thank you for your detailed answer. :slight_smile:

I said resistors, I meant resistors.

Ah, you're sharing a 12V supply between motor and Arduino?

Don't do that, motors on separate supply always... Any inductive spikes on the 12V
rail will risk burning the Arduino board, and motors are really really good at putting
spikes onto power rails.