Visual walkthrough — Formation of a PN junction
We will meet these tools as we go, and each time we will stop and ask why this tool and not another:
- a gradient (a slope),
- an electric field and its link to potential ,
- the Einstein relation (borrowed from Einstein Relation),
- and one integral — the only calculus move on the whole page.
Prerequisites you may want open: Doping of Semiconductors, Intrinsic vs Extrinsic Semiconductors, Diffusion and Drift Currents.
Step 1 — What "concentration" means, and the slope that lives on it
WHAT. A semiconductor is a crystal with mobile charge carriers sprinkled through it. On the n-side there are many free electrons; on the p-side there are many holes (empty electron seats). Concentration just means "how many per cubic centimetre." We write the electron concentration as and the hole concentration as . Units: (things per cubic cm).
WHY. Before we can talk about flow, we need the quantity that flows. Carriers flow because there are more of them in one place than another — so the star of the show is not itself but how fast changes across space.
PICTURE. In the figure, the height of the coloured region is . It is tall on the n-side (crowded), short on the p-side (empty). The steepness of the ramp connecting them is the thing we will name next.

- ::: number of free electrons per at a point
- ::: position along the crystal (the horizontal axis)
- ::: the steepness of the concentration ramp at that point
Step 2 — Diffusion: the flow driven by that slope
WHAT. Random jiggling of carriers means more of them wander out of a crowded spot than wander in. Net result: carriers drift from high to low . We call the resulting electron current density and write it proportional to the gradient:
WHY this form. The bigger the slope, the more lopsided the random wandering, the bigger the flow — so the current must be proportional to the gradient, not to itself. That is why appears and not .
PICTURE. The orange arrow rides down the ramp: electrons pour from the tall n-side toward the short p-side. (See Diffusion and Drift Currents for the full treatment.)

Step 3 — Diffusion uncovers fixed ions and builds a field
WHAT. Every electron that leaves the n-side abandons a fixed positive donor ion nailed into the lattice. Every hole that leaves the p-side abandons a fixed negative acceptor ion . A layer of charge (n-side) faces a layer of charge (p-side). Between two sheets of opposite charge lives an electric field .
WHY a field appears. Separated and charge always make a field pointing from to . Here that is n → p. This field is the crystal's automatic response — nobody plugged in a battery.
PICTURE. The violet arrows show pointing n→p. Notice it pushes electrons (negative) back toward n and holes back toward p: it fights the diffusion of Step 2.

- ::: electric potential (potential energy per unit charge) at a point
- ::: the electric field, the negative slope of
- why the minus sign ::: field points downhill but measures the uphill slope
Step 4 — Drift: the return current the field creates
WHAT. A field pushes charges. The electron current it drives is the drift current:
WHY this form. Drift current needs carriers present () and a push (); double either and you double the flow, so both multiply in. The constant (mobility) says how fast electrons slide per unit push.
WHY we need both currents. Diffusion (Step 2) shoves electrons n→p; drift (this step) shoves them back p→n. They point opposite ways. The junction is stable exactly when they cancel.
PICTURE. Two arrows of equal length pointing opposite ways — the tug-of-war that will define equilibrium.

Step 5 — Equilibrium: set total current to zero and simplify
WHAT. No battery is attached, so no net current can flow anywhere. Add the two pieces and demand they vanish:
WHY . A steady net current in an unconnected crystal would be free energy forever — forbidden. So drift diffusion at every point.
Now replace (Step 3):
WHY this swap. We ultimately want a voltage , so we trade the field for the potential it comes from. Divide through by and rearrange:
PICTURE. The balance beam: the diffusion arrow and the drift arrow are now the same length, and the net-current needle reads exactly zero.

- Why divide by ? ::: to isolate and expose the clean ratio
- What does physically mean? ::: drift exactly cancels diffusion, so no net electron flow
Step 6 — The Einstein relation turns the constant into a temperature
WHAT. The clump is not a mystery. The Einstein Relation says:
WHY this tool and not another. Both (diffusion) and (drift response) come from the same random thermal jiggling of electrons. Einstein's insight ties them together, and their ratio collapses to pure thermal energy divided by charge — a voltage called the thermal voltage .
PICTURE. A thermometer feeding the value V at room temperature into the equation, showing the constant is just "how warm it is."

Step 7 — Integrate across the junction to get
WHAT. Both sides of are tiny changes. Sum them up (integrate) from deep in the p-side (potential , electron concentration ) to deep in the n-side (potential , concentration ):
WHY an integral, and why . We only knew the slope ; to get the total voltage drop we must add up all the tiny slopes across the width — that is exactly what an integral does. And the integral of is the natural logarithm — that is where the in the final formula is born, not by decree but by calculus.
Now put in the concentrations. On the n-side almost every donor gives an electron, so . On the p-side, minority electrons obey mass action (from Intrinsic vs Extrinsic Semiconductors), giving . Therefore:
PICTURE. The potential climbs as a smooth log-shaped step from the p-side level up to the n-side level; the total height of the step is .

Step 8 — Sanity, edge and degenerate cases
WHAT / WHY. A formula is only trustworthy if it behaves at the extremes. Walk the corners:
| Case | Argument | What does | Physical reading |
|---|---|---|---|
| Normal Si, | V | the classic diode barrier | |
| Double the doping | V | barrier grows only logarithmically — slowly | |
| Very light doping | no contrast between sides ⇒ no barrier | ||
| Undoped both sides | V | it is just one intrinsic crystal — no junction at all | |
| Raise temperature | grows fast | falls | more thermal carriers wash out the contrast |
PICTURE. Two log-step profiles overlaid: a tall step for heavy doping, a vanishing flat line as . The degenerate case is literally no step.

Worked example — silicon, term by term
The one-picture summary
Everything at once: the concentration ramp (Step 1) drives diffusion (Step 2), which uncovers ions and builds a field (Step 3) that drives the opposing drift (Step 4); setting their sum to zero (Step 5), using Einstein (Step 6), and integrating (Step 7) delivers the log-shaped potential step whose height is .

Recall Feynman retelling — the whole walkthrough in plain words
Picture a hill of electrons: piled high on the n-side, almost empty on the p-side. Because they jiggle randomly, more roll down the pile than up — that rolling is diffusion. But each electron that rolls away leaves a nailed-down "+" ion behind on the n-side, and fills a seat that exposes a "−" ion on the p-side. Those two sheets of stuck charge make an invisible electric field that pushes the electrons back up the hill — that push is drift. The pile stops changing exactly when the pushing-back perfectly matches the rolling-down: no net flow. To find how tall the resulting voltage hill is, we notice the field is just the steepness of a potential slope, we borrow Einstein's fact that jiggle-diffusion and push-drift share the same thermal origin (so their ratio is just "how warm it is," ), and we add up all the little slopes across the junction — that adding-up is an integral, and integrating gives a logarithm. Out pops : a thermal rung times the amount of contrast between the crowded and empty sides. Crank the doping and the hill barely grows, because a logarithm is lazy; that is why silicon always turns on near volts.
Recall
Where does the in come from? ::: From integrating across the junction — . Why is the barrier only V even with heavy doping? ::: Because depends on doping logarithmically, so it grows very slowly. What makes ? ::: When (little/no doping) the log argument and .