Diode Model
A diode is a two-terminal semiconductor device that primarily allows current to flow in one direction while blocking it in the opposite direction. In other words, it acts as a one-way valve for electrical current. Diodes are essential components in electronics and have various applications in rectification, signal clipping, voltage regulation, and signal demodulation, among others.
The most common type of diode is the semiconductor junction diode, which consists of two layers of semiconductor material, typically p-type (positively doped) and n-type (negatively doped), joined together. This junction creates a depletion region, which inhibits the flow of electrons from the p-type to the n-type material and vice versa when a voltage is applied in the opposite direction of the diode's forward bias.
When a voltage is applied in the forward direction, it reduces the width of the depletion region, allowing current to flow easily through the diode. However, when a voltage is applied in the reverse direction, it widens the depletion region, preventing significant current flow. This behavior makes diodes useful for tasks like converting alternating current (AC) to direct current (DC) in rectification circuits, protecting circuits from reverse voltage, and many other applications.
In SPICE, diodes can be represented using various models, and each model has its set of parameters. The most commonly used diode models in SPICE are:
IS (Saturation Current): This is the reverse bias saturation current of the diode, representing the leakage current when the diode is reverse-biased.
N (Emission Coefficient or Ideality Factor): This parameter describes how closely the diode follows the ideal diode equation. The value is typically between 1 and 2.
M (Junction Capacitance Grading Exponent): This parameter is used to change the slope of the junction capacitance versus voltage (C-V) characteristics curve.
RS (Series Resistance): It represents the parasitic series resistance of the diode.
CJO (Zero-Bias Junction Capacitance): It represents the junction capacitance of the diode when it is unbiased.
TT (Transit Time): It represents the carrier transit time through the diode.
BV (Breakdown Voltage): It specifies the reverse breakdown voltage of the diode.
IBV (Reverse Breakdown Current): It specifies the current at which the diode breaks down in reverse bias.
The diode that we will model in Python is 1N4001D and the SPICE model is listed below:
*SRC=1N4001;DI_1N4001;Diodes;Si; 50.0V 1.00A 3.00us Diodes, Inc. diode
.MODEL DI_1N4001 D ( IS=76.9p RS=42.0m BV=50.0 IBV=5.00u
+ CJO=39.8p M=0.333 N=1.45 TT=4.32u )
The Python code inludes function that takes an input argument the voltage across the diode and returns the diode current ID, slope gd and capacitance CJ.
mod_diode function can also generate the I-V, gd-V and C-V curves for forward bias. On the following testbech the voltage across the diode is swept betwee 0 and 700mV.