Hi guy !
I've recetly build a L298N shield for my arduino based this 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
pinMode(ENB,OUTPUT);
pinMode(IN1,OUTPUT);
pinMode(IN2,OUTPUT);
pinMode(IN3,OUTPUT);
pinMode(IN4,OUTPUT);
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
digitalWrite(IN1,LOW);
digitalWrite(IN2,HIGH);
// Direction du Moteur B
// NB: en sens inverse du moteur A
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
}
void loop() {
// Moteur A - Plein régime
analogWrite(ENA,255);
// Moteur B - Mi-régime
analogWrite(ENB,128);
}
How can i import photo on my
How can i import photo on my post? Make my code more readeble ?
I looked at a version of the datasheet for the L298.
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.
Ok so a 9,6V battery will do
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.
OK i’m gonna test that to
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 ?
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 :)
I think i’m gonna build a
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 ?
Here is some news,I try to
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 ?
And a other thing, I don’t
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