i know that the arduino uno board can bear to 20 mA..... my question is this limit is in the GND only or at any pins? ..... if it at any pins can anyone tell me how much (A) pass through the pin 2 wire to the board ?......and why this resistance?....to protect the GND only? if they are cosidered two resistances which are connected in parrallel
moh50000:
i know that the arduino uno board can bear to 20 mA....
I/O pins are limited to 40mA before they are damaged. 20mA is the suggested limit to prevent any damage.
The VCC and GND pins of the ATmega328 chip are limited to 200mA total. So in other words, even though each I/O could handle 20mA, you could only run that through 9 pins at a time. (Need to leave some current for the rest of the chip.)
Since that isn't a proper schematic and you didn't identify what the whiteish component is, can't really answer anything about the "circuit."
moh50000:
....two resistances which are connected in parrallel
No, they are connected in series.
Between 5volt and ground.
One is a fixed 10k resistor, the other part is some sort of sensor or button.
The "tap" is connected to a digital pin.
Could/should be configurated as input, to switch someting at a certain voltage level.
Leo..
Your circuit can be simplified.
Remove the 10K resistor.
Place the switch between pin 2 and GND.
void setup()
{
pinMode(2,INPUT_PULLUP); // turn on the internal PULLUP resistor
. . .
}
Now when you read the condition on pin 2, a HIGH means the switch is not pushed, a LOW means the switch is pushed.
.
I will understand all this circuit if i know that which way the current pass after passing the button ?.....to the GND only or it will split to GND and pin 2 and that's why i considered them two resistors which are connected in parallel ....... and if it pass through these ways then they should have the same voltage but one of them with high resistance and the other is not and the the way with pin 2 is without any resistors that should make high current on it ..... why not ?
Your wording is hard to understand.
When the switch is not pressed, the input to the input gate is pulled to +5V by the PULLUP resistor (HIGH).
When you push the switch, you place 0V on the input gate (LOW), current will flow from +5V through the PULLUP through the closed switch to GND (0V), however, the input of the gate is still at GND.
all i meant is that....... after the current pass the button which way the current take ? why ?.....and the pin 2 is cosidered as GND (cuz it's input) ?
In the drawing in reply #3
current path is:
+5V --- PULLUP --- (pin 2) through the closed switch --- GND
So the pin 2 isn't like GND when it's an input ?..... it just rescive a signal ?...... so how much voltage and Amp it receive ?
So the pin 2 isn't like GND when it's an input ?..... it just rescive a signal ?
That is correct.
so how much voltage and Amp it rescive ?
Exactly nothing.
Pin 2 in this example is a digital input.
As an input, the resistance of is extremely large.
For all practical purposes, an input requires no current.
You can download the data sheet for the controller and look at the Electrical Characteristics section to see the pin requirements. Atmega328
The signal the pin 2 receive isn't 5v current while pushing the button ?
In my drawing, when you push the button, the voltage at pin 2 is zero volts.
There is current going out of pin 2 through the switch when the button is pushed.
The current will be about 200 micro amps.
Since the switch has zero resistance there is no voltage developed across it.
V=I * R
V = .0002 * 0
V = 0
Therefore the voltage you would measure on pin 2 is zero (as long as you are pushing the button)
When you are not pushing the button, the voltage at pin 2 is five volts.
It gets the voltage internally trough the PULLUP resistor.
.
moh50000:
The signal the pin 2 receive isn't 5v current while pushing the button ?
In the drawing you posted, negligible current flows to pin 2, because it is an input.
When the button is pressed, the +5v is connected to one end of the resistor, so the current flowing from +5v to ground would be given by ohm's law and the value of the resistor.
The voltage on the pin will be 0v (ground) when button is not pressed, 5v when it is pressed.
The purpose of the resistor is as a "pull-down", to make sure that the pin is at 0v when the button is not pressed. Without it, the pin would be at 5v when the button is pressed - but when it wasn't pressed, the wire would be connected to nothing - it's said to be "floating"; in this situation, reading the pin will produce seemingly random readings. By using a pulldown resistor, usually a fairly high value, like 4.7k-100k, you ensure that, when nothing else is connected to the pin, it's at 0v.
However - you can make this simpler, as others have suggested - the chip itself has built-in pull-up resistors (same as a pull-down, only it pulls up to supply voltage) which can be enabled by setting pinMode(pin,INPUT_PULLUP). In this case, you'd connect the switch between Ground and pin 2. When button was not pressed, button would be at 5v and no current flowing, and with button pressed, it would be at 0v - but in this case, there would be a small current passing through that pin when the button is pressed - through the internal pullup resistor and out pin 2 through the button to ground. The pullup resistors have a value of ~25k iirc, giving us 0.2mA.
The current through the pull up resistor when the pin is connected to ground is not strictly coming from "the pin" and does not count towards pin limits in any way which only matters when a pin is an output.
Okay....if i delete the 5v wire and that button ..... there is current will pass through the pin 2 to GND or not (cuz it's an input) ?
How many times do you need to be told?
Connect an input pin to ground with no pull up equals no current.
Why are you worrying?
So no current come from or go to the input pin...please tell me is that right or not?....and yeah i am really worried cuz i couldn't understand it completely
That is correct, no current. There is nothing to worry about connecting inputs to any voltage between the power supply limits.
Have a read of this
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html