Pages: [1]   Go Down
Author Topic: How to calculate current (sink/source) into pins - (model?)  (Read 681 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've read that the pins, specifically the duemilanove, have a current limit (sink/source) of 40mA. How can you calculate this current. What is the model for each pin?
 
http://arduino.cc/en/Main/arduinoBoardDuemilanove
From what I read (see above link - Input and Ouput), the internal circuitry of each pin consists of a pull-down resistor (~20k-50k). Now, below is an illustration of what I imagine this to look like, but then again that is why I am asking this question.
 

 
-------------------
Also, is the 5V pin also characterized by a 40mA limit? I know the 3.3V pin is 50mA, but I could not find similar information regarding the 5V pin.
I have read somewhere that there is also a totalized limit of 200mA altogether but cannot find the source. Is this true?
Logged

Portugal
Offline Offline
Edison Member
*
Karma: 37
Posts: 1545
Pretending you know everything then you will learn nothing.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have read somewhere that there is also a totalized limit of 200mA altogether but cannot find the source. Is this true?
Read this
http://playground.arduino.cc/Main/ArduinoPinCurrentLimitations
Logged

Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B


Offline Offline
Edison Member
*
Karma: 32
Posts: 1288
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When the pin is configured as an input, almost zero current flows in/out of the I/0 pin.  (The input impedance/resistance is around 100 megohms.)

Current is calculated as Voltage/Resistance (Ohms' Law).

In your circuit, any significant current flowing through the pull-down resistor is flowing through the external "Arduino Read" connection, not through the input pin.   A 20K pull-up resistor pulled-up to 5V has 0.25mA (5/20,000 = 0.00025A) flowing from the power supply through the resistor...  The current comes from the power supply, not the input pin.

If you connect a resistor to an output pin, then the current flows out of (or into) the I/0 pin, and you can use Ohm's law to calculate it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When the pin is configured as an input, almost zero current flows in/out of the I/0 pin.  (The input impedance/resistance is around 100 megohms.)

Current is calculated as Voltage/Resistance (Ohms' Law).

In your circuit, any significant current flowing through the pull-down resistor is flowing through the external "Arduino Read" connection, not through the input pin.   A 20K pull-up resistor pulled-up to 5V has 0.25mA (5/20,000 = 0.00025A) flowing from the power supply through the resistor...  The current comes from the power supply, not the input pin.

If you connect a resistor to an output pin, then the current flows out of (or into) the I/0 pin, and you can use Ohm's law to calculate it.


I know how to calculate current in a circuit. The problem of calculating current can become difficult in more complex configurations that a simple one-step linear current-voltage relationship. My question was about the model for the arduino pins. The square box in the OP picture is suppose to represent the header port on the arduino. I read that there existed a 20k-50k internal pull-up resistor (disconnect by default?). My diagram was an attempt to illustrate what I thought it may look like. My question was aimed at answering this question definitively. The "Arduino Read - FTDI USBtoTTL" represents the actual portion of the circuit that reads the voltage directed into the pin.
Logged

Lacey, Washington, USA
Offline Offline
Edison Member
*
Karma: 154
Posts: 2257
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The Pull-Up resistors are off by default. Arduino pins should be limited to a maximum of 40mA source or sink. That is normally only an issue when using a pin as an output.

In addition, the total current through both the Vcc and Ground pins must not exceed 200mA.

There are more limitations, based on which AVR and which pin. The link given above is an excellent resource.

Yes, calculating all this can be very complex.
Logged

Steve Greenfield AE7HD
CET Consumer Electronics and Computer
Please don't read your attitudes into my messages

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When the pin is configured as an input, almost zero current flows in/out of the I/0 pin.  (The input impedance/resistance is around 100 megohms.)

Current is calculated as Voltage/Resistance (Ohms' Law).

In your circuit, any significant current flowing through the pull-down resistor is flowing through the external "Arduino Read" connection, not through the input pin.   A 20K pull-up resistor pulled-up to 5V has 0.25mA (5/20,000 = 0.00025A) flowing from the power supply through the resistor...  The current comes from the power supply, not the input pin.

If you connect a resistor to an output pin, then the current flows out of (or into) the I/0 pin, and you can use Ohm's law to calculate it.


I know how to calculate current in a circuit. The problem of calculating current can become difficult in more complex configurations that a simple one-step linear current-voltage relationship. My question was about the model for the arduino pins. The square box in the OP picture is suppose to represent the header port on the arduino. I read that there existed a 20k-50k internal pull-up resistor (disconnect by default?). My diagram was an attempt to illustrate what I thought it may look like. My question was aimed at answering this question definitively. The "Arduino Read - FTDI USBtoTTL" represents the actual portion of the circuit that reads the voltage directed into the pin.

Your answer would be in the datasheet for the 328P chip in the electrical section named:
http://www.atmel.com/Images/doc8161.pdf
29.4.8 Pin Driver Strength

There are graphs that show the output voltage Vs current flow (at two different Vcc cases 5vdc and 3vdc) for an output pin set low and high respectively. My math skills won't allow me to convert those slops to a math model, but I think you can see the relationship.



Lefty
Logged

Pages: [1]   Go Up
Jump to: