Simulator

A buck converter simulator: an LM2596 module feeding an Arduino

Mokxi is a free online buck converter simulator that runs in your browser, with nothing to install and no account needed. A 12 V adapter on a barrel jack, an LM2596 step-down module set to 5 V, and an Arduino Uno running from the module’s output while it measures the adapter through a divider. Swap the adapter and the 5 V rail stays where it is.

  • 505parts on the bench
  • 45boards running now
  • 1.00xreal time, on every board
LM2596: 12 V stepped down to 5 V for an Unolive0.000 s 0.00x
Click to open it in the editor
Click the circuit to open it in the editor. The serial monitor prints the adapter’s voltage as the Uno measures it; change the adapter on the barrel jack to 9 V and watch the 5 V rail hold.

What you can do here

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

  • Step 12 V or 9 V down to a steady 5 V
  • Power an Arduino Uno from the module’s output through its 5V pin
  • Measure the adapter’s voltage on A0 through a 10 k and 4.7 k divider
  • Swap the adapter between 12 V and 9 V and watch the output hold
  • Probe the input and the output with a multimeter
  • See why a pin cannot read 12 V directly, and what the divider does about it

What the running circuit shows

12 V in, 5.00 V out, and a board that measures its own supply.

The module’s output sits at 5.00 V and the Uno runs from it on its 5V pin. To watch the adapter, a 10 k resistor over a 4.7 k resistor divides the 12 V down to 3.84 V on A0, safely under the pin’s 5 V limit. The sketch reads a count of 785 and prints “A0 785, adapter 12.0 V”.

Swap the barrel jack’s adapter for a 9 V one. A0 falls to 2.88 V and the line becomes “A0 589, adapter 9.0 V”, but the module’s output is still 5.00 V and the board never notices. That is the job of a regulator: the input moves, the output does not.

How the LM2596 module is modeled

The regulation, without the switching.

The model keeps what matters when you plan a build: it takes 4.5 to 40 V in, its output can be set from 1.23 V up, the output is always below the input, and under 4.5 V in it gives nothing. A real module is about 86 percent efficient taking 12 V down to 5 V at 1 A, which is why it stays cool where a 7805 linear regulator would need a heatsink.

What it leaves out is the switching itself. A real LM2596 chops the input at 150 kHz and its output carries some ripple; here the output is smooth. Soft start and heat are not modeled either. On a real module, always set the trimmer with a meter before you connect a board: they often ship set well above 5 V.

How it works

Three steps from a blank tab to a running circuit.

  1. Open the editor

    It runs in your browser tab. Nothing to install, and you need no account to start.

    Your first project
  2. Wire it and write the code

    Drag parts onto a breadboard, run each wire from pin to pin, and write the sketch beside it.

    Wiring
  3. Press Run

    Your sketch compiles in the tab and runs on a model of the chip, with the Serial Monitor beside it.

    Run and serial
Reviews

What makers say about Mokxi.

“The AI checker helps check and correct my circuits, and it has way more components than Tinkercad. As a student I really appreciate the tool.”

ChloeEngineering student

“I’d been looking for a real online electronic simulator that was intuitive and complete when I found Mokxi. I was able to quickly import a Fritzing file and my Arduino sketch and start testing. Mokxi has all of the makings for the best online Arduino simulator I have been able to find!”

JayModel builderFeatured in his DioramaOS post

“I’m using Mokxi to develop and simulate an STM32-based four-wheel-drive robot car before building the actual hardware. It allows me to experiment with DC motor control, PWM, RPM measurement using photointerrupters, and different acceleration, braking, and reversing strategies, helping me understand and refine the system before implementing it in real life.”

NusretRobot car builder, Hamburg

Share your story

FAQ

Questions, answered.

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 power an Arduino Uno from an LM2596?

Yes. Set the module to 5 V and feed the Uno’s 5V pin, as this circuit does, or set it to 7 to 9 V and feed VIN or the barrel jack. Feeding the 5V pin skips the board’s own regulator, so the 5 V must be right before you connect it.

What is the difference between a buck converter and a linear regulator?

A linear regulator such as a 7805 burns the extra voltage as heat. A buck converter switches the input on and off through a coil and wastes far less: about 86 percent of the power reaches the load for an LM2596 going from 12 V to 5 V at 1 A.

How does an Arduino measure 12 V?

Through a voltage divider. Here 10 k over 4.7 k turns 12 V into 3.84 V, which A0 reads as a count of 785. The sketch multiplies back by the divider’s ratio and prints 12.0 V.

More simulators

Each one opens on a circuit that is already running.

Step 12 V down to 5

Open the circuit, swap the adapter and watch the 5 V rail hold. Nothing to install, and no account needed.