Go Down

Topic: Arduino Uno doesn't control L298N (Read 135 times) previous topic - next topic

tillmario

Hello, 
I have problems controlling a L298N with an Arduino Uno. (+ 12-V motor and power supply)

When I try this, the motor works fine:


When I connect it to an Arduino and set the pin 7 high, it doesn't work, although with a multimeter I made sure, that there is 5V at Pin 7.


Code: [Select]
const int IN1=7;
const int IN2=8;

void setup()
{
  pinMode(IN1,OUTPUT);
  pinMode(IN2,OUTPUT);
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);

}

void loop()
{
 
  }


I tried 5 different L298N and two different Arduinos.
Does someone have an advice?
Greetings, Tom

CrossRoads

Do you have a common Gnd for all 3 devices?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

tillmario

Do you have a common Gnd for all 3 devices?
The Arduino is powered by my PC, not by the 5V Output of the L298N if that's what you mean.


CrossRoads

So do the Arduino, the L298 board, and the 12V supply all have their Gnd's connected? The drawing doesn't show that.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

groundFungus


tillmario

Connect grounds.
Oops, yes I get it know, why that was the problem. Thank you both.

Go Up