I was trying to drive a single dc motor with L293D Shield and Arduino Uno

#include <AFMotor.h>
#include <SoftwareSerial.h>

AF_DCMotor motorLeft(3);
AF_DCMotor motorRight(2); 

unsigned char opMode = 0;

void setup() 


void loop() 

When I turned the power on, a beep sound was made continously. As I was trying to figure out where the sound comes from, I smelled something burning and turned the power off.

I am giving 6V (Four 1.5V batteries in series) as external power. Burning smell doesn't come from batteries, that's for sure.

The smell comes from arduino or shield or both. But I think it is the the left LM293D driver.

What did I do wrong? Any idea?

  • 1
    Please show a schematic, or at least a wiring diagram. This doesn't sound like a code problem.
    – JRobert
    Mar 22 '20 at 13:03
  • @JRobert The shield is not supported by fritzing so it is a little bit hard for me to create a schematic. But it is pretty simple. 6V is connected to EXT_PWR of the shield (Of course there is a switch in between), and DC motors are wired to M2 and M3. The polarity doesn't matter here as far as I know. There is nothing else. I have checked the polarity of the battery via multimeter. It is correct. Mar 22 '20 at 14:10
  • What happens if you power up the system with the motor(s) disconnected? With motor(s) connected but 6v disconnected? You need to partition the system some way until you can narrow down the source of the short-circuit. Obviously, keep the powered-on time as short as you can to limit any (more ): damage while you're testing.
    – JRobert
    Mar 22 '20 at 16:16
  • I did two things: I increased PWM from 30 to 255 and I took the PWRJMP jumper out. Now my card works totally fine. However, now I have to get power from both USB and batteries. Since I am trying to build a robot at the end, it is a problem. I am afraid to try with the PWRJMP on. Mar 22 '20 at 17:42

Alright, I finally realized that RPM value was too low. It has to be at least 150 for my case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.