batata004:
But just a final question: you said that when I power my arduino using USB it provides 5v in th VIN pin? Shouldnt it be a little less cause there are some circuitry between the 5v pin and the VIN pin which should decrease the 5v correct?
Yes, that's the regulator that I mentioned, which drops the Vin voltage to 5V. When conducting backwards, the voltage will drop slightly due to the internal diode, but only by about 0.6V.
And also, if when I power my arduino using USB the vin has only 5v, my LED should not power up right? But it did!
It won't be as bright. Look at it this way. If the 12V power supply is disconnected, and the board is connected to USB, the only possible source of power is 5V - the USB voltage.
The LED will not draw as much current as it did from the 12V supply, but it will still draw too much continuous current for that diode.
The only possible current path from 5V to Vin is through the regulator, so this must be what's happening.
Make sense?
Here's the schematic for a Nano. Note the regulator near the bottom, and the Vin and 5V tags. That must be the current path, if the LED lit while only 5V was applied via the USB port. Nothing but the regulator connects to Vin.:-
(Right-click and "View Image" or similar for a full-sized view.)
