My motor shield is overheating when I run a DC motor

Hello, I'm pretty new to Arduino. I want to run a 6-12 volt DC motor from my Arduino Uno Rev 3. I have put Arduino Motor Shield Rev 3 on the Uno and tried a couple of setups. I am using Arduino 1.8.13 software to write and upload code. I am powering the Arduino Uno using a 9 volt battery pack connected to the power port.

First I connected a 9 volt battery pack to Vin and Gnd on the Motor Shield and uploaded this code to the Arduino Uno, then I ran the code, with the Arduino still connected to the PC:

void setup() {

}

void loop() {
digitalWrite(12, HIGH); //Establishes forward direction of Channel A
digitalWrite(9, LOW); //Disengage the Brake for Channel A
analogWrite(3, 255); //Spins the motor on Channel A at full speed
delay(3000); //

}

The motor turned very weakly and there was a burning smell from the Motor Shield (definitely not from the motor). I disconnected everything. I thought maybe the burning smell was because the battery pack and the PC were both supplying power, and I read that the motor turning weakly might be because I wasn't using enough power.

I got a 12 volt battery pack and connected that to Vin and Gnd on the motor shield. I uploaded the following code onto the Arduino with the battery pack and the motor shield disconnected:

bool fHasLooped = false;

void setup() {
pinMode(12, OUTPUT);
pinMode(9, OUTPUT);
pinMode(3, OUTPUT);
if ( fHasLooped == false )
{
for ( int x = 0; x < 10; x++ )
{
digitalWrite(12, HIGH); //Establishes forward direction of Channel A
digitalWrite(9, LOW); //Disengage the Brake for Channel A
analogWrite(3, 255); //Spins the motor on Channel A at full speed
delay(3000); //
}

fHasLooped = true;

}
}

void loop() {

}

and it uploaded fine and the code ran, no burning smell, but when I connected the 9 volt battery pack to the Arduino Uno and connected the Arduino Uno to the motor shield (which was connected to the 12 volt battery pack and the 12 volt DC motor), again I got a burning smell.

I sniffed and felt the hardware to identify where it was overheating and it was hot and smelt burnt close to the 3.3V, 5V, Vin and Gnd pins on the motor shield.

To check a few things, I detached the Arduino from the motor shield and uploaded the blink programme, which worked correctly. I tried connecting the Arduino to the motor shield while blink was running. The motor shield was connected to the 12v battery pack and the motor but there wasn't any burning smell, so I guess it's a problem with my code?

I'll upload a photo showing the overall hardware setup. I'm only allowed to upload one photo because I'm new here.

Please post real schematics of the smell generating setup. Also.... please use the autoformat in the IDE and code tags when pasting here.
Posting text, not code, mixed with comments is not the best.
One good information from Your picture, a useful 9 volt battery setup, not a single PP3 cell...

When you post the schematic, not a frizzy picture also post links to each of the hardware parts.

I am as much a noob with schematics as I am with electronics. I've tried to put one together, but I imagine it will be so bad you just get more confused.

Update, I tried connecting the 12 volt battery pack directly to the motor and it whizzed into life. Battery pack and motor functioning when I bypass Arduino and motor shield.

Since I'm a new user I'm only allowed to provide 2 links
12 volt battery box
6-12 volt dc motor

That Arduino motor shield uses an inefficient/ancient L298 motor driver chip (without heatsink), that most likely can't handle the startup current of your motor.
I think I saw a running current of about 1.8Amp, which is already beyond the capability of that chip, and that means a motor stall (startup) current of 5-10Amp.
Get a 'real' motor driver, that is able to handle at least 10A stall.
Or use a smaller motor.
Or just use a logic level mosfet if your motor only has to spin in one direction.
Leo..

Pololu carries many good modern DC motor drivers. Choose the motor driver based on the stall current of the motor and the motor supply voltage. The stall current can be several times the running current. The stall current will be drawn, briefly, every time that the motor is started. The stall current should be listed in the motor data sheet. In the absence of a data sheet, the stall current can be estimated. To estimate the stall current, measure the motor winding resistance. Take several measurements rotating the motor a bit between readings. Use the lowest reading in the calculation. The estimated stall current is the motor supply voltage divided by the measured resistance.

Oh thank you! I didn't match my motor to the shield. I had never heard of stall current before.

I just went to Hobbytronics and ordered a couple of less powerful motors. I think that is the simplest way to proceed.

In my opinion, buying new motors just so that you can use that crappy L298 driver is the wrong way to go. But it is your project.

1 Like