Diodes
Perhaps the simplest device that can be created with a semiconductor is a diode. A diode is a circuit element that allows electric current to flow in only one direction, like a one-way valve (see Model of Conduction in Metals). A diode is created by joining a p-type semiconductor with an n-type semiconductor. The junction between these materials is called a p-n junction.

A comparison of the energy bands of a silicon-based diode is shown in the figure below.

In a junction, the valence and conduction bands have the same positions, but the impurity levels differ. Electrons from the conduction band of the -type material move to the -side, combining with holes in the valence band. This results in positive ionized donor ions on the -side and negative ionized acceptor ions on the -side. The accumulation of charge forms a narrow depletion layer at the junction. The electric field associated with this layer prevents additional diffusion. The potential energy for electrons across the junction is represented by the figure below.
A semiconductor diode behaves differently based on its bias configuration. When the positive side of the battery is connected to the n-type material, the depletion layer widens, increasing the potential energy difference across the p-n junction. This inhibits electron movement, resulting in significantly reduced current. This is known as the reverse bias configuration. Conversely, when the positive side of the battery is connected to the p-type material, the depletion layer narrows, reducing the potential energy difference. This allows electrons to flow easily, known as the forward bias configuration. Overall, the diode enables current to flow in one direction while blocking it in the opposite direction, functioning as a one-way valve.