• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Electronics Theory / Understanding Pull-Up and Pull-Down Resistors with Diagrams and Formulas

Understanding Pull-Up and Pull-Down Resistors with Diagrams and Formulas

Last Updated on August 9, 2019 by Swagatam 2 Comments

In this post I am going to explain pull-Up resistor and pull-down resistor, why they are commonly used in electronic circuits, what happens to electronic circuits without Pull-Up or Pull-down resistor, and How to calculate Pull-Up and Pull-down resistor values and finally we will see about open collector configuration.

Table of Contents
  • How Logic Inputs and Outputs Work in Digital Circuits
  • Undefined Input Logic Levels
  • Calculating Pull-Up Resistor value:
  • Multiple gate Pull-Up resistors
  • Pull-Down Resistors:
  • Open collector output / Open Drain:

How Logic Inputs and Outputs Work in Digital Circuits

In digital electronics and most microcontroller based circuits the involved digital signals are processed in the form of logic1 or logic0, i.e. “HIGH” or “LOW”.

Digital logic gates become the fundamental units of any digital circuit, and by utilizing “AND”, “OR” and “NOT” gate we are able to build complex circuits, however as noted above digital gates can accept only two voltage levels which “HIGH” and “LOW”.

The “HIGH” and “LOW” are generally in the form of 5V and 0V respectively. “HIGH” is also referred as “1” or positive signal of the supply and “LOW” is also referred as “0” or negative signal of the supply.

Problems arise in a logic circuit or a microcontroller when the fed input is somewhere in the undefined region between 2V and 0V.

In such a situation a logic circuits or microcontroller may not recognize the signal properly, and the circuit will make some wrong assumptions and execute.

Generally a logic gate can recognize the signal as “LOW” if the input is below 0.8V and can recognize the signal as “HIGH” if the input is above 2V. For microcontrollers this can actually vary a lot.

Undefined Input Logic Levels

The problems arise when the signal is between 0.8V and 2V and varies randomly at the input pins, this issue can be explained with an example circuit using a switch connected to an IC or a microcontroller.

warning message: electricity is dangerous, proceed with caution
microcontroller

Assume a circuit using a microcontroller or an IC, if we close the circuit, the input pin goes “LOW” and the relay turns “ON”.

If we open the switch, the relay should turn “OFF” right? Well not really.

We know that the digital ICs and digital microcontrollers only takes input as either “HIGH” or “LOW”, when we open the switch, the input pin is just open circuited. It is neither “HIGH” nor “LOW”.

The input pin must be “HIGH” in order to turn the relay off, but in the open situation this pin becomes vulnerable to stray pickups, stray static charges, and other electrical noise from surrounding, which can cause the relay to go ON and OFF randomly.

To prevent such random triggers due to stray voltage, in this example it becomes mandatory to tie the shown digital input pin to a “HIGH” logic, so that when the switch is flipped off, the pin automatically connects to a defined state “HIGH” or the positive supply level of the IC.

To keep the pin “HIGH” we can connect the input pin to Vcc.

In the below circuit the input pin is connected to Vcc, which keeps the input “HIGH” if we open the switch, which prevents random triggering of the relay.

You may think, now we have the solution worked out. But no....not yet!

micro

As per the diagram if we close the switch there will be short circuit and shut off and short circuit the whole system. Your circuit can never have any worst situation than a short circuit.

The short circuit is due to very large current flowing through a low resistance path which burns the PCB traces, blowing of fuse, triggering safety switches and even may cause fatal damage to your circuit.

To prevent such heavy current flow and also to keep the input pin in “HIGH” condition, we can utilize a resistor which is connected to Vcc, that is between the "red line".

In this situation the pin will be in a “HIGH” state if we open the switch, and on closing the switch there won’t be any short circuit, and also the input pin is allowed to directly connect with the GND, making it “LOW”.

If we close the switch there will be negligible voltage drop via the pull-Up resistor and rest of the circuit will remain unaffected.

One must choose the Pull-Up / Pull-Down resistor value optimally so that it won’t draw excess through the resistor.

Calculating Pull-Up Resistor value:

To calculate an optimum value, we have to know 3 parameters: 1) Vcc 2) Minimum threshold input voltage which can guarantee to make the output “HIGH” 3) High level input current (The required current). All these data are mentioned in the datasheet.

Let’s take the example of logic NAND gate. According to its datasheet Vcc is 5V, minimum threshold input voltage (High level Input voltage VIH) is 2V and High level input current (IIH) is 40 uA.

By applying ohm’s law we can find the correct resistor value.

R = Vcc - VIH (MIN) / IIH

Where,

Vcc is the operating voltage,

VIH (MIN) is HIGH Level Input voltage,

IIH is the HIGH Level Input Current.

Now let’s do the matching,

R = 5 - 2 / 40 x 10^-6 = 75K ohm.

We can use a resistor value maximum of 75K ohm.

NOTE:

This value is calculated for ideal conditions, but we don’t live in an ideal world. For best operation you may connect a resistor slightly lower than calculated value say 70K, 65k or even 50K ohm but don’t reduce the resistance low enough that it will conduct huge current for example 100 ohm, 220 ohm for the above example.

Multiple gate Pull-Up resistors

In the above example, we saw how to pick a Pull-up resistor for one gate. What If we have 10 gates which all are need to be connected to Pull-Up resistor?

One of the ways is to connect 10 Pull-Up resistors at each of the gate, but this isn’t cost effective and easy solution. The best solution would be connecting all the input pins together to single Pull-Up resistor.

To calculate the Pull-Up resistor value for the above condition follow the formula below:

R = Vcc - VIH (MIN) / N x IIH

The “N” is the number of gates.

You will notice that the above formula is the same as the previous one; the only difference is multiplying the number of gates.

So, let’s do the math again,

R = 5 -2 / 10 x 40 x 10^-6 = 7.5K ohm (maximum)

Now for the 10 NAND gates, we got the resistor value in a way that the current is 10 times higher than one NAND gate (In previous example), so that the resistor can maintain minimum of 2V at peak load, which can guarantee the required output without any error.

You can use the same formula for calculating Pull-Up resistor for any application.

Pull-Down Resistors:

The Pull-Up resistor keeps the pin “HIGH” if no input is connected; with Pull-down resistor, it keeps the pin “LOW” if no input is connected.

The pull-down resistor is made by connecting the resistor to ground instead of Vcc.

The Pull-Down can be calculated by:

R = VIL (MAX) / IIL

Where,

VIL (MAX) is LOW level input voltage.

IIL is LOW level input current.

All these parameters are mentioned in the datasheet.

R = 0.8 / 1.6 x 10 ^-3 = 0.5K ohm

We can use maximum of 500 ohm resistor for Pull-down.

But again, we should use a resistor value less than 500 ohms.

Open collector output / Open Drain:

We can say a pin is “open collector output” when the IC can’t drive the output “HIGH” but can only drive its output “LOW”. It simply connects the output to the ground or disconnect from ground.

We can see how the open collector configuration is made in an IC.

microcontroller circuit

Since the output is either ground or open circuit, we need to connect an external Pull-Up resistor which can turn the pin “HIGH” when the transistor is OFF.

This is same for Open drain; the only difference is that the internal transistor inside the IC is a MOSFET.

Now, you may ask why do we need an open drain configuration? We need to connect a Pull-Up resistor anyway.

Well, the output voltage can be varied by choosing different resistor values at the open collector output, so it gives more flexibility for the load. We can connect load at output which has higher or lower operating voltage.

If we had a fixed pull-up resistor value we can’t control the voltage at the output.

One disadvantage of this configuration is that, it consumes huge current and may not be battery friendly, it need higher current for its correct operation.

Let’s take example of IC 7401 open drain logic “NAND” gate and see how to calculate pull-up resistor value.

We need to know the following parameters:

VOL(MAX) which is the  maximum input voltage to IC 7401 which can guarantee to turn the output “LOW” (0.4V).

IOL(MAX) which is the Low level input current (16mA).

Vcc is the operating voltage which is 5V.

calculation

So, we here we can connect a Pull-Up resistor value around 287 ohm.

Have any questions? Please use the comment box below to express your thoughts, your queries will be replied ASAP

You'll also like:

  • 1.  How to Connect Transistors (BJT) and MOSFET with Arduino
  • 2.  MOSFETs – Enhancement-Type, Depletion-Type
  • 3.  IC 4060 Pinouts Explained
  • 4.  Zener Diode Circuits, Characteristics, Calculations
  • 5.  How to Generate PWM Using IC 555 (2 Methods Explored)
  • 6.  Understanding AC Circuit and Calculating AC Waveform

About Swagatam

I am an electronics engineer with over 15 years of hands-on experience. I am passionate about inventing, designing electronic circuits and PCBs, and helping hobbyists bring their projects to life. That is why I founded homemade-circuits.com, a website where I share innovative circuit ideas and tutorials. Have a circuit related question? Leave a comment.... I guarantee a reply!

Previous Post: « Digital Buffer – Working, Definition, Truth Table, Double Inversion, Fan-out
Next Post: Understanding Scalar (V/f) Control for Induction Motors »

Reader Interactions

Comments

  1. Sasa says

    March 19, 2021 at 7:29 am

    How to rewire xl6009 with pull up pull down on a xl6009 buck booster ? Where coul I find a diagram ?

    Reply
    • Swagatam says

      March 19, 2021 at 8:30 am

      Why would you need a pull up or pull down resistor in xl6009?

      Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Subscribe to New Circuit Ideas

Categories

  • Arduino Projects (87)
  • Audio and Amplifier Projects (132)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (83)
  • Datasheets and Components (104)
  • Electronics Theory (143)
  • Free Energy (37)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (19)
  • Health related Projects (25)
  • Home Electrical Circuits (12)
  • Indicator Circuits (14)
  • Inverter Circuits (87)
  • Lamps and Lights (142)
  • Meters and Testers (69)
  • Mini Projects (46)
  • Motor Controller (64)
  • Oscillator Circuits (27)
  • Pets and Pests (15)
  • Power Supply Circuits (108)
  • Remote Control Circuits (50)
  • Security and Alarm (64)
  • Sensors and Detectors (101)
  • Solar Controller Circuits (59)
  • Temperature Controllers (42)
  • Timer and Delay Relay (49)
  • Transmitter Circuits (29)
  • Voltage Control and Protection (37)
  • Water Controller (36)

Calculators

  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator
  • Filter Capacitor Calculator
  • Buck Converter Calculator
  • Boost Converter Calculator
  • Solar Panel, Inverter, Battery Calculator
  • Wire Current Calculator
  • SMPS Transformer Calculator
  • IC SG3525, SG3524 Calculator
  • Inverter LC Filter Calculator

People Also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Recent Comments

  • Swagatam on 10 LED Tachometer Circuit Diagram
  • Swagatam on How Shunt Regulator TL431 Works, Datasheet, Application
  • Göran on 10 LED Tachometer Circuit Diagram
  • SA on How Shunt Regulator TL431 Works, Datasheet, Application
  • Swagatam on Adjustable 0-100V 50 Amp SMPS Circuit

Company

  • Privacy Policy
  • Cookie Policy
  • About Me
  • Contact
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Quora
  • Stack Exchange
  • Linkedin
  • © 2025 · Swagatam Innovations