When the negative end of the circuit is hooked up to the N-type layer and the positive end is hooked up to P-type layer, electrons and holes start moving and the depletion zone disappears.
If you try to run current the other way, with the P-type side connected to the negative end of the circuit and the N-type side connected to the positive end, current will not flow. The negative electrons in the N-type material are attracted to the positive electrode. The positive holes in the P-type material are attracted to the negative electrode. No current flows across the junction because the holes and the electrons are each moving in the wrong direction. The depletion zone increases. (See How Semiconductors Work for more information on the entire process.)
When the positive end of the circuit is hooked up to the N-type layer and the negative end is hooked up to the P-type layer, free electrons collect on one end of the diode and holes collect on the other. The depletion zone gets bigger.
The interaction between electrons and holes in this setup has an interesting side effect -- it generates light! In the next section, we'll find out exactly why this is.
How Can a Diode Produce Light?
Light is a form of energy that can be released by an atom. It is made up of many small particle-like packets that have energy and momentum but no mass. These particles, called photons, are the most basic units of light.
Photons are released as a result of moving electrons. In an atom, electrons move in orbitals around the nucleus. Electrons in different orbitals have different amounts of energy. Generally speaking, electrons with greater energy move in orbitals farther away from the nucleus.
For an electron to jump from a lower orbital to a higher orbital, something has to boost its energy level. Conversely, an electron releases energy when it drops from a higher orbital to a lower one. This energy is released in the form of a photon. A greater energy drop releases a higher-energy photon, which is characterized by a higher frequency. (Check out How Light Works for a full explanation.)
As we saw in the last section, free electrons moving across a diode can fall into empty holes from the P-type layer. This involves a drop from the conduction band to a lower orbital, so the electrons release energy in the form of photons. This happens in any diode, but you can only see the photons when the diode is composed of certain material. The atoms in a standard silicon diode, for example, are arranged in such a way that the electron drops a relatively short distance. As a result, the photon's frequency is so low that it is invisible to the human eye -- it is in the infrared portion of the light spectrum. This isn't necessarily a bad thing, of course: Infrared LEDs are ideal for remote controls, among other things.
Digital clock, are made of materials characterized by a wider gap between the conduction band and the lower orbitals. The size of the gap determines the frequency of the photon -- in other words, it determines the color of the light. While all diodes release light, most don't do it very effectively. In an ordinary diode, the semiconductor material itself ends up absorbing a lot of the light energy. LEDs are specially constructed to release a large number of photons outward. Additionally, they are housed in a plastic bulb that concentrates the light in a particular direction. As you can see in the diagram, most of the light from the diode bounces off the sides of the bulb, traveling on through the rounded end.
LEDs have several advantages over conventional incandescent lamps. For one thing, they don't have a filament that will burn out, so they last much longer. Additionally, their small plastic bulb makes them a lot more durable. They also fit more easily into modern electronic circuits.
But the main advantage is efficiency. In conventional incandescent bulbs, the light-production process involves generating a lot of heat (the filament must be warmed). This is completely wasted energy, unless you're using the lamp as a heater, because a huge portion of the available electricity isn't going toward producing visible light. LEDs generate very little heat, relatively speaking. A much higher percentage of the electrical power is going directly to generating light, which cuts down on the electricity demands considerably.
Up until recently, LEDs were too expensive to use for most lighting applications because they're built around advanced semiconductor material. The price of semiconductor devices has plummeted over the past decade, however, making LEDs a more cost-effective lighting option for a wide range of situations. While they may be more expensive than incandescent lights up front, their lower cost in the long run can make them a better buy. In the future, they will play an even bigger role in the world of technology.
For more information on LEDs and other semiconductor devices, check out the links in the next section.