calculate amps

I would like to measure the current I have left going through the 5 volt rail of my Ardunio.

By 'current I have left' do you mean the current available to other circuits? That will depend on if you are powering the Arduino vis USB (500 mA total) or off the power jack (7-12V, current limit depends on the regulator), or off the 5V pin (5V regulated input, current limit depends on power supply and how you tap into it).

The ATmega chip only uses 10 to 15 mA so the entire Arduino probably uses well under 100 mA.

With a USB supply this will leave 400 mA or more for your peripherals.

I'm guessing the onboard 5V regulator can handle roughly 1 A so if you provide power via the barrel connector or the Vin pin you might be able to use 900 mA from the 5V pin.

if you connect a regulated 5V supply to the 5V pin you might be able to draw as much as 10A from the 5V pin but you would be better off running a separate wire if you need that much current.

is there any way to measure it with a analog pin?

arduinopi:
is there any way to measure it with a analog pin?

No.

Why is it you want to measure the current you "have left"?

arduinopi:
I would like to measure the current I have left going through the 5 volt rail of my Ardunio.

That is not a directly measurable quantity. You could maybe measure current being consumed and then estimate how much excess capacity if left. If powering from USB there is a 500ma max enforced with a 500ma thermofuse on the board. If being powered from the external DC connector then max current avalible is perhaps somewhat more depending on Vin voltage being used as the on board regulator's heat dissipation is a limiting factor.

It's nigh on impossible to do anyway.

You could use some kind of device, like an AD8210, to amplify the current across a shunt, but then you have a problem I just had to solve -- Vcc is going to be wrong, because there's some amount of voltage drop across the shunt, so GND is more positive than what's coming from the supply, and even if Vcc is +5 relative to the supply ground, the "new" ground reference is more positive, too.

Then there's the matter of precision -- even with the 20x multiplier of an AD8210, to get full range, you'd need full scale across the shunt to be 5.0 volts / 20 = 250mv. Since the ATmega chips have a maximum current of something like 200ma, you now have R = V / I, R = 0.250 volts / 0.200 amps, R = 1.25 ohms. So, at 200ma, Vdrop is V = I * R, V = 0.200 * 1.25 = 0.250 volts (checks previous work), and now Vcc is 4.75 volts because "ground" is 0.250 volts more positive than what's coming from the supply rail.

Oh, sure, you could put the shunt in the line to your voltage regulator, but good luck doing that if you're powering the part from a 5 volt USB port ...

(BTW -- my solution to reading Vcc using an analog pin was the include a 4V7 zener diode with an 80R6 resistor in series -- I had the 80R6's on hand -- I'd suggest something smaller. I then used a meter to find the actual value of the 4V7 zener diode (4.62 volts ...) and stored that value in RAM. When I want an analog value, I read A0 (which is measuring the zener voltage ...) and used that to scale ANOTHER pin. When I tie A1 to Vcc, the scaling produces Vcc. Not that I had to use another pin -- A0 was "reported" natively as 4.66 volts (953 as the result from analogRead()) when it should have been reported as ~945. Scaling 5.0 by 945 / 953 returns the actual value of Vcc -- 945 / 953 * 5.0 = 4.958.)