Diodes only allow electricity to flow in one direction: electricity easily flows from the anode (positive terminal) to the cathode (the negative terminal). In the other direction it severly resists current from the cathode to the anode.
An Example of Diodes
You’ve already encountered one type of diode: the LED or Light Emitting Diode. If you’ve ever wired an LED in the opposite way around it won’t light up. This is because it will only allow power to flow from the anode (longer terminal) to the catholde (negative pin).
On a standard diode, the cathode will be marked with a grey line (see below.) Again diodes only allow current to flow only when positive voltage is applied to the anode. This means you need to add it to your circuit with particular attention to where this marking is placed.
Why is a diode useful you might ask?
They’re important when working with motors or other actuators. When you turn the power off to a motor, it will stop spinning and rapidly decelerate. Sometimes, it can kick back and briefly spin in the other direction. This creates a negative spike of voltage that will flow into your circuit. There’s the potential for this spike to damage your Particle or the transistor that it’s connected to.
By adding a diode, we ensure that power will only flow in on direction: it protects against reverse current and preventing it by limiting the flow of current to a single direction.
In order to protect your circuit you need to note the line on the diode. When wiring to a transistor: the line should always be closest to the collector.
- About Diodes: https://learn.sparkfun.com/tutorials/diodes/all