L298N motor controlled DC motor

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:

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.

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.

see page 6 about the flyback diodes

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 )

i changed a little bit, to fit my needs, because my Arduino Pin 10 was used by my Ethernet shield.

So is pin 12.