I currently have a project which drawn too many to be supplied by the arduino itself ( about 0.8A ). I already made the PCB and can not change it, but I wanted to know if this solution could work to shutdown the arduino when USB is disconnected. The external power supply deliver 9V and I have a supply board which deliver 5V.
The main idea here is not to wire the +5V from the USB and using the internal power supply to power the arduino USB. Is this possible ? Would my arduino risks something ? I already read this topic but I cannot use it right now ?
NB : see the attached picture for a fritzing principle schematics
The Arduino has an on-board polyfuse that limits current through the USB port to about 500mA. So you would need to connect your regulated 5V supply directly to the 5V pin on the Arduino (after making sure the USB's 5V was disconnected.)
I'm not sure of what you suggesting : connect only the d+ and d- of the usb port, and power the +5v pin of the arduino (which I don't use as I have a power supply) to my power supply output ?
The main issue with this idea (and mine too) is that I thought the usb port use some kind of ohmmeter to detect connected devices. Is that true ?? If so, do I need to connect a resistor between +5v and gnd of the main usb port ?
LTourist:
I'm not sure of what you suggesting : connect only the d+ and d- of the usb port, and power the +5v pin of the arduino (which I don't use as I have a power supply) to my power supply output ?
This connection method is quite common.
LTourist:
The main issue with this idea (and mine too) is that I thought the usb port use some kind of ohmmeter to detect connected devices
Well, you are partially correct. Device detection is handled without the 5V line. Ground must still be connected.
The check for pull-up resistors is not part of the spec. It is used my power adapters to determine how much current the attached device can draw since power adapters don't enumerate the device. (PCs ask devices during enumeration how much power they need.)
I don't understand what is relevant on that link to your question.
You don't want power to go through the USB port because the on board fuse will limit you to 500mA. You have to power via Vin (with 7.5 or more) or directly to the 5V pin.
That is relevant because of the primary goal of this guy :
The main purpose is I would like the board to be off if my power supply is off event if the usb cable is connected with a computer
I want the same because :
1/ Not drawn to much current from the pc (but as you said, I don't have to bother with this because of the fuse)
2/ This is a non sense for my project to be powered by usb, and so, I also want the board to switch off when only usb is connected.
But the solution you gave me seems to fullfill both of these requests.