Pages: [1] 2 3 ... 6   Go Down
Author Topic: Arduino L298N connection problem explained withpic  (Read 7253 times)
0 Members and 1 Guest are viewing this topic.
Turkiye
Offline Offline
Full Member
***
Karma: 0
Posts: 100
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,
i spent hours trying to get arduino working with l298n hbridge chip :'(
now i gave up i need help of yours please help
im trying to get to work a 5v motor with arduino and i want it to control it via arduino
i made all the connections same as explained on internet but it's not working
i took a photo of connection between l298 and arduino here it is:
http://img707.imageshack.us/img707/1567/040720101288.jpg

please help im sure it is so easy for you fellows :/
i couldnt figure out which connection is incorrect as i am a electronics noobie :/
i also wrote some info on photo about which cable connected to where

int moto=2; //input1
int mt=3;//input 2
int a=4;// enable a
void setup() {
 pinMode(a,OUTPUT);
 pinMode(moto,OUTPUT);
 pinMode(mt,OUTPUT);
}
void loop() {
 digitalWrite(a,HIGH);
 digitalWrite(moto,HIGH);
 digitalWrite(mt,LOW);
 delay(100);
  digitalWrite(a,HIGH);
 digitalWrite(moto,LOW);
 digitalWrite(mt,HIGH);
}
« Last Edit: July 04, 2010, 02:06:22 pm by mclightning » Logged

Turkiye
Offline Offline
Full Member
***
Karma: 0
Posts: 100
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

hey fellows i need urgent help please :'( :'(
Logged

Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You have your 0v/6v backwards!?

The minimum you need to connect is:

Pin 4 to a voltage supply, this will be either from the Arduino, or another power source.
Pin 8 to GND
Pin 9 to +5v from Arduino
Pin 10, 12 to a digital output each
Pin 11 to an analogue PWM output

Pin 13,14 are your outputs to the motor.

Pin 15 needs to be straight to GND with a very low 5Watt resistor.

Your photo looks very wrong and you could have damaged the L298 already.
Logged

Turkiye
Offline Offline
Full Member
***
Karma: 0
Posts: 100
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Pin 15 needs to be straight to GND with a very low 5Watt resistor.
what do you mean by a very low 5watt resistor?
what kinda resistor for example?
im really a beginner i dunno much about anything
i just went to electronics shop and they didnt come up with any resistor when i ask for a 5watt resistor
ok i bought 0.5 ohm 5 watt resistor
« Last Edit: July 05, 2010, 04:00:28 am by mclightning » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 34510
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
what do you mean by a very low 5watt resistor?

Pin 15 should be connected to the current sensing resistor with the other end to ground. This allows another chip to control the current through the motor and keep it at a safe level. The value of the resistor depends on what current your load is taking and what voltage the other chip takes. The power rating of a resistor is how much energy it can burn without overheating but  to ask for a 5W resistor without a value is meaningless.
But as was pointed out you wired the power up backwards so it's probably fried by now.
Logged

Turkiye
Offline Offline
Full Member
***
Karma: 0
Posts: 100
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

yea it was overheated yesterday
i just bought a new one today
and bought a 0.47ohm 5 watt resistor
as i am a beginner do you think i better take a photo and share it here so you can tell me ok it's work or not
im afraid to burn this new one
thanks for all your helps

by the way is it ok if i connect both 9. ping and 4. pin which is supply voltage to arduino's 5v out
« Last Edit: July 05, 2010, 04:26:25 am by mclightning » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 34510
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
as i am a beginner do you think i better take a photo and share it here so you can tell me ok it's work or not
Sounds good.

Quote
by the way is it ok if i connect both 9. ping and 4. pin which is supply voltage to arduino's 5v out
Well pin 9 should be connected to the arduino's supply but pin 4 is for the motor's supply. If you connect it to the arduino you will be pulling the power for the motor through either the arduino's regulator or the USB socket. This is fine if the motor is only drawing a few hundred mA but anything over 300mA should be powered with a separate supply.

Also change:-
 delay(100);
to delay(3000);
as a tenth of a second is not long enough to see the motor run.
Logged

Turkiye
Offline Offline
Full Member
***
Karma: 0
Posts: 100
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

is it ok if these are connected like this:
pin4 and pin9 both to arduino 5v
pin8 and pin15(with resistor) both to arduino gnd
Logged

Turkiye
Offline Offline
Full Member
***
Karma: 0
Posts: 100
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for reply i just saw it after writing the reply above
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 34510
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
pin8 and pin15(with resistor) both to arduino gnd

As I said there is no need for a resistor if you don't have another chip controlling the current. Note also you need to connect pin 1 to ground as well even though you are not using the other side of the bridge.
Logged

Turkiye
Offline Offline
Full Member
***
Karma: 0
Posts: 100
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

i got a new l298n chip is that you mean by another chip?
i replaced the old burnt one
or do you mean arduino?

pff am i asking too much :/
im so sorry if i started to be annoying
« Last Edit: July 05, 2010, 05:41:54 am by mclightning » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 34510
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes the chip is the L298, no need to replace anything else. Get the power round the right way this time.
You have not said how much current your motor takes, this is important for seeing where you power it from.
Logged

Turkiye
Offline Offline
Full Member
***
Karma: 0
Posts: 100
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

it's an rc toy car motor not a serious one it was running smoothly with 5v of arduino
here is the connections i made
http://img52.imageshack.us/img52/6655/ardl298.jpg
« Last Edit: July 05, 2010, 07:33:46 am by mclightning » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 34510
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok on the current. That wiring looks wrong again. You label something Pin 9 to 5V ard and it is not going into pin 9 of the L298. Most other wires don't appear to be going to the right place.

All in all it looks like you are not getting the right wires identified in the L298, look at the data sheet again.
« Last Edit: July 05, 2010, 07:57:14 am by Grumpy_Mike » Logged

Turkiye
Offline Offline
Full Member
***
Karma: 0
Posts: 100
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

isnt it like
14 - 12- 10 - 8 - 6- 4- 2
15-13-11-9-7-5-3-1
as shown on the photo
Logged

Pages: [1] 2 3 ... 6   Go Up
Jump to: