Introduction: Arduino L298 Motor Shield

Picture of Arduino L298 Motor Shield

This is my version of a cheap and diy arduino motor shield. It is very simple and rugged. Credit goes to Ascas for the design.

Specs:
Voltage = 5 - 50 V
Current = 2 - 3 A
Maximum two motors
Speed and direction control for both
Arduino compatible

This is my Facebook page. Please like and share 
https://www.facebook.com/electronicrepairandservice

Step 1: Parts

Picture of Parts

You will need:

1 x L298 Motor Driver
1 x Veroboard
1 x Male Header Strip
1 x Female Header Strip
8 x 1N4007 Diodes
3 x Block connectors
2 x Indicator Led
2 x Led Resistor
2 x 1 Ohm Resistor
Jumper Wire

You will also need basic soldering tools and some soldering skills


Step 2: Schematic

Picture of Schematic

This is the schematic and again credit to Ascas. Pin out for the motor driver is also given

Step 3: Step 1

Picture of Step 1

You will start off by cutting your vero board to the arduino size. Sand down the sides for a neat finish. Start off by soldering the female headers, the L298 and the block connectors as shown 

Step 4: Step 2

Picture of Step 2

Next step is to solder the male headers below the female ones to make it a shield type thing. You could buy the arduino headers to make the project prettier and more sturdy but i found them to be expensive. The best way is to insert the male header in the arduino I/O pins and align the shield on top of it. Use tape to secure it and then solder away. 

Step 5: Step 3

Picture of Step 3

Next is to make the power and other connections along with adding the diodes. Follow the schematic and add the two resistors as well. 

Step 6: Step 4

Picture of Step 4

Next is to add the led and resistors along with it. Here one option is to add a LM7805 so that you could power the arduino with the the power only to the shield but for my application i didnt need that so i went with separate power supply. I also made connections to the arduino PWM pins. 

Step 7: Test It

Picture of Test It

You are all done and next is to test it out. 

Use the following code 

int outPin = 5;
int outPin2 = 6;
int outPin4 = 10;
int outPin3 = 11;
void setup()
{
Serial.begin(9600); // setup serial
pinMode(outPin, OUTPUT);
pinMode(outPin2, OUTPUT);
pinMode(outPin3, OUTPUT);
pinMode(outPin4, OUTPUT);
}
void loop()
{
delay(3000);
analogWrite(outPin, 50);
digitalWrite(outPin2, LOW);
analogWrite(outPin3, 50);
digitalWrite(outPin4, LOW);
Serial.print(" ");
Serial.print("slow");
delay(3000);
analogWrite(outPin, 150);
digitalWrite(outPin2, LOW);
analogWrite(outPin3, 150);
digitalWrite(outPin4, LOW);
Serial.print(" ");
Serial.print("med");
delay(3000);
analogWrite(outPin, 255);
digitalWrite(outPin2, LOW);
analogWrite(outPin3, 255);
digitalWrite(outPin4, LOW);
Serial.print(" ");
Serial.print("fast");
delay(3000);
analogWrite(outPin, 0);
digitalWrite(outPin2, LOW);
analogWrite(outPin3, 0);
digitalWrite(outPin4, LOW);
Serial.print(" ");
Serial.print("stop");
delay(3000);
analogWrite(outPin2, 100);
digitalWrite(outPin, LOW);
analogWrite(outPin4, 100);
digitalWrite(outPin3, LOW);
Serial.print(" ");
Serial.print("backwards");
delay(3000);
analogWrite(outPin, 0);
digitalWrite(outPin2, LOW);
analogWrite(outPin3, 0);
digitalWrite(outPin4, LOW);
Serial.print(" ");
Serial.print("stop");
}

Step 8: Conclusion

Picture of Conclusion

I used this shield to make LINUS my line following robot which i will upload soon and it worked great. I put it through endurance and it stood up to the challenge although a good heat sink is essential. Thank you for viewing and i hope i effectively communicated my build. 

Th schematic is very simple but still if you have issues, double check your connections. Using a multimeter always helps :P

Comments

FaizI5 (author)2016-11-13

Nice work! I will try a similar project but with two servos addition. Hope it will work fine :)

osamalios (author)2015-11-20

is it okay if i used 1.1ohm? i only found it scavenging old TVs i guess...

DIY Brothers (author)2015-07-02

Good work. Some months ago I did a similar project to control motors using arduino. I suggest you to use fast diodes like schottky.

BIGDOG1971 (author)2014-04-08

Great Job.

Take a look on my instructable too. https://www.instructables.com/id/Dual-H-Bridge-L298...

bjkayani (author)2014-03-21

Sure. Thank You

bjkayani (author)2014-03-20

Ok. I will try to post some king of veroboard layout soon.

TheFlorifant (author)2014-03-20

Would it be possible to post a schematic on how to solder this, I'm kinda new to this stuff.

And to think I bought a motor shield when I could have made my own!

The L298 is obsolete bipolar transistor technology today. You can read a comparison between it, and some other H Bridges here

http://railstars.com/2010/08/10/lolbooster-output-...

About This Instructable

12,166views

94favorites

License:

Bio: I am an 19 year old DIY ist and Tinkerer with a deep interest in the field of robotics, electronic and cooking. I am skilled ... More »
More by bjkayani:Outdoor Pizza Oven$2000 Quality Prints From a $200 Printer : an Upgrade Guide for the Anet A8 3D PrinterBed Table from a Pallet
Add instructable to: