A semiconductor conducts a little, somewhere between a conductor and an insulator. What makes it useful is that you can control how well it conducts, by adding impurities, applying a voltage, or shining light on it. Every diode, transistor and integrated circuit is built on that one trick.
Doping: choosing the carriers
In a pure silicon crystal every atom shares its four outer electrons with four neighbours. All the electrons are tied up in bonds, so there are almost no free charge carriers. Doping replaces a tiny fraction of the atoms with an impurity:
Doping adds a trace of impurity: N-type gains free electrons, P-type gains holes.
N-type: a donor atom (five outer electrons, such as phosphorus or arsenic) brings one electron too many. That electron is free to move.
P-type: an acceptor atom (three outer electrons, such as boron) leaves a gap where an electron should be, called a hole. A neighbouring electron can hop in, which moves the hole the other way. A hole behaves like a mobile positive charge.
Each type is still electrically neutral overall. N-type is not "negative"; it just has spare electrons that can move.
The PN junction
Join a P region to an N region and electrons from the N side wander across and fill holes on the P side. That leaves a thin layer around the join with no free carriers, the depletion region, and fixed charged atoms on either side that create a built-in barrier. In silicon the barrier is roughly 0.7 V.
Forward bias squeezes the depletion region until carriers cross; reverse bias widens it and blocks the flow.
Depletion width (zero bias = 1)1.00×
Forward bias (P positive, N negative): the applied voltage works against the barrier and the depletion region shrinks. Once the voltage reaches about 0.6 to 0.7 V in silicon, carriers pour across and current flows.
Reverse bias (P negative): the voltage pulls holes and electrons away from the junction. The depletion region widens, and only a minute leakage current flows.
RememberA PN junction passes current one way only, and only after about 0.6 to 0.7 V (silicon) of forward voltage.
From junction to device
One junction is a diode. Two junctions back to back make a bipolar transistor. An electrically controlled channel of N or P material makes a FET. Thousands to billions of these on one piece of silicon make an integrated circuit.
Material
Where you meet it
Silicon
almost everything: diodes, transistors, chips, solar cells
Germanium
early transistors and diodes; lower threshold, rarely used now
Gallium arsenide
microwave amplifiers and fast devices
Silicon carbide, gallium nitride
high-power and high-voltage switching and RF power devices
Two practical consequences:
The threshold is set by the material. An LED's forward voltage is set by its semiconductor's band gap, so different colours drop different voltages.
Heat matters. A junction's conduction rises with temperature, so a part that heats up can draw more current and heat further. That feedback is why transistors in power stages need heatsinks and careful biasing.