Let's Make Robots!

DIY L298N shield

Hi guy !

I've recetly build a L298N shield for my arduino based this shematics the shematics.

The only modification that i made is : - my diodes are 1N5821

                                                      - I've not put some pull up resistance on enablepin

                                                      - I use 5V from my arduino and 4,8V batterie for my motors

And when i plud the shield on my arduino and import the code ( see below) the software say:

avrdude: stk500_getsync(): not in sync: resp=0x00

So i try to import the code without put the shield on the arduino and it import correctly but when i plug the shield nothing hapen,the motor dont move.

Someone have an idea ?

sorry for spelling (french )

here is the code :

//-- MOTEUR A --
int ENA=5; //Connecté à Arduino pin 5(sortie pwm)
int IN1=2; //Connecté à Arduino pin 2
int IN2=3; //Connecté à Arduino pin 3

//-- MOTEUR B --
int ENB=6; //Connecté à Arduino pin 6(Sortie pwm)
int IN3=4; //Connecté à Arduino pin 4
int IN4=7; //Connecté à Arduino pin 7

void setup() {
 pinMode(ENA,OUTPUT);//Configurer les broches comme sortie
 digitalWrite(ENA,LOW);// Moteur A - Ne pas tourner (désactivation moteur)
 digitalWrite(ENB,LOW);// Moteur B - Ne pas tourner (désactivation moteur)

 // Direction du Moteur A

 // Direction du Moteur B
 // NB: en sens inverse du moteur A

void loop() {
  // Moteur A - Plein régime

  // Moteur B - Mi-régime

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

And a other thing, I don't have capacitors and voltage regulator on my setup because i use two power sources ( 5V of the arduino and a 9,6V batteri for my motor ).

So do you think that the capacitor are neccesery ?


I post a photo on my setup soon :)

Here is some news,

I try to re build a shield and this time im building the shield step by step and checking at every step.

So i try Duane idea to see if my L298N work correctly and when i plug the power, the motor start spinning but for 1 second.

After this 1 second, the motor stop and keep not moving until i de-plug and re-plug power.

a Idea someone ?

I think i'm gonna build a second shield with the shematic of my preview post

but do you think my diodes ( 1N5821 ) are too big for my use and if the pull up resictances on the enable pin are neccecery ?

OK i'm gonna test that to see if it work. But iv not understand you says that the ground of the arduino 5V and the 12V motor supply are not connected together ?

Is this shematics good ?

Like that ?

Is the pull up resistance on the enable PIN is neccecery ? Why the value of this resistance vary between different schematics ? Is by the enable pin that we control the speed of the motors ?

Thanks for your help :)

Ok so a 9,6V battery will do the job ?

Edit : Ive just tried with a 9,6V battery and the result is the same... There is no voltage out on the motor PIN

I think there is a short circuit on my shield and, because of that, the arduino canno't import the code and the L298N canno't do his job. But i check my solder a few times and all is allright.


It lists the supply voltage as Vih + 2.5. Vih (Input High Voltage aka Voltage required for a logic HIGH) = 2.3v Minimum. So, you will need at a bare minimum of 4.8v in. You will get only about 3v out. I agree that you should be supplying maybe closer to 7v for the motor supply. You can count on voltage loss between your input and your output. The datasheet lists between 1.8v and 4.9v drop.

How can i import photo on my post? Make my code more readeble ?