Go Down

Topic: Mega 2560- USB connection while using 5V external power (Read 12888 times) previous topic - next topic

brad81987

How can I safely power the Arduino through the 5V pin and utilize the USB connection?

I've searched but haven't found a totally clear answer on this.

I have a project using a bunch of Sharp IR distance sensors and some ultrasonic range finders with a Mega 2560. Everything worked well initially but once I added all the sensors, I think we were overloading the USB port as the 5V rail was only giving around 4.25-4.5V. I used a benchtop 5V supply to power the sensors (grounds tied of course) and left the Arduino on USB. The IR sensors worked fine, but I found the ultrasonic sensors act up when powered by a separate power supply, returning bogus numbers (im using SRF01's). Disconnecting the USB and powering the Arduino through the 5V pin with the bench supply so everything was being fed by the same power supply, everything worked fine.

Problem is- I need the USB connection for debugging. So my question is again: How to safely power through the 5V pin AND use the USB connection, or is it even possible?
- Can I just cut the 5V line on the USB cable? Will the USB converter power off the 5V pin from the board or is the 5V USB connection its only power source?
- I have a FTDI breakout cable. I assume I could also just use that and not connect the power pin to the board. If I did that, what pins need to go where from the cable to the board?

Thanks.

zaphil

This sounds suspiciously like a ground loop problem. I always power boards using an isolated DC-DC converter. At very little cost this gives you a S/C protected regulated output as well as complete isolation.

Magician

If you measure 4.25 - 4.5 V, it is mean something serious, becaause
usb has a limits 4.75 - 5.25

http://www.datatranslation.com/phpkb/question.php?ID=235

most likely you drain too much current.
If you have a device to measure a voltage, have you ever measure a current?


etchove

I think your connections are like attached scheme from http://arduino.cc/en/uploads/Main/arduino-mega2560-schematic.pdf (Am I right ?).

In this case, I think you are producing short circuit (USBVCC connected to your external 5V power supply).

The solution would be to disconnect USBVCC from T2, but this is intrusive. Is there another solution ? I don't know.

May anyone can confirm ?

retrolefty


I think your connections are like attached scheme from http://arduino.cc/en/uploads/Main/arduino-mega2560-schematic.pdf (Am I right ?).

In this case, I think you are producing short circuit (USBVCC connected to your external 5V power supply).

The solution would be to disconnect USBVCC from T2, but this is intrusive. Is there another solution ? I don't know.

May anyone can confirm ?


Many people power their boards via an external regulated +5vdc voltage source wired directly to the Arduino's +5vdc pin and still connect to the USB for uploading and serial comm. It's not a good engineering practice to do so, but normally people don't have problems doing it as long as total current draw is less then the external supply can provide. I say it's not a good engineering practice as one would normally never recommend wiring two independent voltage sources together without some form of isolation (diode isolation, etc), however if the voltage difference between the two voltage sources is within a few tenths of a volt it doesn't seem to cause people grief even though I wouldn't do it. Keep in mind that there is a 500ma polyfuse to protect the USB voltage source from over current situations, however I have no idea how a PC's power supply would respond to a small reverse current flow in situations where the Arduino's external regulated +5vdc voltage is higher then the USB's voltage value.

It's a topic that comes up a lot around here and there just seems to be two different opinion outcomes. The "don't do it because it's not a good engineering practice" and the "I do it all the time and have never had a problem". So choose your side and jump in.  ;)

sixeyes

I had problems with this. I ended up modifying the USB cable, cutting the power lead, only using the USB for debugging.

rpmccormick

Why on earth didn't they make these with a jumper (or 0-ohm resister) so you can use a normal USB cable and not be afraid you are going to fry something by connecting your PC's +5 to that of your 5V-Wall-Wort external supply?

I was hoping to find that there was built in circuitry to disconnect USB5V if externally powered, but if it is like that, most people on here don't know about it.  ...and if it is not, then you are risking your PC's USB port more then anything else (which is super scary).

rpmccormick

Upon looking at the schematic, I found that:

A) The VUSB input is connected to +5 via a shotkey-diode, so no risk to PC USB port.

B) There is no such protection for the external supply connected to +5, so slight risk there (but diode drop of VUSB should make it less then your 4.9+V external, so probably safe).

C) The main +5 rail is also connected directly to the Regulators output, which is not really built to receive input voltage, so basically if you ever power the board by anything other then Vin, you could damage the Vin-to-+5 regulator (but that's fine by me as I will power via +5 rather then 7-12V anyway).

retrolefty


Why on earth didn't they make these with a jumper (or 0-ohm resister) so you can use a normal USB cable and not be afraid you are going to fry something by connecting your PC's +5 to that of your 5V-Wall-Wort external supply?

  Keep in mind that the Arduino was designed to have two power sources to power the board, either USB or external 7.5 to 12vdc via the external power connector. The shield 5V pin was designed to provide output voltage to power external components up to the current limit the board can provide. The fact that one can 'backfeed' a regulated +5vdc is not something Arduino claims in their product description and in fact as you stated if wasn't designed in the best matter if that had been their intention.

I was hoping to find that there was built in circuitry to disconnect USB5V if externally powered, but if it is like that, most people on here don't know about it.  ...and if it is not, then you are risking your PC's USB port more then anything else (which is super scary).

divatesagar

hi @sixeyes you say you have cut the power of usb cable and were able to connect serially, i am trying the same but its not connecting and yes i am using a external source to power up board while connecting 

sixeyes

It's a long time since I used an Arduino, so I can't remember what I did.

Did you cut both +5v and GND wires in your USB cable?
If so, that's probably the cause. I think I only cut the +5v cable.
Without the GND wire, I'm not sure the USB signals will be recognised, even though they are differential.

After my success with the cable I progressed onto modifying my Arduino's and actually cut the +5v track leading out from the USB connector. Not for the faint hearted but it worked for me on the boards I modified.

Iain


DrProblem

Hi all,
Just seeking clarification.
Vusb is shared with Vin from lm1117/whatever Vreg used?
Vin 5&3.3v pin headers can also power the board?

But these rails aren't effectively isolated from each other?

I suspect it's a newb question, but I haven't exactly been rushing
to read the arduino circuit diagram.

Many thanks,
Andrew

CrossRoads

Vusb is shared with Vin from lm1117/whatever Vreg used?
No - there is a FET on board that lets 5V from the regulator block out Vusb when Vin/2 is > 3.3V.

Vin 5&3.3v pin headers can also power the board?
Yes & No. If powering from 5V header, add a diode 1N4002 type, from 5V (anode) to Vin (cathode) to prevent damaging the regulator.
3.3V cannot power the board - the 2560 needs 5V. The 3.3V regulator is only good for 150mA. Not enough to power an SD card even.

But these rails aren't effectively isolated from each other?

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

DrProblem

Thanks for reply Crossroads.
My questions are a bit rusty. Its been a few, ahem, years since
I dabbled with mcu's. Forgotten a few things.

Many thanks,
Andrew

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up