Menu
Usage:
- L298n Motor Controller
- L298n Dual H-bridge Motor Controller Driver Servo Code For Free
- L298n Dual H-bridge Motor Controller Driver Servo Code For Pc
- L298n Motor Driver With Arduino
L298N Dual H Bridge Motor Driver is a motor controller breakout board which is typically used for controlling speed and direction of motors. It can also be used to control the brightness of certain lighting projects such as high powered LED arrays. L298N Driver. The L298N is a dual H-Bridge motor driver which allows speed and direction control of two DC motors at the same time. The module can drive DC motors that have voltages between 5 and 35V, with a peak current up to 2A.
H-Bridge's are typically used in controlling motors speed and direction, but can be used for other projects such as driving the brightness of certain lighting projects such as high powered LED arrays.
How it works:
An H-Bridge is a circuit that can drive a current in either polarity and be controlled by *Pulse Width Modulation (PWM).
* Pulse Width Modulation is a means in controlling the duration of an electronic pulse. In motors try to imagine the brush as a water wheel and electrons as a the flowing droplets of water. The voltage would be the water flowing over the wheel at a constant rate, the more water flowing the higher the voltage. Motors are rated at certain voltages and can be damaged if the voltage is applied to heavily or if it is dropped quickly to slow the motor down. Thus PWM. Take the water wheel analogy and think of the water hitting it in pulses but at a constant flow. The longer the pulses the faster the wheel will turn, the shorter the pulses, the slower the water wheel will turn. Motors will last much longer and be more reliable if controlled through PWM.
Pins:
- Out 1: Motor A lead out
- Out 2: Motor A lead out
- Out 3: Motor B lead out
- Out 4: Mo (Can actually be from 5v-35v, just marked as 12v)
- GND: Ground
- 5v: 5v input (unnecessary if your power source is 7v-35v, if the power source is 7v-35v then it can act as a 5v out)
- EnA: Enables PWM signal for Motor A (Please see the 'Arduino Sketch Considerations' section)
- In1: Enable Motor A
- In2: Enable Motor A
- In3: Enable Motor B
- In4: Enable Motor B
- EnB: Enables PWM signal for Motor B (Please see the 'Arduino Sketch Considerations' section)
Specifications:
L298n Motor Controller
- Double H bridge Drive Chip: L298N
- Logical voltage: 5V Drive voltage: 5V-35V
- Logical current: 0-36mA Drive current: 2A (MAX single bridge)
- Max power: 25W
- Dimensions: 43 x 43 x 26mm
- Weight: 26g
*Built-in 5v power supply, when the driving voltage is 7v-35v
L298N motor driver: Most of the microcontrollers operate on very low voltage (5v) and current while the motors require higher voltages andcurrent So, the microcontrollers cannot provide them such higher current. For this purpose we use motor driver ICs. Motor driver is a little current amplifier. It takes a low current signal and gives out a high current signal which can drive a motor. It can also control the direction of motor. Motor drives are of many kind depending upon the maximum supply voltage, maximum output current, rated power dissipation, load voltage and number outputs etc. Here we are going to discuss motor driver L298N. It is used indc motor speed control project and you can interface dc motor easy with microcontroller using this motor driver. and also in bluetooth controlled robot using pic microcontroller. you can check line follower robot for more about its applications.
Dance dance revolution songs download. DanceDanceRevolution is sure to be the life of the party and get you into shape with outrageous multiplayer fun, huge smash hit soundtrack, entirely new modes and more! Features • Work out to the beat using your DanceDanceRevolution Controller or now introducing compatibility with the Wii Balance Board for DanceDanceRevolution Hottest Party 3 • Exclusive gimmicks such as the Hip Roll and Bump Arrows appear in-game.
Page Contents
Features of L298 motor driver
L298N is an integrated circuit multi watt 15 package and capable of giving high voltage. It is a high current dual full-bridge driver which is designed as to accept standard TTL logic levels. It can drive inductive loads e.g relays, solenoids, motors (DC and stepping motor) etc.
Its basic features are:
L298n Dual H-bridge Motor Controller Driver Servo Code For Free
- Maximum supply voltage 46V
- Maximum output DC current 4A
- Low saturation voltage
- Over temperature protection
- Logical “0” Input Voltage up to 1.5 V
PIN DIAGRAM of L298N motor driver
The pin diagram in top view for L298N is given below:
L298N motor driver internal circuit
PIN DESCRIPTION of L298N motor driver
L298N consists of four independent power amplifiers. Two of them form H-bridge A while other two form H-bridge B. One H bridge is used to switch the polarity in controlling direction of DC motor. Pair of H Bridge is used to control a bi-polar stepper motor.
- Amp A1 and A2 => H Bridge A
- Amp B1 and B2 => H Bridge B
Basically L298N is used to drive inductive or magnetic loads, so there can come voltage spikes in output. To avoid that voltage spikes there should be some internal parasitic or Flywheel diodes. But it lacks them. We use externally these flywheel diodes. They can be 1N5819 schottky diodes or 1N4001 rectifier diodes.
Each bridge is provided with enable pins (ENA, ENB) and current sense pins (CSA, CSB). Current sense pins can be tied to ground but we can also insert low value resistor and its voltage reading is proportional to current. Both enable pins can be used at the same time which makes all for outputs active at the same time.All the four inputs and Enable pins work on 5v TTL logic which makes the connection easy with microcontrollers.
- ENA=5v, High logic (Amplifier A1 and A2 on)
- ENA=0v, Low logic (Amplifier A1 and A2 off)
- ENB=5v, High logic (Amplifier B1 and B2 on)
- ENB=0v, Low logic (Amplifier B1 and B2 off)
L298N motor driver working
L298n Dual H-bridge Motor Controller Driver Servo Code For Pc
Now consider an example. We will use H bridge motor diver IC L298N and two DCmotors. This IC is used to control these motors. What we want to do is to change the polarity of motors so they can run in either direction depending upon logic.
INPUTS:Four inputs are provided to the four power amplifiers of L298N. We can use push buttons and whenever specific push button is pressed, specific motor will start running. Two inputs will monitor each motor. Instead of push button, we can use logic toggle in proteus simulation for our ease.
Enable bits are used to select specific amplifier. ENA can select two amplifiers A1, A2 and similarly ENB can select two amplifiers B1, B2. While using as a bridge circuit, ENA selects bridge A and ENB selects bridge B. To drive both the motors by using H bridges, both enable bits are set high.
OUTPUTS: There are four outputs. The output for motor A is obtained from out1 out2 pins and similarly for motor Boutput is obtained from out3 out4 pins. L298N does not have built in protection diodes we usedexternal diodes to prevent the IC from getting damaged.
This IC is using two different voltages. On input side, 5v is given to the pin 9 (Vss), push buttons and enable bits.On output side,pin 4 (Vs) supplies the motors and it can be upto 46 volts.Here we are not using the current sensing scheme, so we have grounded those pins 1 & 15. Motors speed will be lower if low voltages are on output side.
simulation results of L298N motor driver
Enabling pin 6, if we give logic as:
Pin5=high, pin7 = low, motor A will start turning clockwise. Pin5=low, pin7 = high, motor A will start turning anticlockwise Pin5=high, pin7 = high, motor A will stop Pin5=low, pin7 = low, motor A will stop |
Enabling pin 11, if we give logic as:
Pin10=high, pin12 = low, motor B will start turning clockwise Pin10=low, pin12 = high, motor B will start turning anticlockwise Pin10=high, pin12 = high, motor B will stop Pin10=low, pin12 = low, motor B will stop |
In this example of proteus, we used toggle inputs. We can also change the toggle input settings in start if we have to run the motor continuously.In using push buttons, on side of buttons is attached with power supply and others are attached with inputs of L298N. As long as the button is pressed, the motor will keep running in specified direction according to the logic given through the button. Also use the heat sinks when doing practically.
Video lecture on L298N dc motor driver
Circuit diagram of L298N motor driver
L298n Motor Driver With Arduino
Here we have simulated the above example. At the present state, both motors are running in clockwise direction. If I invert both the logics, they will run in anti-clockwise direction. And if same logic is given to any motor’s input, it will not be able to move in either direction and will stop.