One band can hold up to two electrons per atom. Electrons fill the states from the lowest energy up, so the number of electrons in a substance decides whether the highest occupied band is only partly filled or exactly full. This difference is the difference between a metal and an insulator.
The velocity of an electron in a band is given by the group velocity v = \dfrac{1}{\hbar}\dfrac{dE}{dk}. For the band E = E_0 - 2t\cos ka it is v = \dfrac{2ta}{\hbar}\sin ka, so electrons with positive k move right and electrons with negative k move left. Without an electric field the electrons fill the band symmetrically about k = 0, their velocities add up to zero, and no current flows.
When an electric field is applied, a force F opposite to the field acts on each electron, and the k of every electron shifts by the same amount according to \hbar\dfrac{dk}{dt} = F. If the band is only partly filled, as on the left of the figure, the distribution of electrons shifts to one side, more electrons move right than left, and a current flows. In a real metal the electrons are scattered by the thermal vibration of the ions and by impurities, so the shift stops at a certain size and the current becomes steady.
If the band is completely full, as on the right of the figure, then wherever the k of an electron shifts, the new state is one that another electron has just left. The distribution as a whole does not change, the total velocity stays zero, and no current flows. By the Pauli exclusion principle an electron can only move into an empty state.
A substance whose highest occupied band is partly filled is a metal, and a substance with a large gap above a full band is an insulator. The full band is called the valence band, and the empty band above it the conduction band. Sodium is a metal because its 3s band is half filled. In diamond the valence band is exactly full and there is a gap of 5.5\,\mathrm{eV} up to the conduction band, so diamond is an insulator.
Magnesium has two 3s electrons per atom, so its 3s band would seem to be exactly full. However, the 3s band and the 3p band overlap in energy, the electrons are divided between them, and both are only partly filled. This is why magnesium is a metal.
In a substance with a small band gap, some electrons take up thermal energy and rise into the conduction band, even though the substance is an insulator at absolute zero. An electron in the conduction band can move among the empty states there and carry a current. Such a substance is called a semiconductor. The band gap of silicon is 1.12\,\mathrm{eV} and that of germanium is 0.66\,\mathrm{eV}.
With n the number of electrons in the conduction band and p the number of empty states left in the valence band, the product np is proportional to e^{-E_g/k_\mathrm{B}T}, where k_\mathrm{B} is the Boltzmann constant. At room temperature, 300 K, k_\mathrm{B}T = 0.026\,\mathrm{eV}. Each electron that rises leaves one empty state behind, so in a pure semiconductor n = p and n is proportional to e^{-E_g/2k_\mathrm{B}T}.
In silicon at room temperature there are about 10^{10} electrons per \mathrm{cm}^3 in the conduction band. Since one cubic centimeter of silicon contains 5 \times 10^{22} atoms, that is only one electron for every five trillion atoms. Copper has one conducting electron per atom, 8.5 \times 10^{22} per \mathrm{cm}^3.
The figure shows the electrons in the conduction band and the empty states in the valence band as dots, while the temperature of silicon changes from 280 K to 340 K. The number of dots is proportional to e^{-E_g/2k_\mathrm{B}T}. Raising the temperature from 300 K to 340 K makes this value about 13 times larger.
In a metal the resistance increases when the temperature rises, but in a semiconductor the number of conduction electrons grows rapidly with temperature, so the resistance decreases. Some thermistors, which measure temperature, use this property. In diamond e^{-E_g/2k_\mathrm{B}T} is about 10^{-46} at room temperature, and practically no electrons rise into the conduction band.
When an electron rises into the conduction band, it leaves one state in the valence band without an electron. With this empty state the valence band is no longer full, so the electrons in the valence band can now carry a current as well.
The figure lines up the places occupied by electrons in the valence band, with one of them empty. When an electric field is applied, the electron just to the right of the empty place moves left into it, and the empty place moves one step to the right. Next, the electron to the right of it moves left. The electrons move left one at a time, and the empty place keeps moving right.
A different electron moves each time, but looking only at where the empty place is, a single thing is moving in the direction of the field. It is a place where one negatively charged electron is missing, so compared with its surroundings there is a positive charge +e there. Treating this empty state as a particle with charge +e gives what is called a hole.
The current in a semiconductor is the sum of the current carried by electrons in the conduction band and the current carried by holes in the valence band. The electrons move against the field and the holes move along it, but since their charges also have opposite signs, both currents flow in the direction of the field.
That a hole may be treated as a positively charged particle is confirmed by the Hall effect. When a current flows through a conductor in a magnetic field, the particles carrying the charge are pushed sideways by the magnetic force, and a voltage appears perpendicular to the current. The sign of that voltage tells the sign of the charge of the particles. In a semiconductor with many holes, the voltage measured has the sign for positive charges carrying the current.
Pure silicon has too few conduction electrons, so impurities are added to real semiconductors. This is called doping. Silicon has four valence electrons and forms covalent bonds with its four neighbors. If a phosphorus atom, which has five valence electrons, takes the place of a silicon atom, one electron is left over that is not used in any bond.
The extra electron is attracted by the phosphorus ion, which has one more positive charge, and forms a bound state of the same form as the hydrogen atom. The surrounding silicon, however, weakens the electric field, so the Coulomb force is divided by the relative permittivity \varepsilon_r = 11.7. In addition, the motion of an electron in the crystal follows the same equations as that of a free electron once its mass is replaced by the effective mass m^*. In the conduction band of silicon, m^* is about 0.26m.
Putting these two changes into the energy 13.6\,\mathrm{eV} and the radius a_0 of the hydrogen atom gives a binding energy of 13.6\,\mathrm{eV} \times \dfrac{m^*/m}{\varepsilon_r^2} \approx 0.026\,\mathrm{eV} and a radius of a_0 \times \dfrac{\varepsilon_r}{m^*/m} \approx 2.4\,\mathrm{nm}. The measured value for phosphorus is 0.045\,\mathrm{eV}. The radius is about ten times the distance between silicon atoms, and the orbit contains thousands of atoms, which is why it makes sense to treat the surrounding silicon as weakening the field.
Since 0.045\,\mathrm{eV} is only about twice k_\mathrm{B}T = 0.026\,\mathrm{eV} at room temperature, at room temperature most phosphorus atoms have lost their electron to the conduction band. The level of the phosphorus is called the donor level, and it lies just below the bottom of the conduction band (left of the figure). A phosphorus atom that has lost its electron stays in the crystal as a positive ion. A semiconductor with impurities that give electrons to the conduction band is called n-type.
Adding boron, with three valence electrons, leaves the bonds one electron short instead. Boron creates an empty level 0.045\,\mathrm{eV} above the top of the valence band. When an electron from the valence band moves into it by thermal energy, a hole is left in the valence band (right of the figure). This level is called the acceptor level, and a semiconductor in which holes carry the current is called p-type.
Very small amounts are enough. Adding one phosphorus atom for every ten million silicon atoms gives 5 \times 10^{15} conduction electrons per \mathrm{cm}^3, about 500,000 times as many as in pure silicon. Being able to choose, by the kind and amount of impurity, whether electrons or holes are in the majority and by how much is what makes semiconductors usable in electronic components.
A p-type and an n-type semiconductor joined together form a pn junction. At the junction, electrons from the n-type side diffuse into the p-type side, holes from the p-type side diffuse into the n-type side, and they recombine, leaving an imbalance of charge on the two sides of the junction. Because of the electric field of that charge, the conduction band and the valence band lie at different heights on the two sides of the junction.
Applying a forward voltage, with the p-type side positive, reduces this difference in height, and electrons from the n-type side and holes from the p-type side move to the junction. Near the junction, when an electron in the conduction band moves into a hole in the valence band, the energy difference is emitted as a photon. The photon energy is nearly equal to the band gap, and the wavelength is \lambda = \dfrac{hc}{E_g} = \dfrac{1240\,\mathrm{nm\,eV}}{E_g}. This is the light-emitting diode, or LED.
The figure compares the light emitted by three semiconductors. GaAs has E_g = 1.42\,\mathrm{eV} and emits infrared light with a wavelength of 873 nm. Infrared LEDs are used in devices such as television remote controls. AlGaInP, with about 1.9 eV, emits red light at about 650 nm, and InGaN, with about 2.8 eV, emits blue light at about 450 nm. The larger the band gap, the shorter the wavelength.
Blue LEDs were not achieved for a long time, because it was difficult to make good crystals of gallium nitride and p-type layers of it. In the 1990s Isamu Akasaki, Hiroshi Amano and Shuji Nakamura made efficient blue LEDs, for which they received the 2014 Nobel Prize in Physics. Most white LEDs convert part of the blue light into yellow light with a phosphor and mix the two so that the light looks white.
Silicon is not used for LEDs. In silicon, the lowest state of the conduction band and the highest state of the valence band are at different values of k. A photon carries almost no momentum, so an electron cannot change its k by emitting a photon alone, and a lattice vibration must be absorbed or emitted at the same time. Such a semiconductor is called indirect, and most of the recombination energy becomes heat. In GaAs and similar materials the two states are at the same k, which makes them direct semiconductors that emit light efficiently.
In the reverse process, a photon with more energy than the band gap can raise an electron from the valence band into the conduction band, creating an electron and a hole. Solar cells and the image sensors of cameras work this way. Silicon absorbs light with wavelengths shorter than 1.1\,\mu\mathrm{m}. Diamond is transparent because its band gap of 5.5\,\mathrm{eV} is larger than the photon energies of visible light, about 1.7 eV to 3.3 eV.