Abstract Teaching the equilibrium p – n junction is difficult because several of its key physical quantities—space charge, depletion width, electric field, and electrostatic potential—are not directly visible to students. This paper presents an openly available Python-based teaching approach that combines an electrostatic analogy, simplified analytical relations, and numerical solution of the Poisson equation for introductory undergraduate instruction. The aim is not to replace standard semiconductor theory or laboratory work, but to provide a transparent computational layer that helps students connect equations with physical interpretation. The teaching sequence moves from qualitative reasoning to analytical estimation and then to guided Jupyter-based exploration of field and potential profiles. The paper includes representative lesson formats, classroom tasks, analytical–numerical comparisons, and practical guidance for implementation. All materials are available in a GitHub repository, including ready-to-use notebooks, instructor notes, and student worksheets. The main contribution is pedagogical: the article offers a classroom-ready modelling sequence in which otherwise invisible electrostatic quantities can be visualised, interpreted, and discussed without requiring advanced programming experience. The intended readership is undergraduate physics and electronics teachers seeking a usable teaching resource rather than a research-grade semiconductor simulation study.