0

I have conflicting information on the max output rating for the Arduino Mega. Some say 200 mA and others say 800 mA like the Uno board. I am running 8 model railroad signal devices that have (3) 3mm LEDs (Red, Yellow, and Green) in each signal. Of the 24 LEDs, only 8 are energized at any point in time. 8*.020 = 160 mA. I believe I am good, but confused as to why the Uno board with 13 digital output pins can handle 800 mA and the Mega board with 40 or so output pins (not including all the TX RX IO pins) can only handle 200 mA. Lots of forum discussion on this, but most go over my head without answering the question! LOL

Simply, how many mA can all of the digital pins combined provide?


Well theory (math) is nice, and a good starting point, but reality is better.

The signals I am talking about are (model) railroad trackside warning signal devices that have a red, yellow and green light, and depending on which light is lit, tells the train's Engineer if it is safe to continue down the track.

Signal

Each of these signals are 2.1/2" in height and the LEDs use 30 gauge wires and a 1K resistor.

I connected the red LED on all 8 signal devices to my variable power supply, turned it on and lit all 8 red LEDs with 5 volts, and wow, all 8 only used .023 amps total.

I then disconnected 7 of them and a single red LED only used .002 - .003 amps. I connected the rest of the signals one at a time, and 2 signals used .006 amps, 3 signals used .009 amps, 4 signals used .011 amps, 5 signals used .014 amps, 6 signals used .017 amps, 7 signals used .020 amps and all 8 signals again only used .023 amps.

If this is the case, that is less than the max output from a single pin.

So, my plan is to connect the signals to the Arduino Mega 2560 on at a time, monitor the total current the Arduino in using after connecting each signal, and see just how much these signals are using.

6
  • Where does it say the Uno can handle 800 mA? Link please.
    – Nick Gammon
    Commented Jul 15, 2023 at 4:28
  • Are you using resistors between the output pins and the LEDs? If not, you should be. By choosing an appropriate value resistor you can limit the current to any figure. There is an LED calculator web site to help you do that.
    – Nick Gammon
    Commented Jul 15, 2023 at 20:23
  • Sticking to your original point, please explain where you read about the Uno and 800 mA. If you want to make additional explanations please edit the question - don't make an answer.
    – Nick Gammon
    Commented Jul 15, 2023 at 20:24
  • It's possible your signals come with inbuilt resistors - looking at the datasheet for them may help.
    – Nick Gammon
    Commented Jul 15, 2023 at 20:34
  • 1
    Ah, I see you mentioned a 1k resistor. That's why they don't draw a lot of current. Based on Ohm's law, if you have a 5V supply, and a 1.8V voltage drop (approximately normal for a red LED) and a 1K resistor, then you expect to draw (5 - 1.8)/1000 amps, which is 3.2 mA.
    – Nick Gammon
    Commented Jul 16, 2023 at 5:03

1 Answer 1

1

The answers are right there in the datasheet.

The datasheet of the ATMega2560 (and 1280 etc.), page 355, states an absolute maximum current of 200 mA for the ATMega package and 40 mA per I/O pin.

In addition (thank you for the comment, @NickGammon), there are some further restrictions that are described from page 356 of the linked datasheet:

  • The sum of current which can be sunk from various ports cannot exceed 100 mA, and from others, 200 mA.
  • The same is true for the amount of current that can be sourced from various ports.

For example, for ports A0-A7 you cannot source a total of more than 100 mA (under steady conditions) and not 40 mA * 8 like you might expect.

So, if you had 8 LEDs on at once, continuously, you would only have 12.5 mA available for each of those ports (for a total of 8 x 12.5 mA = 100 mA).

That means that the 160 mA mentioned in the question could easily be out of spec.

It's not recommended to stay at or near the Absolute Maximum values mentioned in the datasheet for an extended amount of time. It's better to design your solution so that these abolute maximum values are never approached.

For your particular situation I would look into external (TTL) buffers between your Mega and your LEDs.

Alternatively, you could reduce the amount of current through the LEDs to make sure the total amount of current will always stay well below 200 mA or the other limitations mentioned above.

2
  • You might want to mention further restrictions, from page 356 of the linked datasheet. The sum of current which can be sunk from various ports cannot exceed 100 mA, and from others, 200 mA. Ditto for the amount of current that can be sourced from various ports. So for example, for ports A0-A7 you cannot source a total of more than 100 mA (under steady conditions) not 40 mA * 8. So if you had 8 LEDs on at once, continuously, you are down to 12.5 mA each, for those ports. So, the 160 mA mentioned in the question could easily be out of spec.
    – Nick Gammon
    Commented Jul 15, 2023 at 4:48
  • Thank you, @NickGammon, I've added that information to the answer.
    – StarCat
    Commented Jul 22, 2023 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.