


- #L298N MOTOR DRIVER WITH HOVERBOARD WHEELS DRIVERS#
- #L298N MOTOR DRIVER WITH HOVERBOARD WHEELS FULL#
- #L298N MOTOR DRIVER WITH HOVERBOARD WHEELS CODE#
This condition is called shoot-through and can damage the MOSFETs or transistors. Likewise if switches S2 and S3 are closed, current will flow from right to left and the motor rotates in the opposite direction.ĭo not switch on S1 and S2 together or S3 and S4 together. When switches S1 and S4 are closed the current will flow from left to right through the motor which makes the motor rotate in a particular direction, in this case clockwise. You can refer to the diagram below to see how the H-Bridge works. When two of these switches are activated at the same time in a particular format, the direction of flow of current is changed which then changes the direction of rotation of the motor. How an H-Bridge works.Īn H-Bridge consists of four MOSFETs or Transistors wired as switches. This is achieved using an H-bridge circuit which is used for switching the polarity of a voltage applied to a load like a motor in this case. The direction of rotation of a motor is determined by the direction of flow of current through the motor.
#L298N MOTOR DRIVER WITH HOVERBOARD WHEELS FULL#
When the duty cycle is 100%, the pulse is constantly HIGH and the motor receives full power and spins at its rated output speed while a duty cycle of 0% means the pulse signal is constantly LOW therefore no voltage across the motor and the motor will stop rotating. The duty cycle is given in percentage and the higher the duty cycle, the higher the voltage across the motor which also increases the speed of rotation. The voltage applied to the motor determines the speed of rotation of the motor by varying the width of this square wave called a duty cycle. PWM enables us to control the voltage applied to the motor in form of square wave pulses with a certain frequency. These techniques are explained in detail below. The L298N motor driver controls the speed of rotation of a dc motor using PWM signals and the direction of rotation is determined by an H-bridge. If you want to control the speed of motors, you need to remove the jumpers and connect them to PWM-enabled pins on Arduino. When the jumper is in place, the motor is enabled and spins at maximum speed. These pins usually come covered with jumpers. The Enable pins ENA and ENB are speed control pins for motor A and B respectively. Input pins IN1, IN2, IN3 and IN4 are for controlling the direction of rotation of the motors where IN1 and IN2 control the direction of rotation of motor A while IN3 and IN4 control direction of rotation of motor B. In this case the 5V pin will be used as input as we need to connect it to a 5V power supply in order for the IC to work properly. However if the supply voltage is greater than 12V the jumper should be disconnected to avoid destroying the onboard 5V regulator. If the motor supply voltage to the module is up to 12V, the 5V regulator is enabled so that we can use the 5V pin as output for powering a microcontroller like an Arduino board.

This voltage is controlled by either enabling or disabling a jumper. The driver can drive motors with voltages from 5V to 35V with a peak current of 2A. The module has an onboard 5V regulator for controlling the voltages supplied and used by the motor connected to the L298N motor driver. The diagram below shows the pin out of this motor driver. There is also a power supply screw terminal block containing the Ground pin, the VCC for motor and a 5V pin which can either be an input or output. The L298N motor driver module has two screw terminal blocks for the connecting two motors A and B. In this tutorial I will show you how the L298N motor driver works and how it can be used to control the speed and direction of rotation of DC motors using Arduino.
#L298N MOTOR DRIVER WITH HOVERBOARD WHEELS DRIVERS#
Motor drivers are therefore needed to convert the low-current control signals to a higher-current signal that can drive the motor.

This is because motors use high currents while microcontroller circuits work on low current signals. The main challenge with using these motors with microcontrollers is that they cannot be connected directly to the microcontroller I/O pins.
#L298N MOTOR DRIVER WITH HOVERBOARD WHEELS CODE#
Code for running the DC motor using L298N motor driver.ĭc motors are used in a number of applications especially robotics.DC motor control using the L298N motor driver and Arduino.Direction of Rotation control using H-Bridge.
