L298N controlling DC motors

Kindly check out this video: HOW TO: control DC Motors with Arduino + L298N - YouTube

This video using following connections:

L298N 12V pin to +ve battery panel
L298N GND pin to -ve battery panel
L298N two middle pin to Digital arduino pins for rotating the motor clockwise or anti-clockwise
L298N one pin to PWM pin of arduino to control the speed of Arduino.
Arduino powered with USB

Now I want to power the Arduino with my 12V battery, so can I do connections like this below?

L298N 12V pin to 12V +ve battery panel
L298N GND pin to 12V -ve battery panel
L298N two middle pin to Digital arduino pins for rotating the motor clockwise or anti-clockwise
L298N one pin to PWM pin of arduino to control the speed of Arduino.
Arduino powered with same battery panel as above using DC socket (basically common'ing the battery for motors + arduino power)

OR do you suggest any alternate approach? IF yes, which one? Please help! :slight_smile:

Take a look at this: Overview | Arduino Lesson 15. DC Motor Reversing | Adafruit Learning System

What you could do is power the Arduino separately, connect the +V pin on the h bridge to arduino's 5V, and then the battery to the +Vmotor pin on the h bridge, and then make sure you connect the grounds all around. Everything else sounds about right.

Hello chummer1010, I didn't understand it properly. Also I want to power Arduino using DC socket.

zoma786:
Hello chummer1010, I didn't understand it properly. Also I want to power Arduino using DC socket.

I thought you wanted to use a '12v battery'?

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Not fritzy diagram.

Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Thanks… Tom… :slight_smile:

What chummer1010 means :

Is that L293D is a H-Bridge chip as well which can drive up to 2 motors, you need to power up the
chip providing +5V to VCC and the 2 Enables which are in the Top left corner and bottom right corner,
powering your motors you will need to add a battery up to 12V or lower to the VCC2 which is the bottom
left corner and GND:

Bellow you can view the URL’s and chose the tutorial you like to follow and build your project:

  1. http://letsmakerobots.com/node/32041
  2. http://hardwarefun.com/tutorials/controlling-speed-of-dc-motors-using-arduino
    (here you will find code as well) just plug, upload and play.

About the price of a L293D chip comes up at 0.50$ cents so as you see it’s really cheap
and nice to use on projects, btw as well you will need a heat sink because they going to
get hot.

cd6f6f58a980eb4fc4613a222830447c63ba5639.jpg

D.60