kasceio.blogg.se

L298n motor driver
L298n motor driver













l298n motor driver

l298n motor driver

We are going to make a little program that moves the motors in both directions, forward and backward, and in opposite directions of each other, also varying the speed of movement. Now we are in a position to start programming. The assembly scheme that we are going to use is going to be the following one, although you can use the pins that you want whenever we respect that those that we connect to ENA and ENB are PWM. If we have the jumpers in place, the motors will rotate at the same speed. We will connect them to two Arduino PWM outputs so that we send a value between 0 and 255 that controls the speed of rotation. To control the speed of the motors we have to remove the jumpers and use the ENA and ENB pins. And the same with pins IN3 and IN4 and engine B. They work so that if IN1 is at HIGH and IN2 at LOW, motor A turns in one direction, and if it is IN1 to LOW and IN2 to HIGH it does to the other. The pins IN1 and IN2 are used to control the direction of rotation of the motor A, and the pins IN3 and IN4 of the motor B. If it were not so, we would have to reverse the connections. Keep in mind the polarity when connecting them, so that when later we make them move forward, they work as they should.

l298n motor driver

The outputs for engines A and B will give us the energy to move the engines. In this session we are going to focus on the control of DC motors. The other connections are used in one way or another depending on whether we are going to drive two DC motors or a stepper motor.

  • In addition the regulator only works with voltages up to 12V in Vin, above this value we will have to remove the jumper and feed the logical part of the module from another source.
  • Watch out! If we introduce current by logic V with the regulation jumper set, we could damage the module.
  • If we remove the jumper we will deactivate the regulator, we will need to feed the logical part of the module, so we will have to put a voltage of 5V through the V logic connection for the module to work.
  • If the regulator jumper is closed we will activate the voltage regulator of the L298N, and in V logic we will have a 5V output, which we can use for what we want, for example to power an Arduino board.
  • It is a module that is widely used in robotics projects, for its ease of use and its low price. Of course, this regulator only works if we feed the module with a maximum voltage of 12V. In addition, the L298N includes a voltage regulator that allows us to obtain a voltage of 5V from the module, perfect for powering our Arduino. When it is time to feed it, it is necessary to take into account that the electronics of the module consume about 3V, so the motors receive 3V less than the voltage with which we feed the module. The voltage range in which this module works ranges from 3V to 35V, and an intensity of up to 2A. We have talked about them before, but basically an H-bridge is a component formed by 4 transistors that allows us to reverse the direction of the current, and in this way we can reverse the direction of rotation of the motor.

    L298N MOTOR DRIVER DRIVER

    The L298N H-bridge driver board module allows us to control the speed and direction of two DC motors or a stepper motor in a very simple way, thanks to the 2 H-bridge it is mounted on.















    L298n motor driver