Arduino mega 2560 R3 - 5V pin clarification

Hi there! I'm fairly new to using arduinos and my first ever arduino is the mega 2560 R3. I've been reading information about this board and currently focusing on this piece of information:

"5V. This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it. "

The details above indicates that the 5V pin is an output pin, and is basically a regulated 5V supply rail. Now, if the information is specifically indicating that the pin OUTPUTS regulated 5V, then may I ask why the information follows up by saying that using the 5V pin as a SUPPLY (5V voltage source) 'bypasses' the regulator. Seems kind of contradictory - as the first instance speaks of regulated supply, then the next instance speaks of 'bypassing' a regulator, and advising not to use the 5V pin as a voltage supply. I was just wondering whether or not there's some mixed up information in those details. Thanks for your help in advance.

I'd say it this way:

"Supplying voltage [to the Arduino] via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it."

Personally, I don't see a problem powering the Arduino with a 5V supply as long as it's regulated. It's no different than powering it via USB (5V bypassing the on-board regulator).

5V pin is connected behind the onboard regulator. You can use it to power the Arduino as well as to use it as output to power other devices. If the board is powered via Vin, USB or jack, the 5V pin can be used as output to power other devices. If it is used to power the board with an external regulated power supply, the board shouldn't be powered simultaneously via barrel jack or vin or USB.

aha! Thanks DVD and bud! Thanks for explaining the finer details behind that 5V pin. I get it now. So, if the arduino is not powered by any power source (eg. the supply VIN pin remains unconnected and the USB port remains unconnected), then the 5V pin can be used as a power INPUT, where connecting an external regulated 5V supply will allow the arduino to be powered up.

And, if the arduino is powered by supplying regulated 5V to the 5V pin (with VIN pin remaining disconnected), then the additional connection of the arduino USB port to a powered USB port will kind of be like hooking up a USB 'Y-adapter' - where the arduino would be connected to two regulated 5V supplies.

DVDdoug:
Personally, I don't see a problem powering the Arduino with a 5V supply as long as it's regulated. It's no different than powering it via USB (5V bypassing the on-board regulator).

It is a little different. For one thing, with USB you're likely to be using a USB cable which makes it harder to reverse 5V and GND. But even if you did, there is a fuse on the USB input that provides some protection.

So you have to be a little more careful.

Nice info. Also, another small question here only.

If the arduino is already powered up by means of an external voltage supply connected to the VIN pin, then is it ok to hook up the arduino to a computer via USB connection?

Yes, there is a circuit which is switching between USB and Vin (barrel jack or barrel jack). It means that you can have connected both at the same time but only one will acts - Vin. See the schematics. Vin is connected to the comparator which is switching between power from the USB and the on-board regulator. If Vin disappears it is switched to the power from USB without interruption.

Vin isn't the barrel jack. It's downstream, past a protection diode. Typically Vin is ~0.7V less than the barrel jack voltage. The protection diode is there to help you out in case you reverse power and ground.

In one of my Arduino boards I removed the protection diode and the 5V regulator and routed the lines from the barrel jack to a Pololu 5V/500mA switching regulator, which I glued into place where the linear regulator had been. The output from the Pololu then went straight to the +5V. I did it because the switching regulator significantly increased battery life over the stock linear regulator / diode combination (60 hours vs 40 hours).

When I hooked all this up I checked and rechecked and then checked again. I once tripped the polyfuse on my Arduino and it saved me. But if I hooked up the regulator backwards there would have been no safety net.

Here's a closeup of the Pololu:

http://forum.arduino.cc/index.php?topic=317000.msg2195940#msg2195940

Thanks bud and jb. That clears things up a lot here. I went to take a look at the schematic of the 2560 and see what was discussed above.

I can see barrel jack, and according to the arduino 2560 document, it is best to supply this jack (if using it) between 7V and 12V. Or if not using the barrel jack (and not using USB power), then we could hook up an external voltage to the VIN pin - maybe in the range between 7V to 12V.

When the VIN pin is used to power the arduino, it can be seen that the VIN pin leads to a voltage divider (as mentioned earlier by bud). This particular voltage divider appears to be set up to halve the incoming VIN voltage. The halved voltage is compared with a 3.3V value. With this comparator scheme, it looks like the output of the comparator drives a p-channel FET. So if the VIN pin has an applied voltage on it, then the comparator is meant to output a high voltage, which stops the FET from routing any USB voltage over to the +5V pin. If nothing is connected to the VIN pin, then the VIN pin voltage stays at 0V, which results in the comparator outputting 0V, so the 0V gate voltage at the FET helps to route any USB voltage to the 5V pin.

I'm thinking that if the comparator has a 3.3 V reference, then better to have VIN applied voltages ranging from 8V to 12V, instead of 7V to 12V, only due to that voltage halving voltage divider, right?

Vin just needs to be greater than 6.6V. 6.6/2 = 3.3.
Add 0.7V for the diode, and >=7.3 would be needed.
7.5V is a standard wallwart output.

jboyton:
Vin isn't the barrel jack. It's downstream, past a protection diode. Typically Vin is ~0.7V less than the barrel jack voltage. The protection diode is there to help you out in case you reverse power and ground.

Yes, of course. Thank you sir.
Modified.

@Southpark
There is one problem with this power source on UNO/Mega wich was discussed here on forum already. If the higher voltage is used, the regulator gets pretty hot very quickly under higher load. Let say 12V and current 400mA. Heat dissipation from 5V regulator is insufficient and high temperature may damage it. It is better to use lower voltage (e.g. 9V) for long term operation.

CrossRoads:
Vin just needs to be greater than 6.6V. 6.6/2 = 3.3.
Add 0.7V for the diode, and >=7.3 would be needed.
7.5V is a standard wallwart output.

Thanks CR. I was just checking the schematic, and can see that VIN a pin that is after the diode. Looks like no extra 0.7V is needed. But definitely no problem with adding the extra 0.7V. The 7.5V sounds good to me.

Budvar10:
Yes, of course. Thank you sir.
Modified.

@southpark1
There is one problem with this power source on UNO/Mega wich was discussed here on forum already. If the higher voltage is used, the regulator gets pretty hot very quickly under higher load.

Extremely appreciated here bud. This is going to be very helpful, and important to know. I didn't know that, so definitely going to write this down in my notes here. Thanks for that. I'll be paying attention and limit the regulator's input voltage to say 7.5V to 9V.

jboyton:
In one of my Arduino boards I removed the protection diode and the 5V regulator and routed the lines from the barrel jack to a Pololu 5V/500mA switching regulator, which I glued into place where the linear regulator had been.

I would be interested in that jb. So you bypassed the onboard regulator with a more efficient regulator in order to get the big battery time improvement. Thanks for sharing that idea. Very good improvement as well.