Arduino Mega Specification Clarification

Hello, I am working on a project in which I use an Arduino Mega to control a robot. I am more experienced as a programmer than an electrical engineer and my team is still a little inexperienced with electrical circuits. Here are a couple questions that I have:

When using a PWM pin, does the current or the voltage decrease as the duty decreases?

Each digital pin fires at 40mA on an Arduino board, considering that the upper limit on draw is 500 mA for the entire board, I have can't fire very may pins before the limit is reached. The Arduino itself is only switching transistors in this project, which have very low current requirements on the base to perform the switch. Is it possible for me to reduce the mA given off by a pin by adding a resistor to the circuit, thereby increasing the number of pins I can use?

Can I use any single ground-pin as a common ground for all of my output pins (both PWM and digital)?

Is there a difference between any of the ground-pins on the board?

How much current does the serial port consume when it is sending and receiving information (it is connected to the USB port which corresponds to pins 0 and 1)? I assume it is at or less than 40 mA, but I would like to know because I am working with a lot of pins.

These are just some basic questions that I have, thank you in advance

When using a PWM pin, does the current or the voltage decrease as the duty decreases?

The average voltage decreases as the duty cycle decreases. If you are trying to generate an analog voltage then a PWM pin is followed by a low-pass filter (typically a simple resistor and capacitor, or "RC filter") to extract just the analog component of the PWM output, which is an oscillation between only two discrete voltages (0V and 5V).

Each digital pin fires at 40mA on an Arduino board, considering that the upper limit on draw is 500 mA for the entire board, I have can't fire very may pins before the limit is reached.

It's actually slightly worse than that. First, 40mA is an absolute maximum for a pin, and that's a rating that should not be encountered in normal usage. Extended operation at absolute maximum limits can destroy the device.

Second, there is a maximum current rating for the microcontroller: 200mA. And again, that's an absolute maximum rating for the entire chip. Stay away from it in normal usage.

Is it possible for me to reduce the mA given off by a pin by adding a resistor to the circuit, thereby increasing the number of pins I can use?

This is a common fundamental misconception in electronics. The microcontroller doesn't "fire off" or force any amount of current to flow. The microcontroller I/O pins provide a voltage (5V nominally). The current that flows as a result of that voltage depends on what you hook up to that I/O pin. If you hook up nothing, i.e., leave it unconnected, then no current flows at all. If you hook up a 125-ohm resistor then the absolute maximum 40mA of current will flow according to Ohm's Law (well...the voltage will dip below 5V in this case but it was just an illustration).

If you are just connecting an I/O pin through a resistor (1k for example) to the base of a transistor, very little current will flow, less than 5mA (5V / 1k).

Can I use any single ground-pin as a common ground for all of my output pins (both PWM and digital)?

Yes.

Is there a difference between any of the ground-pins on the board?

No.

How much current does the serial port consume when it is sending and receiving information (it is connected to the USB port which corresponds to pins 0 and 1)? I assume it is at or less than 40 mA, but I would like to know because I am working with a lot of pins.

I think you are probably asking about how much the serial I/O pins consume. The answer is "not very much at all", less than 1mA.

-- The Aussie Shield: breakout all 28 pins to quick-connect terminals

This is a common fundamental misconception in electronics. The microcontroller doesn't "fire off" or force any amount of current to flow. The microcontroller I/O pins provide a voltage (5V nominally). The current that flows as a result of that voltage depends on what you hook up to that I/O pin. If you hook up nothing, i.e., leave it unconnected, then no current flows at all. If you hook up a 125-ohm resistor then the absolute maximum 40mA of current will flow according to Ohm's Law (well...the voltage will dip below 5V in this case but it was just an illustration).

If you are just connecting an I/O pin through a resistor (1k for example) to the base of a transistor, very little current will flow, less than 5mA (5V / 1k).

As you can see I am not used to using the terminology correctly. Anyway, I understand the ohms law, and that was my question; would increasing the voltage decrease the amperage in the circuit. I understand that the Arduino is a controller board and it is not designed to handle any large amounts of current.

So basically, any of the I/O pins can supply a range of 0 to under 40 mA of current, and the what remains constant in "most" circumstances is the Voltage (5V for the Arduino Mega board). And that means I can in fact put a resistor on to the circuit connected to the I/O pins and reduce the current on that pin, giving me room for more pins.

Thanks for the help