Control Peristaltic Pumps with Arduino Mega and L298N

Hi huys,

I'm really new to this kind of designs. I want to control the following peristaltic pump

using the following L298N driver I already bought.

Could someone please tell me how to connect everything? an schematic of the connection would be really appreciated.

Thanks you very much.

These driver dinosaurs consume up to 4V from the supplied voltage. You have to increase the driver voltage by that amount.

For only one flow direction you can use a single logic level MOSFET to control a pump and have no voltage drop..

I bought this power supply source to power my circuits.

@juanmn95

You seem to have a similar topic already open

I recommend the MOSFET circuit in that topic
Don't understand why you bought a L298

Hi,

L298 has the Problem with 5 V, which is solved:

This simple sketch I tested successfully with L298 and 5V:

//  Test mit 5V und Gleichstrommotor am 23.6.24
// Gleichstrommotor 1

int GSM1 = 10;
int in1 = 9;
int in2 = 8;

// Gleichstrommotor 2

/*int GSM2 = 5;
int in3 = 7;
int in4 = 6;*/

void setup()
{
  pinMode(GSM1, OUTPUT);    
  // pinMode(GSM2, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  // pinMode(in3, OUTPUT);
  // pinMode(in4, OUTPUT);
}
void loop()
{
  digitalWrite(in1, HIGH);  // Motor 1 beginnt zu rotieren
  digitalWrite(in2, LOW);

   analogWrite(GSM1, 150);   // Motor 1 soll mit der Geschwindigkeit "200" (max. 255) rotieren bei 12V mit Testmotor 50
/*
   digitalWrite(in3, HIGH);  // Motor 2 beginnt zu rotieren
   digitalWrite(in4, LOW);
   

  analogWrite(GSM2, 200);   // Motor 2 soll ebenfalls mit der Geschwindigkeit "200" (max. 255) rotieren
  */
  delay(2000);

  digitalWrite(in1, LOW);   // Durch die Veränderung von HIGH auf LOW (bzw. LOW auf HIGH) wird die Richtung der Rotation verändert.
  digitalWrite(in2, HIGH);  
  /*digitalWrite(in3, LOW);
  digitalWrite(in4, HIGH); */
  delay(2000);

  digitalWrite(in1, LOW);   // Anschließend sollen die Motoren 2 Sekunden ruhen.
  digitalWrite(in2, LOW);  
  /*digitalWrite(in3, LOW);
  digitalWrite(in4, LOW);*/

  delay(2000);
}

As your peristaltic pump is working only in 1 direction, I too strongly recomend a mosfet driver, such as this:


They work very well and are cheap.
For distributing 5V a small switching power supply would have been easier to drive your pump and logic. Please be aware, that supplying 5V to arduino at the external power input is to small to reach 5V. You have to supply through USB input.
Best regards Andy

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