Duemilanove USB supply issue

hi
I am going to explain my problem:
-VIN is commected to battery pack
-Patery pack is commected to L239 motor driver too
-USB is connected to PC

well, when both Battery supply and USB are connected all works fine and motors take power from battery...

the problem is that when i disconnect battery it seems USB supply propagate back through the internal voltage regaultor and some voltage appear on the VIN pin and so happens that motors became powered by USB power supply :o this is no good!!!

is this a normal behavior ?
i disconnect battery because i have to work on arduino code ad upload it for debug purpose without have motors rotate countinuously and waste battery charge....

So have I to disconnect all electronics connected to VIN every time I shut down battery supply? or use a diode to block reverse current from USB to VIN ..maybe....

p.s.
is it possible to disable USB power supply and make arduino be powered only via VIN pin?

many thanx

From what I have read the Duemilanove automatically detects what power is connected up and switches to that.

Grumpy, this is true, but I think the issue is which supply it prefers when offered both sources. I'm not sure, but I think the Duemilanove will prefer to take the power from the USB if it is present, even if the other supply is better suited for the tasks at hand. This is the opposite of the behavior noise0 wants to have.

Yes the point I was making is that unlike the Diecimila where you have links to choose, with this one you don't have the choice. Looking at the schematic it looks like it will switch over to the Vin if half Vin is greater than Vcc30.

Yes, if both are avalible then the external power is used. This is the most logical choice considering the current limits that USB power imposes. However if external power is from a battery source then this automatic choice is probably not the best logic.

Lefty

well the real problem is this:
i am developing a minirobot, the electronic part is finished and now i have to work on software.

ok imagine my robot on the desktop connected to usb and battery. the body is lifted a bit so weels can rotate freely...

ok programming time:
step 1: i start to write a piece of code to test (for example motor control)
step 2: i upload the code and i see the robot start to do something , motors start to perform some task...

well now it's time ti go back to code and continue to write and test piece of code this way....

What is the problem?
The problem is that every time i return to the code i am used to turn off the robot because is useless keep it in action for 5 minutes while i think to debug the code...

Right?
using other micro like basicX or Picaxe i am used to Switch off the battery and the whole system turn off ....

With this arduino, every time i want to switch off the robot i have to: (in the right sequence)

  1. unplug USB
  2. turn off battery switch

And every time i have turn it on i have to

  1. turn on the battery
  2. plug USB

becsause i can not leave USB connected while battery power is off

:-?

If you attach your battery through the power in jack rather than the Vin pin then the series diode will prevent the back powering of your robot through the USB lead.

right, i have inserted a barrier diode before Vin pin and now no curret flow back from Vin pin to other electronics..

certainly this help but it is not ok at all because:

since arduino remain active it continue to fire signals through output pins to electonics that are not actualy powered.... For example(when i switch off the battery, keeping usb connected) i have the L293 which do not receive power from battery on Vs pin but continue to receive Logic Vss and input signals... I think this is an unproper mode of operate... infact sometime motors connected to L293 move slightly draining power from usb....

bah!

As long as the logic Vcc is connected to the USB power Arduino then it is OK to fire signals into it.

infact sometime motors connected to L293 move slightly draining power from usb

The motors are not draining power from the USB , there is not path for this. The twitching could be due to discharge of the de-coupling capacitors across the motor supply (you do have some don't you? if not get some)

I think u r right, that motor activity may be due to decoupling cap discharge...

btw is it clear that:
I use [5V out] of the Arduino as logig Vcc for my electronics and batteries to power motors and eventually other devices power demanding...

L293 is an example of a circuit where those TWO power supply source flow togeter...

I was only asking myself if may be dangerous to diconnect only one of the two power source leaving electronics partially powered and partially not :slight_smile:

excuse me for this long post due to my poor english skill

if may be dangerous to diconnect only one of the two power source leaving electronics partially powered and partially not

There is no hard and fast rule about this. In your case you are all right with the L293 but you have to look at each case on it's merits. One danger of having an active input on a unpowered or powered down chip is that you can get latch up. That is when the power is restored the chip does not function and you have to remove power from all the circuits and power up again before it works. This latch up is difficult to treat if you find it but it is something that engineers trying to get equipment to go into a low power stand by mode have to consider.

excuse me for this long post

No problem we got there in the end. :slight_smile:

many thanx for the help

I have finished the beast and started software programming

I had studied a bit how to implement the brain

I could have no problems to drive a minirobot with BasicX, but arduino do not support multitasking, so it seems to me like returning to picaxe programming

now the real problem is the fact that the 6 AAA 800mAh NiMh cells have discharged in half an hour of development and test....

it is strange because motors are quite efficient and I do not see other power sinks

now i am going to recharge batteries...

now the real problem is the fact that the 6 AAA 800mAh NiMh cells have discharged in half an hour of development and test....

That doesn't sound too far out for driving motors.

Hi there,

I ran into a similar issue recently, where I didn't want USB powering a duemilanove board, ever:
-we have very large current requirements, much too high for a USB power to provide;
-we have to power the Arduino through the +5V pin, because we only have a single (large) 5V rail available externally. We can't afford the dropout from the on-board regulator that would come with a barrel connection. (It would be a better idea to decouple the Arduino's supply from the rest of the circuit's, but the external supply is sufficiently-well regulated that this is not an issue for us at the moment.)

What I wound up doing was cutting part of the USBVCC trace, between one leg of F1 and pin 2 of the NDT2955 MOSFET. This is a tiny trace, about 1mm long, between a pad by the middle pin of the transistor and the polyfuse chip. It would be easily bridged should the need arise.

(Though the thread is asleep, judging by the high view count, it seems many people have interest in the topic, so I figured I'd share our solution in case it helps anybody out.)

Cheers!