2

I am using original Arduino motor shield L298P with Arduino uno.

I disassembled an electric screw driver which came out with a 4.8 v battery pack and a 4.8v specified DC motor.

I connected battery pack to the Vin and Ground pins of the motor shield, and connected the DC motor to A channel of the shield.

The thing is when I run a test code with PWM 255, the torque of the motor is way too low compared to connecting the motor directly to the battery pack. I also changed the batteries to a common 1.2v rechargeable 4 batteries connected in parallel. The result is the same.

What might be going wrong?

I also paste the code I am using below. Thanks in advance.

const int motorPin = 3;
int Speed;
int flag;
void setup()
{
pinMode(motorPin, OUTPUT); //Set pin 3 as an OUTPUT
Serial.begin(9600); //Init serial communication
//Print a message:
Serial.println("Give a number from 50 to 255."); //Why minimun value 50?     Because with values below 50 the motor doesn't spin ;)
Serial.println(""); //Blank line
}

void loop()
{   
//Check if incoming data is available:
if (Serial.available() > 0)
{
  // If it is, we'll use parseInt() to pull out only numbers:
  Speed = Serial.parseInt();
  flag=0;
}

//Valid range is from 50 to 255
if (Speed>=50 && Speed<=255){
    //Send PWM value with analogWrite to Arduino pin 3 and print a message to serial monitor
    analogWrite(motorPin, Speed);
    //Print message only once
    if (flag==0){ 
        //Print PWM value
        Serial.print("Motor spinning with ");
        Serial.print(Speed);
        Serial.println(" PWM");
        flag=1;
    }
}

delay(1000);
}
1
  • 1
    This is not at all surprising - screwdrivers made to run off of low voltages have to draw very high currents under load. A L298 has both limited current handling, and uses bipolar transistors which when you count both elements active in a bridge add up to a substantial voltage drop inside the chip. You can try adding a 5th cell but the current limit remains. If you don't need reversing you can consider a single logic-level NFET with good performance. If you do need reversing, you can "pick any two" of performance, simplicity, or low cost. May 29 '16 at 20:46
2

According to the motor shield page:

To avoid possible damage to the Arduino board on which the shield is mounted, we reccomend using an external power supply that provides a voltage between 7 and 12V. If your motor require more than 9V we recommend that you separate the power lines of the shield and the Arduino board on which the shield is mounted. This is possible by cutting the "Vin Connect" jumper placed on the back side of the shield. The absolute limit for the Vin at the screw terminals is 18V.

According to you:

I disassembled an electric screw driver which came out with a 4.8 v battery pack and a 4.8v specified DC motor.

I connected battery pack to the Vin and Ground pins of the motor shield, and connected the DC motor to A channel of the shield.

That's a lot less than 7V.


Also, from the motor shield page:

Max current 2A per channel or 4A max (with external power supply)

How much current does your screwdriver use?

0

From the Arduino playground:

Arduino: What Adapter?

by djmatic

Ever since the dawn of Arduino, one question has been asked over and over again: "what kind of DC adapter can I use to power my Arduino?"

The short answer is: 9 to 12V DC, 250mA or more, 2.1mm plug, centre pin positive.

The long answer is that an off-the shelf Arduino adapter:

must be a DC adapter (i.e. it has to put out DC, not AC); should be between 9V and 12V DC (see note below); must be rated for a minimum of 250mA current output, although you will likely want something more like 500mA or 1A output, as it gives you the current necessary to power a servo or twenty LEDs if you want to. must have a 2.1mm power plug on the Arduino end, and the plug must be "centre positive", that is, the middle pin of the plug has to be the + connection. These important details are often contained right on the adapter.

Current rating: Since you'll probably be connecting other things to the Arduino (LEDs, LCDs, servos) you should get an adapter that can supply at least 500mA, or even 1000 mA (1 ampère). That way you can be sure you have enough juice to make each component of the circuit function reliably.

One final note. The Arduino's on-board regulator can actually handle up to 20V or more, so you can actually use an adapter that puts out 20V DC. The reasons you don't want to do that are twofold: you'll lose most of that voltage in heat, which is terribly inefficient. Secondly, the nice 9V pin on the Arduino board will actually be putting out 20V or so, which could lead to potential disaster when you connect something expensive to what you thought was the 9V pin. Our advice is to stick with the 9V or 12V DC adapter.

Electronicalifragilistic: I use a power supply from an old HP laptop that I scrapped. The plug is center positive and puts out 12V. Fits perfectly into Arduino connector. Packs a Wallop - most laptops draw 2-2.5 amps. That ought to run your screwdriver.

1
  • Don't just copy text from somewhere else, especially when the recommendations it makes are unsuited to the question at hand. The actual issues here have been explained already, and many times previously both here and at EESE. May 30 '16 at 3:05

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.