Go Down

Topic: Current capability of Arduino Mega2560 (Read 776 times) previous topic - next topic

Nantonos

I was adding up the total current requirement for my current project and realised that
a) it may be close to the maximum for the board
b) I don't have enough info to determine how much margin I have.

What I know:

  • Each pin can provide or receive a maximum of 40 mA

  • a fuse ensures no more than 500 mA is applied to the USB port

  • my SPI flow sensor draws 20mA

  • 10 10k pots draw 0.5mA each = 7mA

  • 14 bicolor LEDS with worst case 19 elements illuminated @ 20mA = 380mA


What I don't know:

  • the base current draw of the ATmega2560, ATmega16U2, and other circuitry

  • how low a current I can give each LED element



I'm experimenting to determine the latter, but don't see documentation of the former and am not sure how to measure it.

I can save 100mA by using 330R resistors on the LEDs which takes them down to 15mA per element = 288mA total, worst case. That is still over half of the total 500mA budget though.

retrolefty

#1
Oct 10, 2012, 01:54 am Last Edit: Oct 10, 2012, 01:59 am by retrolefty Reason: 1

    I was adding up the total current requirement for my current project and realised that
    a) it may be close to the maximum for the board
    b) I don't have enough info to determine how much margin I have.

    What I know:

    • Each pin can provide or receive a maximum of 40 mA


    As an input pin it draws almost zero current. As a output pin you should limit it to 20-30ma maximum, not the 40ma absolute max before damage value.

    • a fuse ensures no more than 500 mA is applied to the USB port


    That is a USB standards spec to protect the PC USB power source, so max current draw when being powered from USB is 500 ma for the board and any components or modules or shields attached.

    • my SPI flow sensor draws 20mA

    • 10 10k pots draw 0.5mA each = 7mA

    • 14 bicolor LEDS with worst case 19 elements illuminated @ 20mA = 380mA

      There is a total 200ma current limit for all output pins (plus chip overhead) combined continuous current, so this is a "problem load" unless you use external switching transistors for the leds.



    What I don't know:

    • the base current draw of the ATmega2560, ATmega16U2, and other circuitry


    Oh around 80MA or somewhat less is the board base load with no external components attached.

    • how low a current I can give each LED element


    Quite a bit less current can still give usable brightness (even 1 ma on most modern LED will display some noticeable dim light), but you would have to experiment to see what minimum brightness still fills your need and measure the current at that brightness. A pot and a +5vdc source and a digital multimeter is all you need to figure that out. Anyone playing with arduino projects really must get a digital meter and learn how to use it properly.

    [/list]

    I'm experimenting to determine the latter, but don't see documentation of the former and am not sure how to measure it.

    I can save 100mA by using 330R resistors on the LEDs which takes them down to 15mA per element = 288mA total, worst case. That is still over half of the total 500mA budget though.

    Again there is a total 200ma current limit for all output pins used combined. There is also a maximum current limit for any 8 digital output pins belonging to the same output PORT, but I forget the value, it's in the atmel AVR datasheet for the chip.

    Lefty


    Nantonos

    Thanks for the swift reply!


    Quite a bit less current can still give usable brightness (even 1 ma on most modern LED will display some noticeable dim light), but you would have to experiment to see what minimum brightness still fills your need and measure the current at that brightness. A pot and a +5vdc source and a digital multimeter is all you need to figure that out. Anyone playing with arduino projects really must get a digital meter and learn how to use it properly.




    I'm experimenting to determine the latter, but don't see documentation of the former and am not sure how to measure it.


    So it turns out, after some experimentation, that the red side of the LED is good down to 1.5mA and the green side, down to 1mA. That gives me a worst case of 14*1.5 + 5*1 = 26mA.

    CrossRoads

    Quote
    There is a total 200ma current limit for all output pins (plus chip overhead) combined continuous current, so this is a "problem load" unless you use external switching transistors for the leds.

    That is not correct. The '2560 can accomodate 800mA; 200mA/Vcc pin.

    See Notes 3 & 4 under the table in Section 30 of the datasheet for how the current must be spread out:

    3. Although each I/O port can sink more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state
    conditions (non-transient), the following must be observed:

    ATmega640/1280/2560:
    1.)The sum of all IOL, for ports J0-J7, A0-A7, G2 should not exceed 200 mA.
    2.)The sum of all IOL, for ports C0-C7, G0-G1, D0-D7, L0-L7 should not exceed 200 mA.
    3.)The sum of all IOL, for ports G3-G4, B0-B7, H0-B7 should not exceed 200 mA.
    4.)The sum of all IOL, for ports E0-E7, G5 should not exceed 100 mA.
    5.)The sum of all IOL, for ports F0-F7, K0-K7 should not exceed 100 mA.
    If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater
    than the listed test condition.

    4. Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady
    state conditions (non-transient), the following must be observed:

    ATmega640/1280/2560:
    1)The sum of all IOH, for ports J0-J7, G2, A0-A7 should not exceed 200 mA.
    2)The sum of all IOH, for ports C0-C7, G0-G1, D0-D7, L0-L7 should not exceed 200 mA.
    3)The sum of all IOH, for ports G3-G4, B0-B7, H0-H7 should not exceed 200 mA.
    4)The sum of all IOH, for ports E0-E7, G5 should not exceed 100 mA.
    5)The sum of all IOH, for ports F0-F7, K0-K7 should not exceed 100 mA.

    If IOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current
    greater than the listed test condition.
    Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

    Go Up