Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Pull Up/Down Resistors, and when to use them?


  • Please log in to reply
9 replies to this topic

#1 Dan Morphis

Dan Morphis

    Advanced Member

  • Members
  • PipPipPip
  • 188 posts

Posted 04 February 2011 - 06:36 PM

I apologize if this is a basic question, I'm a software guy who is new to hardware design. When should one use a pull up/down resistor in their circuit? I've read the wikipedia article on what they are used for, I'm just unsure as to when you would use one in a circuit. Fundamentally, I understand that you would use a pull up/down resistor to make a pin either go high, or low in the absence of another signal. For example, in my circuit, I'm using a reed switch to trigger an IO high. So in my circuit, I put a 10k resistor from the IO to ground to keep the pin pulled low. and I've wired the reed switch between my IO pin, and 5v. In this case, its clear to my that I need to use a pull-down resistor. What other cases should I look for? I guess I'm looking for a rule of thumb type of deal.

#2 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 04 February 2011 - 07:32 PM

I guess a basic guideline is if you need to read a 0 or 1 reliably, and your circuit has an "open" state, say the reed switch, then you'll want to use a pull up/down resistor, depending on the circumstances. The problem with an open state is that the input will be open to the environment, so any stray charges can make the input go to 0 or 1 unpredictably. In your case, knowing nothing else about your circuit, you can probably get away with a "pull up" resistor instead, which the netduinos have built in and available for activation via software. This will simplify your circuit.

#3 SirPoonga

SirPoonga

    Advanced Member

  • Members
  • PipPipPip
  • 96 posts

Posted 04 February 2011 - 07:57 PM

What Bill said, but this is how I think about it. Pull up and down resistors can be thought up as insurance. It ensures you get accurate reading. You can get stray voltage so if you didn't have the resistor when you read the pin you may actually get something like 1.1v when it should have been 0v. It may be enough voltage that the pin reads high instead of low.

#4 Dan Morphis

Dan Morphis

    Advanced Member

  • Members
  • PipPipPip
  • 188 posts

Posted 04 February 2011 - 08:04 PM

I guess a basic guideline is if you need to read a 0 or 1 reliably, and your circuit has an "open" state, say the reed switch, then you'll want to use a pull up/down resistor, depending on the circumstances. The problem with an open state is that the input will be open to the environment, so any stray charges can make the input go to 0 or 1 unpredictably.


Thanks Bill! Thats exactly what I needed!

In your case, knowing nothing else about your circuit, you can probably get away with a "pull up" resistor instead, which the netduinos have built in and available for activation via software. This will simplify your circuit.


What about to drive a relay? If I were to go with a pull up resistor, wouldn't I have to switch from a NPN to a PNP? I'm thinking specifically about about the circuit at http://www.arduino.c...ning/relays.pdf

Or am I just over-engineering this, and the arduino relay circuit is fine?

Thank you for your help!

#5 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 04 February 2011 - 08:17 PM

You need pull ups/downs when ever there is any possibility a line will float so the line will instead maintain a state of high/low. Floating is bad .

#6 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 04 February 2011 - 09:53 PM

Thanks Bill! Thats exactly what I needed!



What about to drive a relay? If I were to go with a pull up resistor, wouldn't I have to switch from a NPN to a PNP? I'm thinking specifically about about the circuit at http://www.arduino.c...ning/relays.pdf

Or am I just over-engineering this, and the arduino relay circuit is fine?

Thank you for your help!


Sorry, not following you - I don't see where a pull up or pull down resistor would come into play. You do need a resistor to the base of the transistor, but that is not a "pull" in either direction. You *might* want to use a pull down to overcome the momentary pull up resistor during boot up.

#7 Dan Morphis

Dan Morphis

    Advanced Member

  • Members
  • PipPipPip
  • 188 posts

Posted 04 February 2011 - 11:22 PM

You *might* want to use a pull down to overcome the momentary pull up resistor during boot up.


That is what I did a very poor job of asking. So I would use a pull down on the IO pin I'm using to drive the relay of the Netduino, correct? What value resistor should I use? I've read in some places people say a 10k, others people say a 47k. What are your thoughts?

Thanks,
Dan

#8 Jan Olof

Jan Olof

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts
  • LocationSweden

Posted 04 February 2011 - 11:47 PM

Hi Just to be clear, you only need a pull down resistor to inhibit the activating of the relay at reset when the pin is set as a input with a pullup resistor. Fred in his relay drive circuit have found that a 2,2 K Ohm resistor was a good value. 2.2 K will only draw 1.5 mA from the available 8 or 16 mA when the output is high. /Jan Olof

#9 capn

capn

    Member

  • Members
  • PipPip
  • 14 posts
  • LocationNC

Posted 10 February 2011 - 07:51 PM

If you understand the fundamentals that is good enough. I am a mechanical engineer and usually only deal with analog devices so maybe I can help. I use pull down resistors on the emitter side of transistors to ensure that I get a guaranteed low state from them in logic circuits with low currents. I use pull up resistors on chips or other small current devices that need a guaranteed logic high out. I don't understand the whole "float" thing, but pull up/down resistors help in logic circuits mostly and don't see too much use in power circuits like H-bridges and such. I know simple chips like comparators and such need a pull up resistor to work properly, and some chips actually have built in pull up resistors. This may be the case for the Netduino, however I am not certain. Hope that helps.

Be patient with me, I'm new to this.


#10 freds

freds

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 11 February 2011 - 02:26 AM

I know simple chips like comparators and such need a pull up resistor to work properly, and some chips actually have built in pull up resistors. This may be the case for the Netduino, however I am not certain.

Hope that helps.


The processor chip used in the netduino is general purpose and comes up with every pin as a input which means it can float to a high or low level so is a undeterminate state without pull up or pull down resistors. It takes a bit of time for the .net infrastructure and your application to start running. So if a logic high causes motors/wheels to spin like mad, opps!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.