An interactive, physics-first laboratory for analyzing abrupt silicon p–n junctions. Change doping, temperature, voltage, area, mobility, and lifetime; then inspect how the junction electrostatics and ideal current respond.
Follow the beginner guide. On Windows, download and extract the repository, then double-click START_LAB.bat. The launcher prepares the environment and opens the laboratory in your browser.
- temperature-dependent silicon intrinsic carrier concentration;
- thermal and built-in voltage;
- total, p-side, and n-side depletion widths;
- space charge, electric field, and electrostatic potential profiles;
- peak electric field and depletion capacitance;
- minority-carrier ideal saturation current;
- ideal diode current–voltage characteristic;
- warnings when the model approaches important limits.
The application also exports the calculated depletion profiles as CSV data.
Python 3.10 or newer is recommended.
python -m venv .venvActivate the environment, then install the interface dependencies and launch the app:
python -m pip install -r requirements.txt
streamlit run app.pyRun the numerical example:
python -m examples.run_analysisRun the tests:
python -m unittest discover -s tests -vFor a uniformly doped abrupt junction, the built-in voltage is
Under applied voltage
Charge neutrality requires
The diffusion-current model uses
This is an educational model, not a process-calibrated device simulator. It assumes:
- a one-dimensional, abrupt, uniformly doped silicon junction;
- complete dopant ionization and nondegenerate carrier statistics;
- the depletion approximation;
- low-level injection and steady state;
- constant mobility and minority-carrier lifetime;
- negligible series resistance, surface leakage, and generation–recombination current;
- no avalanche or Zener breakdown.
Strong forward bias, degenerate doping, breakdown, nonuniform profiles, heterojunctions, and nanoscale devices require more complete models.
├── app.py # Interactive Streamlit laboratory
├── START_LAB.bat # One-click Windows launcher
├── BEGINNER_GUIDE.md # Step-by-step instructions for new users
├── pn_junction_lab/
│ ├── __init__.py
│ └── model.py # Tested physics calculations
├── examples/
│ └── run_analysis.py # Reproducible command-line example
├── tests/
│ └── test_model.py # Physics and boundary-condition tests
└── requirements.txt # Interface dependencies
- C–V profiling and extraction of nonuniform doping
- Shockley–Read–Hall generation–recombination current
- Avalanche and Zener breakdown models
- Heterojunction band alignment
- Comparison with measured diode data
- Links to the matching modules in the Semiconductor Physics course
Use the simulator to test a prediction, not to replace a derivation. Estimate the trend first, calculate second, and explain whether the result is physically plausible.