Briefly explain how a potential barrier is set up across a p-n junction as a result of diffusion and drift of the charge carriers.
Due to the depletion region an electric field develops. Due to this electric field, the electron on p side moves to n side and hole an n side of the junction moves to p side. This motion of the charge is called drift current. At some point of time, the diffusion current equals drift current and p-n junction under equilibrium is formed and there is no net current.
Now there is a difference of potential between p and n region and the polarity of potential is such that there is no further flow of carriers
This is known as barrier potential