Current-Limiting Resistor & Ohm’s Law (V = I · R)
A resistor limits electrical current in a circuit to protect LEDs and microcontroller pins from burning out. Using Ohm’s Law (V = I · R), an LED wired to a 5V Arduino pin requires a 220 Ω to 330 Ω series resistor.
How It Works & Why It Matters
Without a resistor, a standard 2V LED connected directly to 5V draws excessive current and quickly destroys either the LED or the Arduino I/O pin.
LEDs are polarized diodes: the longer leg (Anode +) connects toward power/pin, while the shorter leg / flat edge (Cathode -) connects toward GND.
R = (V_supply - V_LED) / I_LED R = (5V - 2V) / 0.015A = 200 Ω -> Use standard 220 Ω resistor
🏫 Classroom Example
Always place a 220 Ω resistor in series with each LED leg in traffic-light or Smart Home circuits.
⚖️ LED Polarization vs. Resistor Polarization
LEDs are polarized (+ long leg, - short leg) and only light up one way; resistors have NO polarity and work in either orientation.
Plugging an LED directly across 5V and GND without a resistor, or mixing up 220 Ω (LEDs) with 10 kΩ (button pull-up/pull-down).