Move faster a 12V DC motor with L298N

Hi everyone, I need help fast.

I have to put a DC 12V motor with Arduino Nano (Old Bootloader), an H bridge L298N and an IR receiver to change the speed with a control, but it is very slow connected to a gear, how do I make the motor go faster?

Here's the code just in case.

//Receptor IR S = D3
//L298N 9=1 white 8=2 brown 10=ENA red
#include<IRremote.h>
int SENSOR = 3;
int enA=10;
int in1=9;
int in2=8;
IRrecv irrecv(SENSOR);
decode_results results;
void setup() {
  pinMode (enA, OUTPUT);
  pinMode (in1, OUTPUT);
  pinMode (in2, OUTPUT);
  digitalWrite(in1, LOW);
  digitalWrite(in2, HIGH);
  Serial.begin(9600);
  irrecv.enableIRIn();
}


void speed3()
{
    digitalWrite(enA, HIGH);
}

void speed2()
{
    analogWrite(enA,170);
}

void speed1()
{
    analogWrite(enA,85);
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume();
  }
  if(results.value == 0xC9767F76)
  {
   speed1 ();
  }
  if(results.value == 0xC8155AB1)
  {
   speed2 ();
  }
  if(results.value == 0xB6996DAE)
  {
   speed3 ();
  }
  if(results.value == 0xF32F72D7)
  {
   analogWrite (enA,0);
  }
}

Use a modern motor driver. The ancient L298 dinosaur wastes about 1/3 of the battery voltage as heat, and it may even be overheating and shutting down.

Pololu has the best selection of modern motor drivers, for example, this one.

Pick a motor driver that can easily handle the start/stall current of your motor.

Hi, @saintsyt

Does your motor speed run fast enough when connected directly to the motors power supply?
What is your motor power supply?

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

thanks, but i can´t

but i solved this

Can't what?

Tom.. :grinning: :+1: :coffee: :australia:

ok thanks

How, please let us know your solution.

Tom.. :grinning: :+1: :coffee: :australia:

@saintsyt ,

I have closed your other topic on the same subject. Please do not create more than one topic on the same subject because it wastes the time of the volunteers trying to help you. If you continue to do so you risk a ban from the forum.

Thank you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.