How do pull up and pull down resistors remove electrical noise?

Click For Summary
Pull-up and pull-down resistors are essential in digital circuits to ensure that input pins on microcontrollers like Arduino have a defined logic level, either high or low, preventing them from floating and picking up random voltages. This is particularly important for CMOS inputs, which are high impedance and can be influenced by static charge or electromagnetic interference, leading to unpredictable behavior. The resistors create a stable connection to the power supply or ground, effectively eliminating the uncertainty associated with unconnected inputs. While some microcontrollers have internal pull-ups that can be enabled, external resistors are often recommended for guaranteed performance. Proper use of these resistors is considered good design practice in electronics to maintain reliable signal integrity.
  • #31
Rive said:
In general, I do agree.
In this particular topic, I feel like it's still not simple enough...
Too much simplicity can give the wrong lesson though, although I can see I wrote rather a lot. :wink:
Fact is that circuit theory is actually complicated and you can't safely take short cuts.
 
  • Like
Likes Rive
Engineering news on Phys.org
  • #32
kolleamm said:
I’m still confused as to how the resistors then solve this problem if they merely act as a filter at a part of the circuit.
Yes @berkeman is right, you should ignore noise and filtering for now.

I'm afraid I mislead you with my earlier post where I mentioned filtering in response to your "noise" related question. I was thinking of different, and frankly, uncommon noise problems in logic circuits. It's not that there is no filtering or noise issues, but they are subtle and rarely an issue in normal environments.

It sounds like your issue is inputs that might have an undefined digital input because the circuit connected doesn't force a valid digital 1 or 0 level.

The image below is part of the datasheet for a common CMOS IC. Consider the Vih and Vil specs. These define when the device will interpret your input voltage as a logic high (Vih) or logic low (Vil). Your device will also have a datasheet like this, although you may need to search a bit to find it.

Vih.jpg


What they are telling you here is that if you want the input to be read as high you must provide a voltage greater than the minimum value of Vih (>3.15V when operated from a 4.5V power supply). If you want the input to be read as low you must provide a voltage less than the maximum value of Vil (<1.35V when operated from a 4.5V power supply). As your input changes levels the device will switch at some voltage between these two guaranteed levels. So for reliable operation, you need to avoid an input voltage in the middle of this range. An input which is disconnected (like an open switch, for example) could be at any voltage. Avoid that.

edit: Some other logic families may also give you a specification for the current required by your circuit to drive the input high or low. These are normally called Iih (the current into get the input high) and Iil (the current out to get the input low). They don't have that for these simple CMOS inputs because the current is really small (typically 0) and in either direction, so, instead, you'll find an input leakage current spec somewhere else in this data sheet which may look like ±1μA, or something similar.
 
Last edited:
  • #33
This link https://NDAcademy.FoxPing.com/ => Electronics is Easy? => 5.1 Digital Component Basics --- and 3.5 FETs (Field Effect Transistors) --- describe the role of pull-up and pull-down resistors.
 
  • #34
DaveE said:
uncommon noise problems in logic circuits.
If you are including interference and crosstalk in that comment then it's very common when using a technology at its maximum. An unterminated input pin can attain a level that takes it 'either way'. Why take the risk? Just give it a defined level.
 
  • #35
berkeman said:
Second, if CMOS inputs are floating near their mid-input voltage (say around 2.5V for a 5V CMOS input), the whole logic gate circuit can go into the linear region for the transistors, and conduct significant current from the power rail to ground. Typically it won't be enough current to hurt the logic, but it will put you well above your Icc budget for the circuit.

This is very correct and important, the following is a real example of my own experience.

I used to work in a company that designed and produced electronic quartz watches. If we received thousands of microcontroller mask chips, and then discovered that the software engineer had forgotten to use a resistor to connect one of the microcontroller’s input ports to power or ground, it would have disastrous consequences for the company, not only financial loss, but also unable to deliver the goods to the customer on time.

The current consumption of the watch is just about one 1.5uA, for a 20mAh coin cell battery, the battery life is around 20/0.002 = 1.5 years, as long as there is one CMOS input port of the microcontroller floating, the consumption current may jump from 1.5uA to 5uA, this will greatly reduce the battery life from 1.5 years to less than half a year.

Even if it does not affect all other functions of the watch, no one will buy a watch with a battery life of less than half a year. 😢
 
  • Like
Likes sophiecentaur
  • #36
alan123hk said:
the software engineer had forgotten to use a resistor to connect one of the microcontroller’s input ports to power or ground

Sorry, the expression here may be unclear. Of course, software engineers do not need to add real resistors to the circuit. They only need to use software instructions to enable the pull-up or pull-down resistor inside the microcontroller.
 
  • #37
I'm not aware of any pull-up resistors and pull-down resistors inside a microcontroller. Pull-up resistors and pull-down resistors are attached as part of the electronic hardware design. There are no switches to enable / disable them (switches would add cost and consume real estate). See for info about pull-up and pull-down resistors.
 
  • #39
I've designed electronics and written code for microprocessors and microcontroller for more than 40 years (Texas Instruments, 3M, Emerson). I'm curious, which microcontroller has internal pull-ups and pull-downs? Thanks!
 
  • #40
Thinking more about this, when pull-ups and pull-downs are attached to the electronics, they are active immediately when power is applied. Waiting for a micro to enable them is too late.
 
  • #41
bhs67 said:
I've designed electronics and written code for microprocessors and microcontroller for more than 40 years (Texas Instruments, 3M, Emerson). I'm curious, which microcontroller has internal pull-ups and pull-downs? Thanks!
Yep. Some do that. You can look into the PxREN configuration in MSP430s for example (there are others too).
Skip ahead to about 8:20 in this video:
https://training.ti.com/msp430-workshop-series-3-12-using-mspware-gpio
 
  • #42
bhs67 said:
I'm curious, which microcontroller has internal pull-ups and pull-downs?
...
Waiting for a micro to enable them is too late.
It's a common solution when the uC has configurable GPIO pins (which can serve as various type of input or output pins depending on the configuration).
The EE still has to ensure that things does not go haywire while they are not configured (during startup, reset, SW error and so on).
 
  • Like
Likes alan123hk and DaveE
  • #43
I know some PIC ucontrollers have pull-ups. 18F2520 for instance has pull-ups on one set of ports. Download the data for it if you wish to see.
 
  • #44
I like to think of the pull-up and pull-downs as changing the load impedance in a resistor divider. Here is what I mean.

Think of this simple circuit:

Vn 2 0 *something*
Rs 2 1 'Zsrc'
Ri 1 0 'Zin'

Where node 1 is the voltage on the input pin in question. The Vn source is any noise source. Ri is the input impedance of the buffer. Rs is the strength of the coupling between the noise source and node 1.

Without a pull-up the input impedance (Zin) can be quite high. For example I'm looking at a STM32 data sheet that says it can have an input leakage current into a GPIO as high as 350nA at 3.3V for a Zin=3.3V/350nA ~= 10MΩ.

So say Vin was a 2Vpp noise source coupled to this pin, and it didn't even have a trace, if Zsrc (the strength of the coupling) was anything less than (Vil=0.4*3.3)*10M/2=6.6MΩ then this noise source could exceed Vil(max) of this input. If I add a 10K pull down to the pin then it will be in parallel with Ri, lowering the load impedance of this net, and now for my same 2Vpp to trip Vil(max) the coupling needs to be less than 6.6KΩ, which is so strong that it's probably not going to happen by mistake.

Here is another point to consider. GPIOs which are off, or high Z, don't actually source 0A. My same STM32 can source as much as 10uA from the pad even in HiZ (Off transistors also leak, see the Idss line item in a FET spec) and that's enough current to drive our 10MΩ input all the way up to the power rail. If we add the 10K pull down then that same 10uA will only pump the input up to 100mV which is safely below Vil(max).
 
  • #45
I've used lots of MSP430's. I never realized they have internal pull-up / pull-down resistors. I never used them (I used SPI for communication).

When a FET is connected to a micro output pin, I always put a pull-up on the gate of a P Channel FET and a pull-down on the gate of an N Channel FET. This is to ensure the FET is "off" when power is applied.

The pull-up resistor impedance needs to be high enough for the micro output to properly sink the current. The pull-down resistor impedance needs to be high enough for the micro output to properly source the current.
 
  • #46
There will be different considerations for different situations.

For some products, such as smart watches, apart from the battery and LCD, the internal space left for the electronic circuit board is extremely limited, and some electronic sensors may be placed, including heartbeat sensor, accelerometer (pedometer), etc., the last remaining space may be just fit in a microcontroller (wafer/dice form) about 2mm by 2mm, so even the space occupied by a small 0402 resistor will be saved as much as possible. Moreover, when producing such small and dense circuit boards, the number of parts on the circuit board must be minimized to reduce the chance of failure and production costs.
 
  • #47
Good point! At my last project, inadvertently blowing up an oil refinery was not an option!

The 0201 resistor is a tiny size. They may make them smaller now.

A lightning strike can create a voltage pulse, that can misdirect the micro firmware, which could misdirect the micro output. When possible, I prefer a solder joint vs. relying on a micro output.

It seems that these precautions would be implemented for air planes, automobiles, etc.

Striving to have zero failures has always been my highest priority for all products! :-)
 

Similar threads

Replies
6
Views
7K
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
12
Views
2K
  • · Replies 21 ·
Replies
21
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K