As long as the button is pressed, the motor will keep running in specified direction according to the logic given through the button. 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. In this example of proteus, we used toggle inputs. Pin10=low, pin12 = low, motor B will stop Pin10=high, pin12 = high, motor B will stop Pin10=low, pin12 = high, motor B will start turning anticlockwise Pin5=high, pin7 = high, motor A will stopĮnabling pin 11, if we give logic as: Pin10=high, pin12 = low, motor B will start turning clockwise Pin5=low, pin7 = high, motor A will start turning anticlockwise Pin5=high, pin7 = low, motor A will start turning clockwise. Example of L298N module to control motor direction Motors speed will be lower if low voltages are on output side. 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. This IC is using two different voltages.L298N does not have built in protection diodes we usedexternal diodes to prevent the IC from getting damaged. The output for motor A is obtained from out1 out2 pins and similarly for motor Boutput is obtained from out3 out4 pins. To drive both the motors by using H bridges, both enable bits are set high. While using as a bridge circuit, ENA selects bridge A and ENB selects bridge B. ENA can select two amplifiers A1, A2 and similarly ENB can select two amplifiers B1, B2. Enable bits are used to select specific amplifier.Instead of push button, we can use logic toggle in proteus simulation for our ease. We can use push buttons and whenever specific push button is pressed, specific motor will start running.
ENB=0v, Low logic (Amplifier B1 and B2 off) L298N motor driver module working.ENB=5v, High logic (Amplifier B1 and B2 on).ENA=0v, Low logic (Amplifier A1 and A2 off).ENA=5v, High logic (Amplifier A1 and A2 on).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. Current sense pins can be tied to ground but we can also insert low value resistor and its voltage reading is proportional to current. They can be 1N5819 schottky diodes or 1N4001 rectifier diodes.Įach bridge is provided with enable pins (ENA, ENB) and current sense pins (CSA, CSB). To avoid that voltage spikes there should be some internal parasitic or Flywheel diodes. Pair of H Bridge is used to control a bi-polar stepper motor.īasically L298N is used to drive inductive or magnetic loads, so there can come voltage spikes in output. One H bridge is used to switch the polarity in controlling direction of DC motor. Two of them form H-bridge A while other two form H-bridge B. L298N consists of four independent power amplifiers. The pin diagram in top view for L298N is given below: Motor Driver Internal Circuit Logical “0” Input Voltage up to 1.5 V PIN DIAGRAM of L298N.It can drive inductive loads e.g relays, solenoids, motors (DC and stepping motor), etc. It is a high current dual full-bridge driver that is designed to accept standard TTL logic levels. L298N is an integrated circuit multi watt 15 package and capable of giving high voltage. Circuit diagram to control 2 motors with L298N Features of the L298N motor driver Module.Example of L298N module to control motor direction.
Features of the L298N motor driver Module.