Why a resistor is need to put between the button switch and a arduino input.
In some basic button tutorial i do the following as the book indicates an ilustrates, basically connect the 5V power to one pin of the button, and then the other pin of the button goes to one side of the resistor and then the other side of the resistor goes to the arduino input, why ? why i need to put a resistor before electricity flows to ground to arduino input ?
How to calculate which measure to apply, i mean what kind of resistance i need to put ?
Will be the same for other buttons ?
Why a resistor from component's ground to arduino input
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 74
- Joined: Thu Feb 20, 2014 5:36 pm
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Why a resistor from component's ground to arduino input
Which tutorial are you following? Generally you need a pullup or pulldown resistor when connecting a button or switch. The easiest way to do this is using the internal pullup resistors in the Arduino. See lesson 6 for details. http://learn.adafruit.com/adafruit-ardu ... s/overview
-
- Posts: 74
- Joined: Thu Feb 20, 2014 5:36 pm
Re: Why a resistor from component's ground to arduino input
Im following the instructions that comes with the book in Arduino Starter Kit.
5V to button, button to resistor, resitor to ground to arduino input
Question is, why a resistor between the button and arduino ?
What will happen if i do not put any resistor between button and arduino input ?
Once i read your lesson 6 another question is: why button gets no power from arduino 5V ? does it get power from somewhere ? from where ? if not, how the electricity flow ?
5V to button, button to resistor, resitor to ground to arduino input
Question is, why a resistor between the button and arduino ?
What will happen if i do not put any resistor between button and arduino input ?
Once i read your lesson 6 another question is: why button gets no power from arduino 5V ? does it get power from somewhere ? from where ? if not, how the electricity flow ?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Why a resistor from component's ground to arduino input
Are you referring to CIRC-07 from the ARDX starter kit?Im following the instructions that comes with the book in Arduino Starter Kit.
In the schematic from CIRC-07, the button connects to 5v via the resistor and the Arduino input is connected directly to the button.5V to button, button to resistor, resitor to ground to arduino input
Question is, why a resistor between the button and arduino ?
What will happen if i do not put any resistor between button and arduino input ?
The button does not require any power to operate. The internal pullup resistor pulls the Arduino input to 5v when the switch is open. When closed, the switch pulls it back to ground.Once i read your lesson 6 another question is: why button gets no power from arduino 5V ? does it get power from somewhere ? from where ? if not, how the electricity flow ?
-
- Posts: 74
- Joined: Thu Feb 20, 2014 5:36 pm
Re: Why a resistor from component's ground to arduino input
Let me check the book tomorrow as i dont have it hereIn the schematic from CIRC-07, the button connects to 5v via the resistor and the Arduino input is connected directly to the button.
Image
Other thing is, why a 10K ohm ? i mean, why 10k and not 5k or 1k, how to calculate ?
-
- Posts: 74
- Joined: Thu Feb 20, 2014 5:36 pm
Re: Why a resistor from component's ground to arduino input
oops i see two resistor on your schematics, what about the 560ohm resistor, is used to avoid damage the led ?
and again, why 560ohm and not, lets say 1k ohm or 100ohm ?
and again, why 560ohm and not, lets say 1k ohm or 100ohm ?
-
- Posts: 74
- Joined: Thu Feb 20, 2014 5:36 pm
Re: Why a resistor from component's ground to arduino input
Sorry, i dont understand, if the button does not require power, why give it 5v ?The button does not require any power to operate.
I dont understand, the internal pullup resistor, whats that ?The internal pullup resistor pulls the Arduino input to 5v when the switch is open. When closed, the switch pulls it back to ground.
Give 5v to the arduino input when circuit open ?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Why a resistor from component's ground to arduino input
See this tutorial: http://learn.adafruit.com/all-about-ledswhat about the 560ohm resistor, is used to avoid damage the led ?
and again, why 560ohm and not, lets say 1k ohm or 100ohm ?
We don't. We connect it from the Arduino input to ground.Sorry, i dont understand, if the button does not require power, why give it 5v ?
That is a resistor internal to the Atmega processor. We can enable it in a program using the PinMode function: http://arduino.cc/en/Reference/pinMode#.UyYo8vldV8EI dont understand, the internal pullup resistor, whats that ?
Please be positive and constructive with your questions and comments.