Last time we mentioned n-type semiconductors, which have electrons as the charge carrier, and p-type semiconductors, which have holes as the charge carrier. But what happens when you put them together? The result is a device which underlies much of modern electronics!
Imagine a block of an n-type semiconductor pressed up to a block of a p-type semiconductor. What happens when the two make contact? Each material is electrically neutral, but the holes in the p-type material provide additional electron states which draw electrons from the n-type material. And when electrons travel into the p-type material, they leave holes behind them in the n-type material. Thus, at the interface the p-type semiconductor gains a negative charge, and the n-type semiconductor gains a positive charge. The region where this happens is called the space charge region. Even though this isn’t the lowest energy charge distribution, it is the lowest energy overall because it makes use of more available states for both electrons and holes. (The rigorous version of this argument involves entropy, which I hope to dedicate a post to very soon!) So now the interface looks like a cluster of positive charge next to a cluster of negative charge, which creates an electric field across the junction!
If we want to pass current through the p-n junction, that electric field is going to either help us or hurt us depending on which direction we want the current to flow. If the current flow is in the same direction as the force applied by the field, then current will be aided by the presence of the junction. But if the current flow is in the opposite direction, it will be impeded. This kind of device is called a diode, because it can either conduct current or block it depending on the direction of current flow.
Of course, since the size of the electric field in the junction is limited by the interface size and the charge carrier concentration, if we apply a strong enough external electric field then we will be able to pass current through the device in both directions. This is called breakdown, and while ideal diodes are assumed to never exhibit breakdown, real diodes do because of the physical nature of the system which in p-n junctions means the finite size of the junction’s electric field. So a p-n junction acts like a normal semiconductor with applied voltage in one direction, and in the other direction passes no current until a high enough voltage is reached to induce breakdown.
Diodes are a building block that can be used to make a more complex electronic circuit, just like inductors, resistors, and capacitors. But p-n junctions specifically are the building blocks of most digital circuits in silicon! More on that coming soon!