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 846 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
Parents
  • 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
Reply
  • 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
Children
No Data
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