0
\$\begingroup\$

I have heard people state that if your micro controller is not reading the signal properly, then we need to use a pull-up resistor. Which I don't get? It makes sense when switch is involved because you don't want a floating signal. What I don't understand is why do my friends mentions the pull up resistor help in better voltage reading??

\$\endgroup\$
2
  • \$\begingroup\$ The idea of "floating" is more that tiny amounts of charge (like what makes tiny bits of paper stick to a brushed comb) can greatly vary the observed voltage. So slight variations in the available static charge around you, which varies widely based on humidity and the atmosphere and many other factors, can impact a voltage reading. By adding a known pull-up or pull-down resistor, you provide a faster path to allow accumulated charge to leave. So long as what's driving the input can easily overwhelm this "pull" resistor, that resistor only affects static charge, leaving the driven value. \$\endgroup\$ – jonk May 19 '20 at 4:53
  • \$\begingroup\$ Does electronics.stackexchange.com/questions/50605/… answer your question? \$\endgroup\$ – user_1818839 May 19 '20 at 12:11
0
\$\begingroup\$

It would help if you give more specifics as to where have you "heard" that and in which type of circuit. I can only say that while with a switch you have a floating input, with other components you have a leakage current which pulls the node up or down, so a pull-up or pull-down resistor serves to counter the effects of that leakage current. In short, we don't use pull-up or pull-down resistors only with switches because of their floating state, but also with other components (including, but not limited to, electrolytic capacitors and transistors) because of their leakage currents.

\$\endgroup\$
0
\$\begingroup\$

Sometimes it does not matter if you use a pull-up or pull-down resistor to keep default state of the data pin, and the pushbutton will overwrite that with another potential. Inside a plastic case you can have buttons wired with pull-downs and the buttons connect to common +5V wire. Some MCUs have internal pull-downs so you can omit external resiators.

However, it is far more common to find MCUs that only have internal pull-ups. And, if you want the buttons to be in a metal box, you most likely have the metal case grounded, and so it will be safer and easier to have buttons pulled up and switching to ground, to avoid short circuits of 5V to grounded metal case. Some chips, devices and buses can only pull to ground or let the wire float, as they have open-drain or open-collector outputs, so they need pull-ups for sure.

\$\endgroup\$
0
\$\begingroup\$

Do we only use pull-up resistor or pull-down resistors when dealing with switches?

Yes, but the switch can be an electronic one. We use them wherever the input can only pull one way.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Various configurations requiring pull-up resistors.

Each of the examples above can only pull the input low. As a result a pull-up is required.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.