CNAP

Resistor Reference

Fixed-value through-hole resistor. Used to limit current into LEDs and other components, or to pull signal lines HIGH/LOW.

Pin names

NameDescription
1First terminal
2Second terminal

Resistors are non-polarised — either terminal can be connected to either end of the circuit.

Attributes

NameDescriptionDefault
valueResistance in ohms. Accepts plain numbers ("220") or SI suffixes ("1k", "4.7k", "1M")"1000"

Common resistance values

ValueTypical use
"220"Current-limiting for a standard LED at 5 V
"330"Current-limiting for a standard LED at 5 V (slightly dimmer)
"1k"Pull-up / pull-down, base resistor for BJT
"4.7k"I²C pull-up
"10k"Pull-up / pull-down on digital inputs

Usage

The most common use is limiting current through an LED. Without a resistor, too much current flows and the LED burns out in real hardware.

Formula: R = (Vsupply − Vf) / If

For a standard red LED at 5 V:

  • Vf ≈ 2.0 V, If = 15 mA → R = (5 − 2) / 0.015 ≈ 200 Ω → use 220 Ω (next standard value)
// Pin 13 → 220 Ω resistor → LED anode → LED cathode → GND
const int LED_PIN = 13;

void setup() {
  pinMode(LED_PIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_PIN, HIGH);
  delay(500);
  digitalWrite(LED_PIN, LOW);
  delay(500);
}

Examples

DescriptionAttrs
220 Ω (LED current limiting){ "value": "220" }
1 kΩ{ "value": "1k" }
4.7 kΩ (I²C pull-up){ "value": "4.7k" }
10 kΩ (pull-up/pull-down){ "value": "10k" }

See also

  • LED — always use a resistor in series with an LED
  • Pushbutton — pull-down resistor keeps the input stable when the button is open