Source: https://mokxi.com/motor-driver-simulator

Simulator

# A motor driver simulator: an L293D H bridge

Mokxi is a free online motor driver simulator that runs in your browser, with nothing to install and no account needed. An Arduino Uno drives a DC motor forward, brakes it, reverses it, lets it coast and runs it at half throttle, through an L293D H bridge on three pins. The shaft on the canvas turns with it.

Start building free or read the L293D tutorial

- 455 parts on the bench
- 43 boards running now
- 1.00x real time, on every board

Click to open it in the editor

Watch the motor go forward, brake, reverse and coast. Click the circuit to open it in the editor.

## What you can do here

In the circuit above, or in the editor it opens.

- Run a DC motor both ways from two direction pins and an enable
- Compare braking with coasting on the same motor
- Throttle it with analogWrite on the enable pin
- Measure the volts the driver keeps for itself
- Swap in an L298N, a TB6612, a DRV8833 or an L9110
- Build a two-wheel robot car on the same bench

## What the running circuit shows

Four switches in an H, and the volts they cost.

Pin 9 is EN12, the speed; pins 7 and 8 are IN1 and IN2, the direction. IN1 high and IN2 low is forward, the other way around is reverse, both the same is a brake, and the enable low lets go of both ends, which is coasting. The sketch runs forward for 2.5 s, brakes, reverses, coasts, then goes forward at half throttle.

In the engine the motor reaches about 60 rpm forward and −60 rpm in reverse, and the brake stops it within half a second. The motor is rated 200 rpm at 6 V, so why 60? The L293D’s Darlington outputs keep about 1.3 V each, one in the high side and one in the low, so out of 5 V the motor sees about 2.4 V (the engine has OUT1 at 3.71 V and OUT2 at 1.29 V), and a gear motor turns at well under half speed on under half its volts: part of what it gets goes on its own gearbox’s friction. At half throttle the average is about 1.2 V, too little to unstick the gearbox from rest, so the motor hums and does not turn. That dead band is why robot sketches have a minimum speed.

## How the driver and motor are simulated

A motor with back EMF, a driver with a datasheet drop.

The DC motor has a rated voltage and speed, a winding resistance, inertia, back EMF and the friction of its gearbox, so it speeds up and slows down rather than jumping, its speed follows the voltage it actually gets, and from rest it needs about 1.35 V to start. The L293D has its output drop and resistance as properties and the clamp diodes inside it, which is why this circuit needs none of the flyback diodes a single transistor driver does.

What it leaves out: the motor turns no load beyond its own gearbox, has no brushes and draws no stall current through the chip, and the driver does not heat up. The L293D’s 600 mA limit and its heat are real on a bench, and the reason bigger robots move to a MOSFET bridge like the TB6612.

L293D motor driver with Arduino L298N motor driver with Arduino Why a motor needs a flyback diode The stepper motor simulator

## Questions

Is it free?

Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.

Do I need an account?

No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.

Can I simulate an L298N motor driver?

Yes. The L298N module is in the parts bin with its regulator and enable jumpers, and a built-in robot car drives two motors on one from six Uno pins.

What is the difference between braking and coasting?

Braking holds both motor terminals at the same voltage, so the motor’s own back EMF is shorted through the driver and stops it fast. Coasting lets go of both terminals, so it winds down on its own.

Why does my motor turn slower than its rating?

The driver keeps some of the supply. An L293D keeps about 2.4 V of a 5 V supply, which is why the motor here turns at about 60 rpm instead of the speed on its label.

## More simulators

Each one opens on a circuit that is already running.

Online circuit simulator Breadboard simulator ESP32 simulator Op-amp simulator Logic gate simulator LED circuit simulator Servo simulator LCD simulator OLED simulator NeoPixel simulator 7 segment display simulator LED matrix simulator Stepper motor simulator Ultrasonic sensor simulator Rectifier simulator Digital circuit simulator Potentiometer simulator PWM simulator Relay simulator Shift register simulator DHT11 simulator RFID simulator Accelerometer simulator RGB LED simulator Buzzer simulator MOSFET simulator Circuit simulator for kids Flip-flop simulator Multiplexer simulator Full adder simulator I2C simulator UART simulator Thermistor simulator PIR sensor simulator Oscilloscope simulator Multimeter simulator DC motor simulator Traffic light simulator Diode simulator Capacitor simulator Series and parallel circuit simulator Wheatstone bridge simulator Voltage regulator simulator Soil moisture sensor simulator Zener diode simulator Solar panel simulator AC circuit simulator Thevenin simulator Decoder simulator Encoder simulator PID simulator Robot arm simulator Load cell simulator IR sensor simulator LM35 simulator HC-05 Bluetooth simulator nRF24L01 simulator

## Drive a motor both ways

Open the circuit, change the sequence and press Run. Nothing to install, and no account needed.

Start building free Open the editor
