Go Down

Topic: disable USB VCC on Mega (Read 850 times) previous topic - next topic

marcdavidson

I have an Arduino Mega2560 in an enclosure with a couple of other atmega chips. These and the peripherals are all powered by the same 5v source using a separate DC barrel connector. Since I'm not using the mega's DC barrel connector, I need to make sure that when I connect the usb cable it isn't also supplying current. Is there an easy way to disable the usb's Vin?
Thanks

CrossRoads

Sure - make sure Vin <6.6V, the autopower switch will disable Vin.
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.

marcdavidson

Thanks.
I should have been more clear. The external power source is a regulated 5v.
Are you saying that if I connect this regulated 5v to the Mega's vin, the USB's vin will be disabled? That would be nice; however, I had thought that use of the Mega's vin in this manner required a minimum of 7v because of the board's internal 5v regulator's vin requirements. Am I missing something here?

marcdavidson

After doing a little more research I think you meant >6.6v. This would make more sense since, as I understand it, there's circuitry that compares the two VINs (USB and external) and disables the USB VCC if the external voltage (either barrel connector or VIN) exceeds a minimum threshhold (which should be >7v for the regulator to output correctly).
If so I'll need to supply the VIN pin with the unregulated 9-12 volts that is also available inside the case.
Am I correct?

retrolefty



CrossRoads

You asked " Is there an easy way to disable the usb's Vin?"
The way to the that is to have Vin < 6.6V so that when Vin/2 is compared to 3.3V, the 3.3V controls the switch to let the USB 5V be switched onto the 5V bus.
If Vin is >6.6V, the external 5V regulator will make 5V and it will go onto the 5v bus.

If you put external 5V on the Vin pin, the usb 5v will be switch in.
If you put external 5V on the 5v pin, the usb5v will be switched in.
If you want USB 5v Not switched on, Vin must be >6.6V.
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.

marcdavidson

Maybe "disable" is not what I meant.
What I want to do is make sure that the USB doesn't power the board. The board will be powered by an external source via the board's Vin (not the barrel connector). I want to be sure that there is no conflict between the two power sources, usb and external, that could damage the board or my computer.
Do you agree that applying >7v to the board's Vin is safe regardless of whether or not the USB is plugged in?

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