We start the components block with the most ubiquitous element: the resistor, the component that controls the flow of electric current.
In physics class they tell us that it “opposes the flow of current.” And that’s true. But in practical electronics, we see them more as control elements.
We use them to protect delicate components, to “decide” what a 0 and a 1 are when nobody is pressing a button, and to adapt voltages. Today we’ll look at the three star configurations: Limiting, Pull-Up/Down, and Voltage Dividers.
Current Limiting
The most immediate use of a resistor is protection. Many components, like LEDs or transistor bases, are very blunt: if you give them free access to the power supply, they’ll try to draw infinite current until they burn up (they literally explode or melt in milliseconds).
A limiting resistor is placed in series to limit the amount of current flowing through the device.
Example: Limiting a LED’s Resistor
This is the operation you’ll do a thousand times. You want to connect a standard red LED to a 5V output (Arduino).
-
Data:
(you must check this in the datasheet). ( ).
-
Ohm’s Law:
In practice, we use standard values. The closest value above is usually 220Ω or 330Ω. It will be slightly dimmer, but the LED will last longer.
Pull-Up and Pull-Down Resistors
The “floating” pin problem. Suppose we have a push button connected to a digital input.
- If you press it → You apply 5V (HIGH).
- What if you DON’T press? → The wire is left “in the air.” It is not connected to anything.
A wire in the air acts as an antenna. It picks up electromagnetic noise from the room (radio waves, the 50Hz mains power, your own static). The Arduino will randomly read 0s and 1s. This is called a floating state or high impedance (𝑍).
The solution is to fix the state. We need to force the pin to have a known value when the button is not pressed.
Pull-Down Resistor
We connect a resistor (typically 10 𝑘Ω) between the pin and GND.
- Without pressing: The resistor gently “pulls” the pin towards 0V. The Arduino reads a stable LOW.
- When pressing: we connect the pin directly to 5V. The pin reads
HIGHand a limited current flows through the resistor toGND.
Pull-Up Resistor
We connect the resistor between the pin and Vcc (5V).
- Without pressing: The resistor keeps the pin at 5V. The Arduino reads a stable HIGH.
- When pressing: the button connects the pin to
GND. The Arduino readsLOWand the resistor limits the current fromVCC.
With a pull-up, the logic is inverted: without pressing we read
1, and when pressing we read0.
Many microcontrollers have internal pull-up or pull-down resistors, though not necessarily on all pins. Check your specific model; in Arduino, pinMode(pin, INPUT_PULLUP) activates the pull-up when the pin supports it.
Resistive Sensors and Voltage Dividers
As we saw in the previous module, the voltage divider uses two resistors in series to obtain a lower voltage.
Real-world application: Reading resistive sensors
Many sensors do not generate voltage; instead, they change their resistance:
- LDR: Varies with light.
- NTC Thermistor: Varies with temperature.
- Potentiometer: Varies when you turn the knob.
An analog input measures voltage, not resistance directly. That’s why we place these sensors in a divider circuit with a fixed resistor. As the sensor’s resistance changes,