Rules to Establish Pull Up/Pull Down - Page 1
Forum section: electronics / beginners

author: Larsson55
author_rank: Regular Contributor
timestamp: June 27, 2022, 10:36:09 am
content: I have a BOB (breakout board) for a cnc machine I’m building with a number of input /output pins. On the outputs I have to set the COM jumper to either 5VDC or GND and on the input pins I have to set the jumpers to either pull up or pull down.I know the meaning of the pull up/dn and COM but how do I find out and understand what I need? Lets say I have a limit switch which is normally closed and when it opens it will stop the cnc. Are any rules here to tell me how to set my jumpers and why?I like to educate myself and understand why I need to set a jumper to a certain positionThank you

author: Zero999
author_rank: Super Contributor
timestamp: June 27, 2022, 10:50:27 am
content: It depends on whether the switch connects between the input and 0V or +V.

author: Larsson55
author_rank: Regular Contributor
timestamp: June 27, 2022, 11:50:47 pm
content: Let me see if I can get this correct. So if the switch connects between input and +V I will set the dip switch to pull down otherwise if the switch connects between input and 0V the dip will be set to pull up.

author: ledtester
author_rank: Super Contributor
timestamp: June 28, 2022, 05:10:01 am
content: Quote from: Larsson55 on June 27, 2022, 11:50:47 pmBasically that's it. For instance, see this diagram (fromhttps://circuitdigest.com/tutorial/pull-up-and-pull-down-resistor):The resistor determines what the input will be when the switch is open.Btw, if you select the wrong kind of resistor what will happen is that your switch won't change the input when pressed.

author: Zero999
author_rank: Super Contributor
timestamp: June 28, 2022, 07:05:35 am
content: Two other points:The power supply connected to the switch and pull-up/down must share a common 0V/ground with the logic circuit, which is probably a microcontroller or PLC inside our machine.The pull-up/down resistor must pass a minimum wetting current to ensure the switch's contacts reliably close and avoid noise. In this instance it shouldn't matter as DIP switches are designed to work with low currents. 10k is probably a reasonable value which will give 0.5mA.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: June 28, 2022, 07:18:47 am
content: I have been using AVR's (atmega8 and 328) since before "arduino" existed, and according to the datasheet they do not need an external pullup on the reset line because they have an internal pullup (which Is from memory 100k or so). However, when building a shaky circuit on a breadboard and attaching a programming cable to the reset pin I've had some unexpected resets. At some point I started adding a 12k pullup resistor (I have a bag of a few thousand of them) and after that the unexpected resets went away.So what youneeddepends a lot on the amount of noise your system can pick up and that depends on PCB layout an wiring but in practice is seems extremely unlikely you would ever need a stronger pullup then a 10k resistor. So unless power consumption is a real concern, something in that neighborhood is a simple choice. but always spend some effort into a good PCB design, especially when you expect noisy environments such as CNC machines which tend to have long cables going to motors and such.

author: Larsson55
author_rank: Regular Contributor
timestamp: June 28, 2022, 01:18:23 pm
content: My thanks to all, think I’m in the right direction and eventually I will get it

author: TomKatt
author_rank: Frequent Contributor
timestamp: June 28, 2022, 02:37:47 pm
content: The pull down or pull up resistor sets the default logic state of the input before any switch or other input triggers it. If you want default high you use a pull up resistor, for default low use a pull down. To "activate" the input to it's alternate state, apply GND to an input that is tied High with a PU resistor or apply VCC to an input tied Low with a PD resistor.It's fairly common for logic controller circuits to work with "inverse" logic - ie in many cases your input will be tied high with a PU resistor, and a switch or sensor "activates" the input by pulling it down to ground. So in that case a LOW input tells the controller that something happened. Using PU resistors eliminates the need of routing VCC throughout the equipment for inputs, with possible voltage drop or accidental shorting in the process. Instead, the commonly available GND can be used at any switch or sensor to trigger the input.PU/PD resistors guard against spurious noise signals triggering the input unintentionally.

author: TimFox
author_rank: Super Contributor
timestamp: June 28, 2022, 03:39:42 pm
content: A related application:If a logic input is to be fixed at either high or low, it is a good idea to connect it through an appropriate resistor to ground or high.This allows extra testing, if necessary, to evaluate if the device is working properly, without re-wiring the board.

author: Larsson55
author_rank: Regular Contributor
timestamp: June 28, 2022, 06:30:55 pm
content: Kind of difficult to understand what will make me decide if I need a pullup/dn. I know how the pullup/dn works, what it does and the resistors involved.So lets say you have a board with x number of inputs/outputs. When you looking at this board what will make you decide that this input/output needs a pullup/dn?Or perhaps it depends on what will be connected to these inputs/outputs?Like if you will connect a simple NC lever type limit switch this will be connected to pullup because it needs the +5VDC to function where a proximity switch needs pulldn because this switch has its own power supply but needs the GND (pulldown)?

author: cortex_m0
author_rank: Regular Contributor
timestamp: June 29, 2022, 12:54:18 am
content: Quote from: Larsson55 on June 28, 2022, 06:30:55 pmCorrect. For example, if you have a user interface button, whether you use a pull-up or pull-down at the microcontroller would depend on how you connect the button.If one side of the button is connected to VCC, then a pull-down would be used. When the button is closed, the microcontroller pin will be high, when the button is open, the pin will be low.On the other hand, if one side of the button is connected to GND, a pull-up would be used. In this configuration, when the button is closed, the microcontroller pin will be low, and when the button is open, the pin will be high.

author: basinstreetdesign
author_rank: Frequent Contributor
timestamp: June 29, 2022, 05:03:03 am
content: Quote from: Larsson55 on June 28, 2022, 06:30:55 pmLet's talk about inputs only for a bit:A large consideration to whether to use a pullup or a pulldown resistor and which way to connect the switch comes from the electrical characteristics of the input itself.Much of the logic world has legacy back to the days of TTL logic. That logic, consisting of the 74XX and 74LSXX series stuff has a very lopsided input voltage characteristic. A TTL-like input recognizes a logic LOW only when the input is between 0V and 0.8V. Not a lot of room there. But the logic HIGH is recognized when the input is between 2.4V and 5V. Much bigger range.A lot of uC/uP such as the Microchip ATMEGAXXXX and ATTINYXXX and a lot of PIC processors I/O as well as the older stuff are like this. So what do you do?In a case like this, when the switch is closed the voltage at the terminal is very well defined. If it shorts to ground you can be damn sure that the voltage there is very close to 0V. When its open it will snap up to near VCC but there may be noise added on to it. So the safe thing to do to avoid noise-induced false readings is to wire the switch from the input to 0V and tie the resistor as a PULLUP to VCC.If it were the other way around and the logical HIGH was narrower than the logical LOW then you might do it the other way 'round with the switch going to VCC and the resistor to 0V, but I don't think you'll find it that way.For CMOS logic such as the 4XXX or 74HCXXX families then the input thresholds are evenly matched and you can safely do it either way.On the subject of outputs:An output pullup may be desirable to make sure that the output went higher than it may typically do due only to its technology. A TTL output can be made to go to 4.5V when high instead of its usual 2.4 or 3.0V.Usually a pullup resistor on output is used only when the logic output has no on-silicon means to do so by itself, such as with open-collector or open-drain outputs. These types of outputs are used with WIRED-AND or WIRED-OR busses. You may want to google those terms.

author: ledtester
author_rank: Super Contributor
timestamp: June 29, 2022, 08:56:30 am
content: Quote from: Larsson55 on June 28, 2022, 06:30:55 pmThe output of a proximity switch comes in two varieties, NPN and PNP:https://www.omch.co/npn-and-pnp-proximity-sensors/and the pull-up/down resistor would be your "Controlled Load".