L298N Motor Driver Library for Proteus Simulation: an Arduino UNO V4.0, the L298N board and two 12 V gear motors

L298N Motor Driver Library for Proteus Simulation

2 Views
40
700
60
25
60
PCBWay

Hello friends, I hope you all are doing great. Today, I am going to share the new L298N Motor Driver Library for Proteus Simulation. The L298N is the red board with the big black heatsink that sits in almost every first robot kit: two H-bridges on one ST L298 chip, so a single Arduino can drive two DC motors forward and backward and set their speed with PWM. It is simple, sturdy and cheap - and it has habits every maker should know, from the voltage it swallows to the jumpers that decide where its 5 V comes from. With this library you can run a full Proteus simulation of the L298N: its truth table, the speed from a PWM on ENA and ENB, braking and coasting, the drop in its bipolar outputs, the onboard regulator and the heat on the heatsink.

L298N Motor Driver Library for Proteus simulation demo: an Arduino UNO drives a winch motor and a free motor through the L298N with PWM, brake, reverse and coast
Figure: The L298N simulation running: soft start, full speed, brake, lowering, reverse and coast.
Updates

L298N Motor Driver Library for Proteus

Latest version: V1.0 (November 2026, this tutorial)

Helping Tools

The board drives real motor models on the sheet. The demo connects two of our 12 V planetary gear motors: one lifts a weight on a winch, the other turns freely, and an Arduino runs them through a sequence of soft start, brake, lowering and reversing.

NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the motor driver board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the L298N Motor Driver Library for Proteus Simulation:

L298N Motor Driver Library for Proteus Simulation: an Arduino UNO V4.0, the L298N board and two 12 V gear motors
Figure: The L298N Motor Driver Library for Proteus Simulation.

What Is the L298N Motor Driver?

The L298 is a dual full-bridge driver from ST in a 15-pin Multiwatt package. Each of its two bridges has four bipolar transistors: two that connect an output to the supply and two that connect it to ground. With a motor between the two outputs of a bridge, the chip can push current through it either way. The common L298N board adds what the chip needs around it: a heatsink, eight flyback diodes, two filter capacitors, a 78M05 regulator for the logic, screw terminals for the motors and the supply, and a header for the six control pins.

The L298N at a glance
L298N motor driver board
ChipST L298, two H-bridges (bipolar Darlington outputs)
Motor supply5 - 35 V with the 5V-EN jumper, up to 46 V without
Current2 A per bridge continuous, 3 A short peaks
Lossabout 2 V at 1 A, more at higher current
ControlENA IN1 IN2 for motor A, ENB IN3 IN4 for motor B
Usestwo DC motors, one stepper, robot cars, winches

The Truth Table

Each bridge has three inputs. The enable pin, ENA or ENB, switches the whole bridge on or off. With the enable high, the two inputs choose the direction: IN1 high and IN2 low turn motor A one way, IN1 low and IN2 high turn it the other way. When IN1 and IN2 are equal, both outputs are at the same voltage and the motor is shorted through the chip - the datasheet calls this a fast motor stop, and it brakes the motor hard. With the enable low, all four transistors are off and the motor is free to coast to a stop. The same table applies to bridge B with ENB, IN3 and IN4.

Speed: PWM on the Enable or on the Inputs

A PWM signal sets the speed. The board gives you two places to put it. With the ENA jumper removed and ENA on a PWM pin, the bridge drives during the high part of each period and switches completely off during the low part; the motor current then flows back through the board's diodes against the supply, and dies away quickly. That is called fast decay - the motor coasts in every off time. A PWM on IN1 with IN2 held low and ENA high works differently: in the off time both outputs are low, the motor is shorted, and its current keeps circulating. That is slow decay - the motor brakes in every off time, so its speed follows the duty cycle more closely, especially at low speeds. Most tutorials use the enable pins, and so does our demo.

The 2 V the L298 Keeps for Itself

The L298 is an old bipolar design. Its output transistors are Darlington pairs, and a Darlington never switches fully on: the upper one drops about a volt, the lower one a little less, and both drop more as the current rises. The datasheet gives a total of about 1.8 V at 1 A and up to 3.2 V; at 2 A it can be almost 5 V. So a 12 V supply gives a motor only about 10 V, and the missing power turns into heat on the heatsink. Modern MOSFET drivers like our DRV8833 Motor Driver Library for Proteus lose a fraction of a volt instead - but they cannot take 46 V or the abuse an L298N survives.

The Jumpers: 5V-EN, ENA and ENB

Three jumpers change how the board works. The 5V-EN jumper connects the 78M05 regulator: fitted, the board makes its own 5 V from the motor supply, and the 5V terminal becomes an output you can use for a small load. The regulator needs about 7 V at its input and should not get more than 12 V on this board, because it heats up; above 12 V, remove the jumper and feed 5 V into the 5V terminal instead. The ENA and ENB jumpers tie the enable pins to 5 V: with them fitted the bridges are always enabled and only IN1 to IN4 matter; remove them when you want PWM speed control on ENA and ENB.

A Model That Follows the Datasheet

The library models the board, not just the chip. Every input is measured edge by edge, so a PWM is recognised by its period and duty cycle, and a steady level by its value. Each bridge then chooses its mode from the truth table and drives its two outputs at the average voltage of the PWM, including the saturation drops - 0.8 V on the upper side and 0.6 V on the lower side plus 0.3 ohm each. In fast decay the bridge lets go as soon as the motor's current would reverse, and the board's diodes take over, just as they do on real hardware. The heatsink warms up with the losses, the 78M05 supplies the logic or does not, and the board's red PWR LED shows whether the logic has its 5 V. Because the L298 has no current limit, the model does not invent one: it reports currents over 2 A continuous and over the 3 A peak, and lets the heat rise until the over-temperature protection switches the bridges off.

Features of the L298N Motor Driver Library for Proteus Simulation

  • A real-looking board: the 43 x 43 mm L298N at its real size, the L298 and its finned heatsink, the 78M05, the capacitors, the eight diodes, the blue terminals and the header with its jumper seats.
  • The truth table: forward, reverse, fast stop with the inputs equal, free running with the enable low.
  • Two kinds of PWM: on ENA / ENB for fast decay, on IN1 - IN4 for slow decay, recognised from the signal itself.
  • The real losses: the Darlington drops that leave a 12 V motor with about 10 V, the board's diodes, the heat on the heatsink.
  • The jumpers: 5V-EN for the onboard regulator, ENA and ENB for the enables - as properties of the part.
  • A pop-up: the two H-bridges with each switch's share of the time, the truth table lit, the board's supplies and jumpers, and eight tiles - graphs, an event log and a check page.
  • A complete package: about 1.6 MB with the library, our gear motor, our Arduino UNO V4.0 and the demo, without the source code of the model.

The L298N in Proteus

The device is L298NDRIVERTEP in TEPL298N.LIB, under Electromechanical > Motor Drivers, with the prefix U and the model TEPL298N.DLL. Search L298N or motor driver in Pick Devices. The pins sit where the terminals are on the board: OUT1 and OUT2 on the left, OUT3 and OUT4 on the right, and along the bottom 12V, GND and 5V, then ENA, IN1, IN2, IN3, IN4 and ENB. Three properties stand for the jumpers: REG5V, ENAJUMPER and ENBJUMPER, each YES (fitted) or NO.

L298N dual H-bridge motor driver board from the L298N Library for Proteus Simulation
Figure: The L298N motor driver board.

Download L298N Motor Driver Library for Proteus Simulation

Click the button below to download L298N-Motor-Driver-Library-for-Proteus-v1.0.zip (about 1.6 MB, without the source code of the models):

L298N Motor Driver Library for Proteus V1.0
  • README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
  • Proteus Library Files: TEPL298N.LIB, TEPPLANETARY.LIB and ArduinoV4TEP.LIB.
  • Proteus Model Files: TEPL298N.DLL, TEPPLANETARY.DLL and TEPARDUINO.DLL.
  • Arduino Code: the demo sketch (no library).
  • Proteus Simulation: the demo project, its HEX file and copies of the DLLs.

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install L298N Motor Driver Library for Proteus Simulation

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
  3. Copy the files from Proteus Model Files into the MODELS folder.
  4. Delete TEPL298N.IDX from the LIBRARY folder if it is there.
  5. Start Proteus, press P and search for L298N.

Proteus Simulation of Two Gear Motors

The demo uses an A3 sheet with our Arduino UNO Library for Proteus V4.0, the L298N and two 36GP-555 gear motors from our Planetary Gear Motor Library for Proteus. ENA goes to D9, IN1 to D8, IN2 to D7, IN3 to D5, IN4 to D4 and ENB to D10; D9 and D10 give a 490 Hz PWM. The board gets 12 V on its +12V terminal, the 5V-EN jumper is fitted (REG5V YES) and the ENA / ENB jumpers are off, so the speed comes from the pins. Motor A, M1, has a winch on its shaft with a 1 kg weight; motor B, M2, turns freely. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open L298N-Two-Gear-Motors-ArduinoUnoV4.pdsprj.

L298N simulation in Proteus: an Arduino UNO V4.0, the L298N board and two 12 V planetary gear motors on an A3 sheet
Figure: The whole simulation on an A3 sheet.

The Sketch

The sketch needs no library. Two small functions set a motor's two inputs and its enable PWM:

void motorA(bool in1, bool in2, byte speed) { digitalWrite(IN1, in1); digitalWrite(IN2, in2); analogWrite(ENA, speed); }

A geared motor with a load draws several amps if you give it full voltage from standstill, so motor A starts with a ramp - the duty climbs from 0 to 100 % in 1.6 s:

  for (int s = 0; s <= 255; s += 17) { motorA(HIGH, LOW, s); delay(100); }   // a ramp: no 5 A start-up spike

Motor B runs at 60 % with a PWM on ENB:

  motorB(HIGH, LOW, 153);

A brake is both inputs low with the enable high - the fast motor stop of the truth table:

  motorA(LOW, LOW, 255);

Lowering the weight is the other direction at half speed, and coasting is simply the enable low:

  motorA(LOW, HIGH, 128);
  motorA(LOW, LOW, 0);

L298N Simulation Results

Open the project and press Run. The demo runs 9.0 simulated seconds and took about three minutes on our PC with the pop-ups open and the pictures being taken. Click the L298N for its pop-up, or either motor for its own. Every number below comes from one simulation run, the demo exactly as it ships.

The Soft Start

The 78M05 brings the logic up at once: 4.99 V on the 5V terminal, the PWR LED lit, the logic drawing about 27 mA. Both bridges start in free running, because the Arduino holds ENA and ENB low. At 0.24 s the sketch starts the ramp: the L298N recognises a 490 Hz PWM on ENA, and bridge A runs forward with fast decay at 7 % - 0.56 V and 0.25 A at the motor. A second later the duty is 40 %: 3.86 V and 0.64 A, and the weight is already moving.

Full Speed and the 2 V Drop

At 1.86 s the ramp reaches 100 % and ENA is simply high: bridge A is in FORWARD. Motor A gets 10.22 V at 0.64 A - the other 1.78 V of the 12 V supply stays in the L298, exactly the drop the datasheet warns about. The winch's pop-up shows the result: 1 kg rising at 27.8 cm/s, the shaft at 177 RPM, 6.5 W going in and 2.7 W of it lifting the weight.

At 2.14 s motor B starts at 60 % with a PWM on ENB: 5.93 V and 0.71 A at first, then, as the free motor speeds up, 6.26 V and only 0.17 A. Its speed follows the duty because nothing loads it.

L298N Proteus simulation pop-up: motor A forward at full speed, motor B at 60 % PWM on ENB
Figure: Motor A full on, motor B at 60 %.
L298N Proteus simulation: the 36GP-555 winch motor lifting its 1 kg weight at 27.8 cm/s
Figure: The winch lifting its weight.

Brake, Lower and Reverse

At 3.14 s the sketch brakes motor A - IN1 and IN2 low with ENA high. The motor, still turning at full speed, becomes a generator shorted through the bridge: for a moment over 3 A flow, and the model reports it as over the L298's 3 A peak. Then the current settles at -0.46 A with 0.27 V across: the brake holds the weight, which leans on the gearbox. This is why braking a large motor from full speed deserves care on a chip without a current limit.

At 4.14 s motor A turns the other way at 50 %, with fast decay. The start is another short peak over 3 A, then the weight takes over: it drives the motor down, and the bridge lets go in every off time, so the motor sees an average of -5.32 V with almost no current. The winch lowers the weight at the speed the PWM allows.

L298N Proteus simulation pop-up: motor A lowering the weight at 50 % with fast decay
Figure: Lowering at 50 %, fast decay.

Motor B is braked at 5.14 s and reversed at full speed at 5.64 s. Starting from standstill at full voltage gives the third peak over 3 A; a moment later the motor is at speed with -10.49 V and -0.19 A. The drop is smaller here, 1.51 V, because the current is lower.

L298N Proteus simulation: the L298N board driving two 12 V planetary gear motors
Figure: The board and the two motors.
The L298N motor driver simulation running in the Proteus workspace
Figure: The simulation in the workspace.
L298N Proteus simulation: motor B turning freely in reverse at full speed
Figure: Motor B in reverse.

Coasting

At 6.64 s ENA goes low: free running. The bridge opens completely, and the weight, no longer held, turns the motor as it falls - the voltage at the motor's terminals is now its own back-EMF. At 8.14 s motor B coasts too. Through the whole run the heatsink stays near 25.6 C: at these currents the L298 loses well under a watt.

The Graphs, the Event Log and the Check Page

The Graphs page plots both motor currents, motor A's voltage and the heatsink. The Event log lists every mode each bridge took with its voltage and current, the PWM frequencies and the peaks. The Check page sums up the run: 12V at 12.00 V, the 5V logic at 4.99 V from the 78M05, both bridges within their 2 A rating with the short peaks noted, the jumpers as set - 5V-EN fitted, ENA and ENB off - and the heatsink at 25.6 C at most.

L298N Proteus simulation graphs: the two motor currents, motor A voltage and the heatsink
Figure: The Graphs page.
L298N Proteus simulation Event log: every mode of both bridges and the current peaks
Figure: The Event log.
L298N Proteus simulation Check page after the demo run
Figure: The Check page.

The Arduino's monitor lists the steps with their times.

Arduino UNO V4.0 serial monitor in the L298N Proteus simulation: the steps of the two motors
Figure: The Arduino's monitor.

L298N or a MOSFET Driver?

The L298N is forgiving and handles up to 46 V, which makes it a good first driver and a good choice for 12 - 24 V motors that draw under an amp or so. For small motors on batteries, the 2 V it keeps is a real loss: a 6 V supply would leave a TT motor with 4 V. Our DRV8833 Motor Driver Library for Proteus and similar MOSFET drivers lose a fraction of a volt and stay cool, but they work only up to about 10 V. Choose by voltage and current: L298N for higher voltages and rough handling, a MOSFET driver for low voltages and efficiency.

Try It Yourself

  • Fit the ENA jumper (ENAJUMPER YES): motor A ignores the PWM and runs at full speed whenever IN1 and IN2 differ.
  • Remove the 5V-EN jumper (REG5V NO) without feeding 5 V: the logic has no power and nothing moves.
  • Change motor A's MASS to 3 kg and watch the current and the drop grow.
  • Put the PWM on IN1 instead of ENA (ENA steady high): slow decay, and the motor holds its speed better at low duty.
  • Remove the ramp and start motor A at full speed: the start becomes a peak over 3 A.

Ideas to Extend the Demo

  • A robot car: two motors, forward, turn by slowing one side, spin by reversing one.
  • A winch with end switches that stop the motor at the top and the bottom.
  • A speed control with a potentiometer on A0 setting the PWM on ENA.

Your Own Sketches

The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.

Things to Know Before Using a Real L298N

  • Common ground: the Arduino's GND must be connected to the L298N's GND.
  • Supply: feed about 2 V more than the motors need; keep the 5V-EN jumper only up to 12 V.
  • Current: 2 A per bridge with the heatsink; there is no current limit - stalls and hard reversals are on you.
  • Heat: at 1 - 2 A the heatsink gets too hot to touch; give it air.
  • Jumpers: remove ENA / ENB jumpers for PWM speed control; keep them for full speed with IN pins only.

Troubleshooting

  • The motors do not turn: ENA / ENB jumpers off with ENA / ENB low, no 5 V for the logic, or no common ground.
  • The motor is weaker than expected: the L298 keeps about 2 V - check "LOST IN THE L298" in the pop-up.
  • Over 3 A peaks: a start, a reversal or a brake at full speed - ramp the PWM, slow down before reversing.
  • The motor turns the wrong way: swap IN1 / IN2 in the sketch, or swap the motor's wires.
  • The part is not simulated: TEPL298N.DLL is missing from MODELS and from the project folder.

Limitations of the Simulation

  • The truth table, the PWM modes, the saturation drops, the board's diodes, the 78M05 and the jumpers follow the L298 datasheet and the board's circuit; the board is our own drawing.
  • Our own choices: 0.8 V + 0.6 V + 0.3 ohm a side, the heatsink's 18 K/W and 8 J/K, off at 150 C, open inputs read low, a PWM recognised after one period.
  • Not modelled: the SENSE pins (tied to GND on the board), switching transients, the 78M05's own heat, the motors' inductance in the driver's averaging.
  • Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the chip's maker.
  • Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.

So, that was all about the L298N Motor Driver Library for Proteus Simulation. I hope it helps you see what happens between your sketch and your motors - the PWM, the brake, the coast and the volts the L298 keeps for itself - before you wire the first real robot. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!


Comments

0

Join the conversation