Source: https://mokxi.com/parts/diode
Updated: 2026-11-10

Part

# Diode

One way only. For flyback, for steering, and for a battery in backwards.

See every part

- 2 pins
- 2 settings
- In 11 projects
- In 6 lessons

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Diode in brief

What it is, and every setting the properties panel gives it.

A diode lets current through from its anode to its cathode, the end with the band, and blocks it the other way. Mokxi’s diode has no forward drop written down anywhere: it solves the Shockley equation with a series resistance, so the drop is whatever the curve gives at the current the circuit passes. A 1N4007 sits near 0.63 V at 5 mA and reaches 0.91 V only near an amp; a 1N4148 is 0.68 V at 5 mA; the 1N5817 Schottky drops 0.24 V at 5 mA and 0.45 V at an amp, which is the reason to pick one for a supply line. Reverse biased it passes nanoamps. The model property picks the 1N4148, 1N4007, 1N5817, 1N5819 or BAT54. Three things are left out: there is no junction capacitance or reverse recovery, so every diode switches instantly, no temperature drift, and no reverse breakdown. The motor and relay coil parts have no inductive kick either, so a missing flyback diode shows no symptom here.

Family

Timers and analog

Pins

2

model

1N4148 (or 1N4007, 1N5817, 1N5819, BAT54)

1N4148 (small-signal switching and clamping), 1N4007 (line-voltage
rectifier and the usual flyback diode on a coil), or one of three Schottkys:
1N5817 (20 V, the lowest drop of the family), 1N5819 (40 V, for a low drop in a
supply path) and BAT54 (200 mA, for a signal clamp). forward overrides the
model, and is read as the drop at 10 mA.

forward

0

Pins

## 2 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

A

Anode. Current goes in.

C

Cathode, marked with a band on the real part. Current comes out.

How to use it

## How to wire a diode the right way around

Current flows through a diode from the anode (A) into the cathode (C), the end with the band, once the anode is a few tenths of a volt higher. Across a motor or a relay coil, the flyback diode goes band toward the positive supply, so it is reverse biased while the coil runs and only conducts on the kick when it switches off. In a supply line it goes in series, band toward the load, so a battery put in backwards cannot push current through.

Pick it by its drop. A 1N4007 is the usual flyback and rectifier diode; a 1N5817 Schottky drops less than half as much. On the reverse polarity page, about 47 mA through a 1N5817 costs 0.30 V and through a 1N4007 0.73 V. The motor in the circuit here has no inductance, so its diode carries nothing in the simulation; the flyback diode page shows the spike on an inductor.

Part pin

Board pin

Anode (A)

The transistor’s collector and motor terminal 2

Cathode (C, the band)

5 V and motor terminal 1

A diode works the same next to any board. On a 3.3 V supply, a Schottky’s smaller drop is often the difference between a circuit that runs and one that browns out.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

How it is modeled

## What is true about the Diode, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

The Shockley equation, I = Is (exp(Vj / (N Vt)) - 1), with a bulk series
resistance, solved by Newton-Raphson along with everything else the diode is
wired to. So there is no forward drop written down anywhere: the drop is
whatever the curve gives at the current the circuit is passing.

model
Is
N
Rs
at 5 mA
at 1 A

1N4148
4.352 nA
1.906
0.646 ohm
0.68 V
1.6 V

1N4007
7.028 nA
1.808
0.034 ohm
0.63 V
0.91 V

1N5817
1.0 µA
1.05
0.075 ohm
0.24 V
0.45 V

1N5819
30 nA
1.05
0.05 ohm
0.33 V
0.52 V

BAT54
100 nA
1.05
0.75 ohm
0.29 V
not rated

The three Schottkys are the same equation with a different junction. A
silicon pn junction's saturation current is nanoamps; a metal-silicon one's is
hundreds of nanoamps to microamps, and its N is near 1.05 rather than near 2.
That is the whole of why a Schottky drops a third of a volt where a 1N4148 drops
two thirds, and it falls out of the equation rather than being written down. Each
card is fitted to two points off its datasheet's forward curve; the emission
coefficient is the one assumed number, because a Schottky datasheet does not
print one.

That is the difference this model makes: the old fixed-drop 1N4007 claimed
0.9 V at any current at all, and a real one is at about 0.6 V at four
milliamps and only reaches 0.9 V near an amp. The operating point agrees with
ngspice 42 on the same card to better than a tenth of a percent.

Reverse biased the diode passes Is and nothing more, which is nanoamps, and
below a nanoamp it lets go of both nets entirely.

### Not modeled

No junction capacitance, so it switches instantly. No reverse recovery time, which
is the real difference between a 1N4148 and a 1N4007 in a fast circuit. No
temperature dependence: every junction here is at 27 C, where a real drop moves
about -2 mV a degree. No breakdown on these cards: the junction model has SPICE's
BV and IBV and the Zener is built on them, but no card
here names a reverse rating, so a diode sitting at 400 V reverse simply stays off
rather than avalanching, the one place this part is kinder than the bench. And
there are no current or power ratings either, so nothing stops a BAT54 being
asked for an amp it would not survive.

Reverse recovery is worth saying twice for the Schottkys, because it is the
reason to buy one: a real Schottky switches off in nanoseconds where a 1N4007
takes microseconds, which is what makes it the diode in a switching supply. Here
every diode switches instantly, so that difference does not exist and the only
thing separating a Schottky from a silicon part is the drop.

### Diodes: `diode`

model | `Is` | `N` | `Rs` | source | standing

1N4148 | 4.352 nA | 1.906 | 0.6458 Ω | Vishay 1N4148 forward characteristics | derived from two points on the forward curve

1N4007 | 7.028 nA | 1.808 | 0.0342 Ω | Vishay 1N4007 forward characteristics | derived, same way

1N5817 | 1.0 µA | 1.05 | 0.075 Ω | ON Semi 1N5817 VF at 100 mA and 1 A | Is/Rs derived from those two points; N assumed

1N5819 | 30 nA | 1.05 | 0.05 Ω | ON Semi 1N5819 VF | derived; N assumed

BAT54 | 100 nA | 1.05 | 0.75 Ω | Nexperia BAT54 VF at 10 mA and 100 mA | Is/Rs derived; N assumed

From Diode, in full.

Projects

## See the Diode in a project

11 built-in projects use it. Each opens in the editor, already wired.

Lessons

## Where it turns up in a lesson

6 lessons place it in their own circuits.

### Learn articles

6 lessons

- Diodes for Reverse Polarity Protection
- NPN Transistor as a Switch: a 2N2222 and an Arduino
- The Flyback Diode, and the Spike It Stops
- Arduino DC Motor: Transistor Wiring and PWM Speed
- Prototype Your Keyboard Matrix Before You Solder
- Arduino IR Obstacle Sensor (FC-51): Wiring, Code

Boards

## The boards it is shown on

Each of these 3 boards has a built-in project with the Diode in it.

- Arduino Uno R3
- Arduino Mega 2560
- SparkFun Pro Micro

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Diode

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
