Simulator

A transformer simulator: mains to smooth DC

Mokxi is a free online transformer circuit simulator that runs in your browser, with nothing to install and no account needed. The linear power supply every electronics course builds: 230 V mains into a 12-0-12 V center-tapped transformer, two 1N4007 diodes, a 1000 µF smoothing capacitor and a 100 ohm load, with an oscilloscope and a multimeter on the output.

  • 505parts on the bench
  • 45boards running now
  • 1.00xreal time, on every board
A transformer, two diodes and a capacitorlive0.000 s 0.00x
Click to open it in the editor
Click the circuit to open it in the editor. The scope shows the ripple on the output; change the capacitor or the load and watch it grow or shrink.

What you can do here

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

  • Step 230 V mains down through a center-tapped transformer, safely
  • Build a full-wave rectifier from two diodes and the center tap
  • See the ripple on a scope and the average on a meter
  • Swap the smoothing capacitor and watch the ripple change
  • Lighten the load and watch the output rise
  • Add a 7805 regulator after the capacitor for a steady 5 V

What the running circuit shows

Why a 12 V transformer gives nearly 17 V of DC.

The transformer’s secondary has three leads: two ends and a center tap, which is this circuit’s ground. Each end swings to 18.2 V either side of it, half a cycle apart. A diode from each end passes whichever is positive, and the capacitor holds the voltage up between peaks. The output runs between 15.98 and 17.29 V, about 1.3 V of ripple, and the meter reads the average: 16.62 V.

A 12 V transformer making over 16 V surprises everyone once. Its 12 V is an rms figure, and the capacitor charges to the peak, which is 1.41 times higher, less one diode drop.

Now change things. With a 4700 µF capacitor the output stays between 16.38 and 16.65 V: more capacitance, less ripple. Put the 1000 µF back and lighten the load to 1 k: 17.45 to 17.63 V, and 17.54 V on the meter. Less current means the capacitor drains less between peaks and the transformer sags less. An unregulated supply’s voltage depends on its load, which is the reason regulators exist.

How the transformer is modeled

Two isolated windings with a real ratio.

The primary and the secondary share no connection, as in the real part, and the secondary’s voltage follows the primary’s by the turns ratio. Like a real small transformer, its rated voltage is its voltage at full load: lightly loaded it reads about 10 percent higher, which you can see above.

What it leaves out: core saturation, the inrush when mains is first applied, heating and hum. And the one thing a simulator gives you that a bench does not: nothing here can hurt you. On real hardware everything on the primary side is at mains voltage. Use a ready-made, enclosed transformer and never probe the primary.

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.

Why does a 12 V transformer give more than 12 V DC after rectifying?

The 12 V is rms. The smoothing capacitor charges to the peak, 1.41 times the rms voltage, less a diode drop, and a lightly loaded transformer runs a little above its rating. In this circuit a 12-0-12 V transformer gives 16.6 V DC into 100 ohms.

What is a center-tapped transformer used for?

A full-wave rectifier with only two diodes, as here: each half of the secondary supplies one half of the cycle. It can also make a positive and a negative supply at once, with the tap as ground.

How do I reduce the ripple of a power supply?

Use a larger smoothing capacitor, draw less current, or follow the capacitor with a regulator. Here going from 1000 to 4700 µF cuts the ripple from about 1.3 V to under 0.3 V.

More simulators

Each one opens on a circuit that is already running.

Turn mains into DC

Open the circuit, swap the capacitor and watch the ripple on the scope. Nothing to install, and no account needed.