You can change the behavior of silicon and turn it into a conductor by doping it. In doping, you mix a small amount of an impurity into the silicon crystal.
There are two types of impurities:
- N-type - In N-type doping, phosphorus or arsenic is added to the silicon in small quantities. Phosphorus and arsenic each have five outer electrons, so they're out of place when they get into the silicon lattice. The fifth electron has nothing to bond to, so it's free to move around. It takes only a very small quantity of the impurity to create enough free electrons to allow an electric current to flow through the silicon. N-type silicon is a good conductor. Electrons have a negative charge, hence the name N-type.
- P-type - In P-type doping, boron or gallium is the dopant. Boron and gallium each have only three outer electrons. When mixed into the silicon lattice, they form "holes" in the lattice where a silicon electron has nothing to bond to. The absence of an electron creates the effect of a positive charge, hence the name P-type. Holes can conduct current. A hole happily accepts an electron from a neighbor, moving the hole over a space. P-type silicon is a good conductor.
A minute amount of either N-type or P-type doping turns a silicon crystal from a good insulator into a viable (but not great) conductor - hence the name "semiconductor."
N-type and P-type silicon are not that amazing by themselves; but when you put them together, you get some very interesting behavior at the junction. That's what happens in a diode.
A diode is the simplest possible semiconductor device. A diode allows current to flow in one direction but not the other. You may have seen turnstiles at a stadium or a subway station that let people go through in only one direction. A diode is a one-way turnstile for electrons.
When you put N-type and P-type silicon together as shown in this diagram, you get a very interesting phenomenon that gives a diode its unique properties.
Even though N-type silicon by itself is a conductor, and P-type silicon by itself is also a conductor, the combination shown in the diagram does not conduct any electricity. The negative electrons in the N-type silicon get attracted to the positive terminal of the battery. The positive holes in the P-type silicon get attracted to the negative terminal of the battery. No current flows across the junction because the holes and the electrons are each moving in the wrong direction.