Need Help In Arduino Uno, L298N and Dc Motor

Hi Guys,

I need Help In L298n. I have Connected 5 volt and Ground of L298N to Arduino Uno 5 Volt and GND. I am using this video for reference =

, Using this Arduino Uno =

, and i am using this L298N =

and I have connected a motor to channel A of L298N. I am testing with a 5v Jumper Wire and When I touch it to IN1 or IN2 i only feel a little vibration on the motor when I hold it. I have No external Power supply and using the motor provided in the Arduino kit. Please help me. I am a beginner in Arduino and I brought my kit only 2 days ago. I have Not Written Any Code till Now.

Please post a wiring diagram here. Most helpers don't search projects for data.
From Your words it looks like multiple bad things there.

Ok I will. What should I use? I cant download any software.

Pencil and paper.

Or

EasyEDA

https://easyeda.com/

Ok I will send tom as

Hi,

I am attaching it here

@LarryD or @Railroader please help me.

Let’s see a better schematic of the wiring including the motor driver wiring.

Can i make it on paint and upload here?

You can take a picture of the wiring too.

@LarryD PLease See It. I am saying that when I touch the Unplugged Black Jumper Wire on Input 1 or 2 the motor does not rotate, there is only a faint click sound like the motor does not get enough power. I had tested it yesterday and the motor worked using a 9v battery on L298D so was my suspicion correct that It was not getting power ?

Sorry for disturbing you but I live GMT + 5:30 so really sorry if i am disturbing you

Don't use the Arduino 5 volt pin to power a motor and don't let the motor go through a bread board.
One picture shows a 12 volt motor. To make that motor run You need 12 volt at least. The poor L298 will waist some 2 to 4 volt so the motor power supply should be of 14 to 16 volt.

Hi RailRoader, Can You Help Me?

I have got this code :-

int Xpin = A0;
int Ypin = A1;
int Xval;
int Yval;
int m1Pin1 = 2;
int m2Pin1 = 4;
int m1SpeedPin = 9;
int m2SpeedPin = 10;
int m1Speed;
int m2Speed;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(Xpin, INPUT);
  pinMode(Ypin, INPUT);
  pinMode(m1Pin1, OUTPUT);
  pinMode(m2Pin1, OUTPUT);
  pinMode(m1SpeedPin, OUTPUT);
  pinMode(m2SpeedPin, OUTPUT);
  digitalWrite(m1Pin1,HIGH);
  digitalWrite(m2Pin1,HIGH);
}

void loop() {
  // put your main code here, to run repeatedly:
  Xval = analogRead(Xpin);
  Yval = analogRead(Ypin);
  m1Speed = map(Xval, 0, 1023, 0, 255);
  m2Speed = map(Xval, 0, 1023, 0, 255);
  analogWrite(m1SpeedPin, m1Speed);
  analogWrite(m2SpeedPin, m2Speed);

  if (Yval < 470 ) 
  {
    m1Speed = 0;
  } else if (Yval > 550) {
    m2Speed = 0;
  } else {
    m1Speed = map(Xval, 0, 1023, 0, 255);
    m2Speed = map(Xval, 0, 1023, 0, 255);
    analogWrite(m1SpeedPin, m1Speed);
    analogWrite(m2SpeedPin, m2Speed);
  }


  delay(100);
  Serial.print(" m1spped = ");
  Serial.print(m1Speed);
  Serial.print(" m2speeed = ");
  Serial.println(m2Speed);
  delay(1000);
}

Connections =




Currently I have plugged motor into channel A but it does not run using a 9v battery but earlier today it worked. Why is it so . Is it because i have low voltage in my 9v ( they are 1 month old and used in toy radio) .Pls Help Me as Me Newbie In programming. I got kit 3 days ago

It appears you have left the common GND between the Arduino and the motor driver out of the circuit.

This GND is necessary !

Uh i have added it
now what to do. i am sending updated wiring

Momentarily, connect the motor directly to the battery, does the motor then operate ?

@LarryD Yes it does . I had checked it while asking my dad about it

Connect a GND from the Arduino to the GND on the motor driver.

1 Like

My motor when connected is moving like 1 rotation per 10/20 min