Fermi levels in PN-junction under forward bias are not constant throughout each side

This is, in a way, a follow-up to this question.

I see the following band diagram for a forward biased diode everywhere:

In the above picture, I marked a point with potential zero (where battery is connected to the N-type material) and chose two arbitrary points $$\A\$$ and $$\B\$$ inside the P-type material.

From now on, $$\\varphi (P)\$$ denotes the potentia at point $$\P\$$.

Since we apply the potential $$\\;\lvert V_a \rvert = \varphi(A)\$$ to the L region, the potential along the diode must somehow (although I don't know how to precisely mathematically describe it and nobody has answered this question yet) strictly (because the very reason why the charge flows from one point to another is the potential gradient) and continuously decrease to $$\0\$$, but it also has to be defined at every point.

This way, for example, $$\\varphi(A) \gt \varphi(B)\$$.

Then the Fermi level, being defined as the potential energy energy per particle, must also vary throughout the P and N regions. In particular, $$\E_F(A) > E_F(B)\$$, so these levels on the diagram cannot be a horizontal line. I drew in red over the band diagram how they should vary.

Am I wrong somewhere? How can I mathematically describe the Fermi level dependence on a space coordinate inside a diode? I think the only way to answer the last question is to find the dependence of the potential first, which I don't know how to accomplish.

• "because the very reason why the charge flows from one point to another is the potential gradient". That is one of the reasons for charge flow in a semiconductor. The other is the carrier density gradient, which causes diffusion current, which often flows against the potential gradient. Commented Mar 9, 2023 at 22:23

Since we apply the potential $$\|V_a|=φ(A)\$$ to the L region, the potential along the diode must somehow strictly (because the very reason why the charge flows from one point to another is the potential gradient) and continuously decrease to 0.

This is not true. Current in semiconductors is not only driven by potential gradients (i.e. electric fields), because gradients in carrier densities (e.g. due to doping gradients) result in diffusion current, which is what is primarily responsible for the current in the depletion region. The potential increases as you go from the left side of the depletion region to the right.

This way, for example, $$\φ(A)>φ(B)\$$.

You need to be careful with how you define these points, specifically $$\A\$$. There are potential drops across metal-semiconductor junctions, so you can't talk about the potential at such a junction unless you specifically define which side of the contact. If $$\A\$$ is on the semiconductor side (and sufficiently far away from the metal contact), it is true that $$\φ(A)>φ(B)\$$, because the current in this quasi-neutral region is primarily drift current, driven by a potential gradient. This is basically the voltage drop in a resistor. However, in well-designed diodes (except at very high currents), this potential drop will be very low because the quasi-neutral regions are (1) short, and (2) high in conductivity, so it is usually safe to draw the potential (or the band diagram) as being flat here, as is the case in the diagram.

Then the Fermi level, being defined as the potential energy energy per particle, must also vary throughout the P and N regions. In particular, $$\E_F(A)>E_F(B)\$$ , so these levels on the diagram cannot be a horizontal line. I drew in red over the band diagram how they should vary.

These do vary in the direction you suggest, but again, not much. The majority carrier quasi-Fermi levels outside the depletion region will be proportional to potential, up to a constant, i.e. $$\E_F = -q\phi + \text{const}\$$. Consequently they are also mostly flat.

You have a number of misconceptions here, and you should really just pick up a textbook on semiconductor physics/devices (which should also include a complete band diagram across the junction, including both quasi-Fermi levels) to better understand the fundamentals.

• "which should also include a complete band diagram across the junction, including both quasi-Fermi levels" - isn't that what's on the screenshot I attached?
– Sgg8
Commented Mar 10, 2023 at 8:05
• @Sgg8 The minority carrier quasi-Fermi levels aren't drawn, and neither quasi-Fermi level is drawn in the depletion region. These happen to be important for deriving the pn-junction current. See the more complete band diagram here.
– Puk
Commented Mar 10, 2023 at 8:38
• Actually, the diagram is from the book I got my first diagram from. But I think the cause of my misunderstanding is different. I defined potential as potential energy per particle, not specifically the potential caused by EF. That may be chemical or any other potential. However, diffusion current is indeed derived by considering random particle motion. So the particles may move without external force exserted on them, with their innitial average velocities. There may be a difference in potential energy due to carrier concentration gradient, which is used in deriving the diffusion current
– Sgg8
Commented Mar 10, 2023 at 8:58
• @Sgg8 Unless qualified, "potential" in this context normally refers to the electrostatic potential. Either way, both the electrostatic potential and the majority carrier quasi-Fermi levels are approximately flat in the quasi-neutral regions, for reasons I've tried to explain.
– Puk
Commented Mar 10, 2023 at 9:09
• Did you get $E_F = -q\phi + \text{const}$ by assuming the contribution from chemical potential, concentration gradient or any other source of potential energy is negligible?
– Sgg8
Commented Mar 10, 2023 at 9:18