Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
pull up and pull down resistors are just used to make sure that there is a know state on an input pin, instead of being left to float.
Here is an example of a pull up resistor:
you can see that when the button isnt pressed the input pin is pulled high to a know state and if it is puched the input pin goes to 0v. its the same for a pull down resistor. it took me a while to understand lol
sir, thank you for the reply. actually, there is still, another problem. i still don't know how to read or understand circuits. i am really sorry sir, i just want to learn.
lol dont worry ive asked this exact question befor on here, you might wana look for that explanation but yea if the switch is open it will read high and depening on what you programe on micro for e.g. if pin goes low then do this, its best to have a pull up resistor on there to make sure your allways in a state that you know.
So the code for Micro could be if button pressed i.e. go low then do this. the same is for pull down resistors. if you leave a pin floating you get things like induced noise and voltage spikes on it which you could end up reading a wrong state?
Pull up resistors seem to be more common, I think it goes back to the old days of rtl, with most micrcontrollers pull up or down will work.
Dont forget if your writing code to look at an input switch to have some kind of anti repeat, your code will service the switch input repeatedly very quickly if you dont, I usually look for a change on a port by subtracting the last sampled value with the current one.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.