element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
element14's The Ben Heck Show
  • Challenges & Projects
  • element14 presents
  • element14's The Ben Heck Show
  • More
  • Cancel
element14's The Ben Heck Show
Forum Viewer Question: Pull Up Resistors
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join element14's The Ben Heck Show to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 5 replies
  • Answers 2 answers
  • Subscribers 32 subscribers
  • Views 835 views
  • Users 0 members are here
Related

Viewer Question: Pull Up Resistors

e14 Contributor
e14 Contributor over 13 years ago

Hi can you please explain pull up/pull down resistors but please don't use the standard switch, logic gate, resistor schematic. I've seen that a thousand times online an I'm still confused.

 

I would like to be more specific with my question but it's hard to be when you don't know what you're even talking about. i guess i'm confused about what this logic gate is in these schematics, why 5V is constantly being supplied to them through a resistor, why this switch is connected to ground, and basically everything else about it...sorry, confusing question from a confused individual...basically pull up resistors: please explain. thank you!

  • Sign in to reply
  • Cancel
  • johnbeetem
    0 johnbeetem over 13 years ago

    Wikipedia has a good explanation: http://en.wikipedia.org/wiki/Pull-up_resistor

     

    The purpose of a pull-up (or pull-down) resistor is to force a circuit node to a voltage when nobody else is driving it.  Most logic technologies nowadays require that their inputs be a solid logic 1 = TRUE (usually more than 2.0V) or a solid logic 0 = FALSE (usually less than 0.8V).  If the input voltage is between those the input circuit may become sad and (for example) consume excess power.

     

    Pull-up resistors are sometimes needed when you first apply power to a circuit so that circuit nodes go to the correct value while the rest of the circuit is powering on.  For example, most microprocessors treat their general-purpose I/O pins as inputs until their software turns them into outputs.  If the output is connected to something critical, it's important that it have the correct value as the processor is booting.

     

    In the Wikipedia circuit, if the switch is open then the pull-up resistor pulls the logic gate to Vin, which the gate considers to be a logic 1 (TRUE).  If you close the switch, the direct connection to ground is stronger than the pull-up resistor so the logic gate input goes to 0V which the gate considers to be logic 0 (FALSE).  When the switch is closed, a small amount of current flows through the resistor.  The amount of current is Vin/R.  For example, if Vin is 5.0V and R is 10K Ohms, the current is 0.5 mA.  This is wasted power, in this case 2.5 mW.

     

    Hope this helps.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • Problemchild
    0 Problemchild over 13 years ago in reply to johnbeetem

    As John says the Pull up or Pull down resistor will serve to connect the input to a logic Hi or low respectively when the input isn't been driven and would tend to "float" to an undetermined value.

    Obviously you want the resistor value to be low enough to allow a reasonable current to flow  but conversely high enough that it does not stress the output of the previous stage if there is one.

    For most logic gates resistors of several K ohms are usedand yes as John says they do just sit there disapating your hard earned power image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • e14 Contributor
    0 e14 Contributor over 13 years ago

    OK this is becoming clearer, thank you. So, i'll present a practical example because that's easier for me to usderstand. Going off the wikipedia diagram, let's say the logic gate is actually pin1 of an mc (i understand that many mc's have built in pullup resistors, but please indulge me). So positive voltage is connected to a resistor, maybe 2k ohms, this is connected to pin1 and a switch that, when pushed, turns on an LED connected to pin2 of the mc.

     

    Now when I'm programming the chip, I need to say whether pin1 should be set high or low, is that right? Depending on whether I'm using a pullup or pulldown resistor. So in this case I would program to mc to recognize a high voltage as a normal state, and when the voltage drops it should activate pin2, turning on the LED. All good so far? One question is, am I wasting power by having a pullup resistor on pin1? wouldn't it be better to have 0V as the normal voltage so I only use voltage when the button is pushed?

     

    (and i think i just figured out what was confusing me...it's the Vout in that diagram. I was associating Vin with Vout, that is, I thought once that switch was closed, Vin would supply the voltage to, in our example pin2, and light the LED. but this didn't make sense to me because Vin goes straight to ground, so I didn't understand how Vout was supplying power to pin2 from Vin. BUT this is just logic operations and there is other power supplied to pin2, right? Vout is actually misleading)

     

    thanks!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • johnbeetem
    0 johnbeetem over 13 years ago in reply to e14 Contributor

    Paul B wrote:

     

    OK this is becoming clearer, thank you. So, i'll present a practical example because that's easier for me to usderstand. Going off the wikipedia diagram, let's say the logic gate is actually pin1 of an mc (i understand that many mc's have built in pullup resistors, but please indulge me). So positive voltage is connected to a resistor, maybe 2k ohms, this is connected to pin1 and a switch that, when pushed, turns on an LED connected to pin2 of the mc.

     

    Now when I'm programming the chip, I need to say whether pin1 should be set high or low, is that right? Depending on whether I'm using a pullup or pulldown resistor. So in this case I would program to mc to recognize a high voltage as a normal state, and when the voltage drops it should activate pin2, turning on the LED. All good so far? One question is, am I wasting power by having a pullup resistor on pin1? wouldn't it be better to have 0V as the normal voltage so I only use voltage when the button is pushed?

     

    (and i think i just figured out what was confusing me...it's the Vout in that diagram. I was associating Vin with Vout, that is, I thought once that switch was closed, Vin would supply the voltage to, in our example pin2, and light the LED. but this didn't make sense to me because Vin goes straight to ground, so I didn't understand how Vout was supplying power to pin2 from Vin. BUT this is just logic operations and there is other power supplied to pin2, right? Vout is actually misleading)

     

    thanks!

    The inputs of all micro-controllers I know of are high-impedance CMOS, so unless you turn on a pin's internal pull-up or pull-down it hardly uses any power except when the input is changing between Logic 0 and Logic 1.  This means it doesn't matter whether you use a pull-up so that the input is normally Logic 1 or a pull-down so that the input is normally Logic 0 -- the circuit will only draw power when the button is pressed.  Your software needs to know whether Logic 1 means pushed or not pushed.

     

    Pull-ups are a lot more common.  The electrical reason is that NFETs are more efficient than PFETs, so it's easier for a chip output to pull a node down that to pull it up.  The choice is also a legacy of TTL (Transistor-Transistor Logic) where floating inputs pulled themselves up, though it was good design practice to include explicit pull-up resistors to increase the strength of the pull-up.

     

    Yes, the use of Vin and Vout in the Wikipedia diagram are a bit confusing.  In your case Vout is an internal node in your micro-controller: it's the output of the input buffer pad that protects the uC innards from the outside world.  Vin is really the supply voltage, and is probably the same +5V or +3.3V that's the supply voltage for your uC.  The diagram does not show the power and ground connections for the logic gate.  They are normally Vin for supply and the same GND as the bottom connection of the switch.  This means that the power supply for Vin has to be strong enough to power your uC and the wasted power when the switch is closed.  In my first reply I suggested a 10K Ohm pull-up, which draws 0.5mA from a 5.0V supply when the switch is closed.  This is probably small compared to the tens or hundreds of mA needed by the uC when it's running.  In a battery-powered application, you might want to use a larger pull-up (say, 100K) but first you need to check the data sheet for the uC to see how much leakage current inputs have and consider how much delay there will be because the resistor has to charge any stray capacitance.  With 10K you most likely don't have to worry about these considerations.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • benheck
    0 benheck over 13 years ago

    Good explanations below!

     

    In really simple terms, connections, especially inputs, should have a "default" state, instead of being open, or "floating". A reistor can set this by making it be high or low. Then, when something else makes the state change (a switch or other IC) the pin can change but the resistor prevents a direct short.

     

    Also not all MCU's have internal pull ups. On our pinball machine for example, it uses a PIC32 with no pull ups. All of the high-power solenoid signals have pull DOWNS so upon boot or other weirdness, they are guaranteed to be OFF.

     

    Unless space is limited, external pull up/downs are always a good idea, even on MCU's with internal ones.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube