Definition
A diode is a semiconductor part that lets current flow in only one direction and mostly blocks it from flowing backward. It protects electronic circuits from damage and shapes electricity into a form we can actually use, which makes it one of the most basic building blocks in electronics.
A One-Way Door for Electricity
Picture the rubber valve on a bicycle tire. When you push air in with a pump, the valve opens easily. When you stop pumping, the valve snaps shut so the air can't leak back out.
Inside a circuit, a diode does exactly the same job. When electricity arrives from the right direction, the door swings wide open and lets it through. When electricity tries to flow backward, the door locks and almost nothing gets through. A tiny bit of leakage current remains, though, and if the reverse voltage gets too high, the barrier can break down.
The direction where electricity flows freely is called forward bias. The opposite direction, where it's blocked, is called reverse bias. Some devices survive a battery put in backward because a protection circuit, often built around a diode, is stopping the reverse flow.
When Two Kinds of Semiconductor Join Hands
The secret behind a diode's one-way trick is the meeting of two semiconductors with opposite personalities. P-type semiconductor is full of "holes," empty spots where an electron is missing, which act like positive (+) charges. N-type semiconductor is packed with free-roaming negative (-) electrons. A diode is made by joining the two side by side.
Apply voltage in the forward direction, and the holes from the P side and the electrons from the N side rush toward the boundary in the middle. They meet and pair up, and a path opens up for electricity to flow freely.
Reverse the voltage, and everything flips. The electrons and holes get pulled away from the middle toward the outer edges, as if abandoning it. That leaves a thick, empty zone at the boundary, called the depletion region, which blocks current like a solid wall.
A Little More Precisely: The Magic of Making Light and Tidying Power
To be a bit more precise, a diode is more than a shield against backflow. The electricity from a wall outlet is alternating current (AC), which reverses direction over a hundred times per second. Most precise electronics need direct current (DC), which flows steadily one way. Pass AC through a diode and only one direction gets through, giving you current that flows one way. To smooth that into steady DC, a part like a capacitor is added too. This process is called rectification, turning AC into DC.
Diodes can also make light. When electrons and holes combine, they release extra energy. A diode designed to give off that energy as bright light is the LED (light-emitting diode) you see every day.
Going the other way, a photodiode produces electricity when light shines on it. That principle is at the heart of solar panels and smartphone camera sensors.
Common misconceptions
As long as you connect a diode in the forward direction, it passes 100% of the current with no resistance.
Even a diode needs a minimum push to open its door, called the threshold voltage (about 0.7 V for a silicon diode). Only when the voltage goes past that point does the door open fully and current start to flow freely.
Where you meet it
Inside a smartphone charger, diodes rectify the AC from the wall outlet into DC that suits the phone's battery.
At the tip of a TV remote, an infrared LED sends out an invisible beam of light to change the channel.
In one sentence
A diode is a one-way semiconductor part that protects circuits by letting current flow in just one direction, and it can also turn AC into DC or create light.