banner

News

Nov 12, 2023

What Is a Pull Up Resistor and How Do You Use One?

Pull-up resistors are essential in many digital circuits. Let's talk about how pull-up resistors work and how to use them.

Image making a digital circuit where a push button is required to turn on an LED. You wire up the circuit properly, connecting one end of the push button to a digital input and ground to the other. When you finally supply power, you notice that the LED goes on and off without you pushing the switch.

If you’ve ever observed situations like this, it is likely that you forgot to add a pull-up resistor to your digital circuit. So what exactly is a pull-up resistor? How does it work, and how do you use one?

A pull-up resistor is a resistor you add to a digital circuit to avoid unwanted signals which may interfere with your circuit's logic or programming. It is a way to bias or pull an input line to positive or VCC when no other active device is driving the line. By pulling the line to VCC, you effectively set the default state of the line to 1 or true.

Setting a default state of all input pins is important to avoid random signals generated during its floating state. An input pin is in a floating state when it gets disconnected from an active source such as ground or VCC.

Pull-up resistors are typically used in digital circuits using microcontrollers and single-board computers.

When using a momentary switch on a digital circuit, pushing the switch will cause the circuit to close and transmit true or high to the microcontroller. However, disengaging the switch won't necessarily stop the input pin from sending such signals.

This is because cutting the connection through a switch means it's no longer connected to anything but air. This causes the line to be in a floating state, where signals from the environment could potentially cause the pin to raise high at any given moment.

To stop these stray signals from registering into your circuit, you’ll have to inject the input line with enough voltage for it to keep registering high when ground is no longer detected. However, you cannot directly plug VCC into the input line since the circuit will short as soon as the switch/sensor connects the line to ground.

To avoid shorting the pull-up voltage, you’ll need to use a resistor. Having the right value resistor will ensure that the floating line will have enough voltage to raise high while low enough as not to prematurely short the circuit. The amount of resistance will depend on the logic type your circuit is using.

To properly calculate the resistance value of your pull-up resistor, you’ll need to know what logic type your circuit is using to operate. The logic family that your circuit uses will dictate the resistance value your pull-up resistor will need.

There are several types of logic. Here are a few of them:

Abbreviation

Name

Example Circuits

Min V on

Max V off

CMOS

Complementary Metal-Oxide Semiconductor

DSP, ADC, DAC, PPL

3.5

1.5

TTL

Transistor-Transistor Logic

Digital clocks, LED drivers, memory

2.0

0.8

ECL

Emitter-Coupled Logic

Radar, laser, particle accelerators

-1.5

-1.8

DTL

Diode-Transistor Logic

Flip-flops, registers, oscillators

0.7

0.2

If you aren't sure which logic family you're using, it is very likely that your circuit is using CMOS or TTL logic families, as ECL and DTL have long been outdated. Chip markings with prefixes using "74" or "54" are typically TLL chips, while chip markings with "CD" or "MC" indicate a CMOS chip. If you're still unsure, you can easily find out what logic family your controller is using by doing a quick search for its data sheet online.

Now that you understand the different types of logic families and their minimum on and maximum off voltages, we can now proceed to calculate values for our pull-up resistor.

To calculate the correct resistor value, you’ll need three values. The minimum on voltage of the logic family your circuit is using, the supply voltage of the circuit, and the input leakage current, which you can find on the data sheet or by using a multimeter.

Once you have all the variables, you can simply plug them into the following formula:

Resistance value = (supply voltage - logic high voltage) / input leakage current

For example, let's say your circuit uses TTL, and the input line is using 100uA at 5V. We know that TTL needs a minimum of 2V to raise high and a maximum of 0.8 volts to raise low. This would mean that the proper voltage exiting our pull-up resistor should be between 3V and 4V since the voltage has to be higher than 2V but no higher than our supply voltage which is 5V.

Our given values would be:

Now that we have the variables, let's plug them into the formula:

(5V - 4V) / 100μA = 10,000 ohms

Our pull-up resistor needs to be 10,000 ohms (10 kilohms or 10kΩ).

Pull-up resistors are typically used in digital circuits to avoid unwanted interference with a circuit's digital programming. You can use pull-up resistors if the digital circuit uses switches and sensors as input devices. Also, pull-up resistors will only be effective if the input pins are connected to ground. If the input pins are connected to VCC, you might want to use pull-down resistors instead.

To use a pull-up resistor, you’ll need to locate the input line that connects to an input device. Once located, you’ll want to calculate how the value of your resistor using the formula discussed earlier. If your circuit doesn't really require much precision, you can simply use resistor values ranging from 1kΩ to 10kΩ.

Now that you have your resistor with the proper value, you can place one end of the pull-up resistor to VCC and one end between the input device and the MCU. Congratulations! You now know what a pull-up resistor is and how to use one.

Some microcontrollers such as Arduino boards, and SBCs such as the Raspberry Pi, have internal pull-up resistors that you can trigger in the code in place of external pull-up resistors.

In summary, a pull-up resistor is an important component to help protect your circuit from nearby interferences. By setting the default state of an input pin to high, it prevents random signals from interfering with the logic or programming of your circuit. And now that you know how to use one, you may want to solidify your newfound knowledge by applying it to your next projects.

Craving to learn how things worked, Jayric Maning started tinkering with all kinds of electronic and analog devices during his early teens. He took up forensic science at the University of Baguio, where he got acquainted with computer forensics and cyber security. He is currently doing lots of self-study and tinkering with tech, figuring out how it works and how we can use it to make life easier (or at least cooler!).

MAKEUSEOF VIDEO OF THE DAY SCROLL TO CONTINUE WITH CONTENT CMOS TTL ECL DTL Resistance value = (supply voltage - logic high voltage) / input leakage current Supply voltage Logic high voltage Input leakage current (5V - 4V) / 100μA = 10,000 ohms
SHARE