Hello
I would like to know when I should prefer, a pull-up and when a pull-down?
Hello
I would like to know when I should prefer, a pull-up and when a pull-down?
spyrto:
I would like to know when I should prefer, a pull-up and when a pull-down?
The answer is.... depends on requirement. Sometimes it doesn't matter which you use..... as long as the whole system performs to expectations. Other times.... you might have system performance requirements...including safety requirements, power requirements etc.... where one might be advantageous over the other.
Google the following: pullup or pulldown?
Or.... pullup vs pulldown resistor?
You should use the one which is appropriate for your application.
Which one that is depends on your application; since you haven't let us know what you want it for, it's hard to advise further.
If you are in a situation where either would work (for example, a button which could connect to gnd and use a pullup, or connect to vcc and use a pulldown), the pullup is often more convenient because you can usually use the internal pullup, saving you an external resistor. For buttons, this also has the benefit of not having the power rail in the vulnerable bundle of wires going to your control panel - imagine accidentally catching the power rail between the (grounded, metal) control panel and frame, so the edge of the panel cuts through the insulation, for example - compared to catching a ground wire in that way.
Other applications will of course have different requirements and complications.
Thanks for the answer:). Indeed it is for buttons.
@Southpark I looked in google but I found articles on how to create them
spyrto:
@southpark1 I looked in google but I found articles on how to create them
Most welcome spyrto.
Just google "pullup vs pulldown resistor arduino forum"..... and you will get good answers.
The usual recommendation is to search more through google. Use more time.... not 5 secs or 1 minute search.... but 10 min+ of searching. Even half an hour if needed.
Also note that -- whichever configuation we use... it just needs to perform to your expectations and requirements. If power consumption or power savings is important.... then 1 configuration can be better than the other..... depending on circumstance.
Right! On the Arduino it's easy to enable the [u]internal pull-ups[/u]. There is no internal pull-down so you have to add a resistor.
With a microcontroller you are in control of the logic so if you switch it around, you just have to change the software. ...An input-high can turn-on and LED or turn-off an LED, or whatever...
Pull-ups are far-far more common in digital electronics than pull-downs. If you can go either way, a pull-up is "more standard".
Open-collector and open-drain outputs require a pull-up.
For longish wires going to an input, suggest a normally closed switch to GND.
Use pull-ups to VCC on the pin in question.
The benefit of pull-ups is that the wires running out to the switches are either ground or inputs - shorting
any of these accidentally causes no damage. Ground is often available for free as the chassis.
If you use pull-downs you have to send Vcc out to the switches, and if a problem causes a short you've
shorted out your power supply and crashed the system.
Pull-ups are also compatible with external sensors that use (NPN) open-collector outputs.