These assumes you are following the same Fritzing diagram above. Here’s a table that summarizes the pins and corresponding motor direction. To reverse the direction, reverse the pulses to IN1 and IN2. If you want the left motor to rotate in one direction, apply a high pulse to IN1 and a low pulse to IN2.
#L298N MOTOR DRIVER WITH SENSORS DRIVER#
Here is a wiring diagram for connecting two DC motors to the L298N driver board. Speed control for Motor A and Motor B is achieved via PWM on these pins. Remove these jumpers if you are using DC motors and keep it for stepper motors. There are also two other jumpers on the board, as shown. Specifically, motor A connects to terminals 1 and 2 while Motor B connects to terminals 3 and 4. The motor terminals connect to Motor Terminals 1, 2, 3, 4. You have Motor A inputs and Motor B inputs. This means the +5V terminal is not for powering the board but for connecting a device, say Arduino, that needs a 5V source. When the +12V jumper is attached, the on-board voltage regulator is now enabled, and you can source +5V from the +5V terminal. This pin can accept voltages from +7VDC to +35VDC. The +12V pin is where the motor power is attached. The controller board, shown above, has +12V and +5V terminals. Using a breakout board is easier for prototyping compared to using the IC. All you need to do is apply signals to the inputs to make the motor(s) rotate to a certain direction. If new user signup today from this link JLCPCB you will get 27$ coupon from JLCPCB.Īs already mentioned, the L298N has four inputs corresponding to the four switches in the H-bridge diagram above. You can also try there new purple colour for PCB without any extra cost. PCB manufacturer, you can also try there PCB service for more details you can visit their website JLCPCB.COM There PCB quality is best in market, now I always go with PCB for my project and JLCPCB.COM is my trusted Like breadboard or Zero PCB earlier I also was in the same boat, I hesitate to try custom PCB my belief was they are much expensive.īut then I came to know about JLCPCB.COM and I was totally surprised how low price PCB's are they offering Yes PCB are the heart of the electronics based project usually we hesitate to try custom PCB and opt to homemade solutions
More information about the L298N IC is found on its datasheet:īefore moving fuurther I would like to tell you something about PCB This means you can power high voltage motors while controlling them with microcontrollers. The most notable feature here is its high power supply although its input pins follow lower voltage levels. The diagram above shows an example diagram for using the L298N to drive one DC motor. To drive the motor counter clockwise, the pin Input 1 is low while the pin Input 2 is high. To drive a motor to a direction, say, clockwise, the pin Input 1 must be high while the pin Input 2 must be low. The Enable A pin must be high to turn on the motor. For example, if a motor is using channel A, its terminals must be connected to pins Out 1 and Out 2. This IC drives two motors through two channels, A and B. It comes in two IC packages: MultiWatt15 and PowerSO20. The L298N is an integrated circuit that follows the H-bridge concept. This is very significant especially when using an Arduino board where the 5V power source is simply not enough for two DC motors. The other benefit of using an H-bridge is that you can provide a separate power supply to the motors. On the other hand, when S2 and S3 are on, the right motor terminal is more positive than the left motor terminal, making the motor rotate in the other direction. When S1 and S4 are on, the left motor terminal is more positive than the right terminal, and the motor rotates in a certain direction. Here, the motor rotates in the direction dictated by the switches. The L298N motor controller follows the H-bridge configuration, which is handy when controlling the direction of rotation of a DC motor. This is where the L298N motor controller comes in. Obviously, you can’t drive loads that require much more current like a motor.
There’s no problem there because the 20 mA or so current from the pins is enough. You can drive a LED on or off using a microcontroller like Arduino or PIC.