Go Down

Topic: both USB and 5v external power (Read 1 time) previous topic - next topic

mwhens

I have build a flashlight with a Arduino duemilanove.
Something I'am not sure of is how to use the USB and the switching 5v voltage regulator connected to 5v pin on Arduino.
If I not plug in the LiPo battery, and plug in the USB, I get a pop-up "power surge, device exeeded max power limit".
Then the USB device is disconnected.
I'am not 100% sure why this happends, maybe because of a 330uF capacitor thats used by the switching 5v voltage regulator?
That may cause a peak load? There is not allot more thats draining 5v.
(leds of the flashlight are not powered by 5v)
I understand when you connect a external power supply to Vin or plug, it automatically uses that, but in my situation I use a 5v regulator on 5v pin.
Is it posible to use the external 5v supply and still be able to use USB, without draining power from the USB?

Thanks for all your help!

Grumpy_Mike

Quote
maybe because of a 330uF capacitor thats used by the switching 5v voltage regulator?

Yes that would do it. You could put a diode in series with the external supply capacitor to prevent this from happening.

mwhens

I'am not expert, but, put one diode on the positive output of the capacitor.
But are those diodes not causing a voltage drop, so I would go from 5v to 4,9v for example?
That would be bad, I also monitor LiPo voltage, so if 5v reference is off...

If I need to plug-in a LiPo, thats fine with me, but is that posible?
A diode is also fine, but only when there is no voltage drop.

Grumpy_Mike

Quote
A diode is also fine, but only when there is no voltage drop.

Ok then you have no solution then.

mwhens

So the main question stays...

I understand when you connect a external power supply to Vin or plug, it automatically uses that, but in my situation I use a 5v regulator on 5v pin.
Is it posible to use the external 5v supply and still be able to use USB, without draining power from the USB?
Can this be dangarous to test?

Grumpy_Mike

Quote
Is it posible to use the external 5v supply and still be able to use USB, without draining power from the USB?

With a stonking great capacitor on the end of your supply the answer is no it is not possible.

Quote
Can this be dangarous to test?

Yes

mwhens

Just to make it clear...

when I use an external 5v power supply on the 5v pin (works that way, tested it, arduino runs fine).
But Than I also plug in the USB cable, thats dangerous to test?
USB alone gives to much of a current to be handled by the USB port, but with a external 5v power supply on the 5v pin, it can't be worst.
I only hope the USB current is not used, the external 5v power supply on the 5v pin should be used.
Will the load be on both power supplies paralel, or detect the arduino it already has power on 5v pin, and don't use USB power?
Or will they both power, but when the external supply is turned on first, and charge the capacitor, the USB can handle it?

retrolefty


Just to make it clear...

when I use an external 5v power supply on the 5v pin (works that way, tested it, arduino runs fine).
But Than I also plug in the USB cable, thats dangerous to test?
USB alone gives to much of a current to be handled by the USB port, but with a external 5v power supply on the 5v pin, it can't be worst.
I only hope the USB current is not used, the external 5v power supply on the 5v pin should be used.
Will the load be on both power supplies paralel, or detect the arduino it already has power on 5v pin, and don't use USB power?
Or will they both power, but when the external supply is turned on first, and charge the capacitor, the USB can handle it?


That is the problem with having both USB power and external +5vdc power wired together, and not a practice recommended by any regulator manufacture. That is undefined operation, and the regulator with the slightly higher voltage will be the one supplying the current. While it does work and many do it, it's still not a good engineering practice to have two regulators hardwired together.

Lefty


sixeyes

To get round this problem I tried two different approaches on my Megas.

On one board I but the +5v track from the USB connector.

For another board I modified the USB lead, cutting the +5v (red) lead.

I am using a PC power supply to power the Arduino Mega and found that if I connected the USB / PSU in the wrong order the PC power supply fan would stall. The two voltages were out by 0.07v but that was enough. I can't remember which order caused the problem. One way worked and the other didn't. After the modifications everything was fine.

mwhens

Is it posible to cut the pin 1 of the USB VCC 5v+ but still be able to use the arduino normally?
pin 2 D-, pin3 D+ and GND are enough for communication?

Grumpy_Mike

Yes if you are supplying 5V externally.

sixeyes

Quote
Is it posible to cut the pin 1 of the USB VCC 5v+ but still be able to use the arduino normally?
pin 2 D-, pin3 D+ and GND are enough for communication?


I believe USB is differential and therefore only D- & D+ are required for communication. I may have removed both =5v and GND from my cable but without taking my cable apart I can't tell.

Iain

Grumpy_Mike

It might be differential but without a ground it has no reference so it will not work.
Just disconnect the 5V and leave the ground connected.

mwhens

Than thats a posible solution.
I made an extension cable for the arduino anyway, so easy to disconnect the 5v+.
The LiPo battery needs to be on for uploading, but at least I don't have to open the flashlight to disconnect the voltage regulator every time.

In the future I want to build a house automation system. I have one 5v power supply 20A.
I want to wire that to all arduino's, sensors, and control leds.
It would be strange if I could not use USB to monitor or upload.
So I just have to cut all usb 5v+ wires.

Grumpy_Mike

Yes ether in the cable or on the arduino board.

Go Up