Pages: [1]   Go Down
Author Topic: L298N motor controlled DC motor  (Read 50 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

I have a DC engine I want to power using Arduino PWM. I did succeed with this a couple of weeks ago, but I ran into problems when my L298N burned.

Today I recieved two new ones, but I hope not to burn these as well.

The video tutorial i used is this one:
https://www.youtube.com/watch?v=1Q0ZwpycbzY

The "schematics" is here:
(i changed a little bit, to fit my needs, because my Arduino Pin 10 was used by my Ethernet shield.
The pin numbers in the pin numbers on the L298N.
http://i.imgur.com/k7pYBLa.png

And the code is here:
int IN1 = 12;
int IN2 = A5;
int ENA = 9;

void setup ()
{
  pinMode (IN1, OUTPUT);
  pinMode (IN2, OUTPUT);
  pinMode (ENA, OUTPUT);
  Serial.begin (9600);
  Serial.println("Motor 1 Speed:");
}

void loop()
{
  digitalWrite (IN1, HIGH);
  digitalWrite (IN2, LOW);
  analogWrite(ENA, 120);
}

How can I prevent burning the Mosfet/driver/L298N? A friend of mine told me to use a diode and something else I have never heard of before or ever since. Tried to research on the subject but found nothing.

Thanks.
Logged

Narvik, Norway
Offline Offline
God Member
*****
Karma: 12
Posts: 720
electronics engineer, teacher.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

see page 6 about the flyback diodes
https://www.sparkfun.com/datasheets/Robotics/L298_H_Bridge.pdf
Logged

Ny

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

Quote
The "schematics" is here:
Where?
That link was just a list of numbers, not a schematic.

Read the how to use this forum sticky and learn about posting code correctly using code tags. Then go back to your post with the modify button and change it so it is right.

If you want help we need to see a real schematic, ( note not a physical layout abortion thing from Fritzing )
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46026
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i changed a little bit, to fit my needs, because my Arduino Pin 10 was used by my Ethernet shield.
So is pin 12.
Logged

Pages: [1]   Go Up
Jump to: