USB and Vin connected simultaneously

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
gratefulfrog
Posts: 149
Joined: Sun Mar 01, 2015 12:10 pm

USB and Vin connected simultaneously

Post by gratefulfrog » Tue Nov 03, 2015 2:24 pm

Hi,

Does anyone know if there is a problem having both the USB cable and a Vin connected simultaneously?

I tried it briefly and smelled smoke!

Thanks,
Bob

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: USB and Vin connected simultaneously

Post by blmorris » Tue Nov 03, 2015 2:59 pm

gratefulfrog wrote:Hi,

Does anyone know if there is a problem having both the USB cable and a Vin connected simultaneously?

I tried it briefly and smelled smoke!

Thanks,
Bob
Smoke is usually an indication of a problem, and in this case, sadly unsurprising :(
The question now is where the smoke came from, and I can offer a few guesses depending on what you had connected to Vin.

On the pyboard, USB VBUS (5V nominal) is connected to the Vin bus via D1, a 1N5819 Shottky diode. D1 is oriented to allow current to flow from VBUS to Vin, but not the other way around. Vin is the unregulated power for the 3.3V regulator, nominally it can be anywhere from 3.6V up to a limit of 10V (at which point the 3.3V regulator risks overheating). If you had a power supply connected to Vin that was less than 5V, then you could have had unrestricted current flowing from your USB port through D1 to your power supply. This could burn your USB port's power pin, D1, or your power supply. Or, if you are very lucky, you got a smell of hot electronics which didn't get quite hot enough to produce actual smoke.

D1 is there to protect the USB port from having current injected from a power supply on Vin providing more than 5V; even if D1 is burned out, current usually shouldn't be able to go that direction.

The way to test is to see if your pyboard will still power up from your USB port; if it does, then at worst you fried the power supply connected to Vin. If not, try another USB port. If neither works, you probably blew out D1. If you are careful and have access to a soldering iron, you might be able to fix it; otherwise you will be stuck powering your pyboard from your external power supply. The good news is that now that D1 has acted as a protective fuse, you probably can't damage anything further. ;)

-Bryan

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: USB and Vin connected simultaneously

Post by blmorris » Tue Nov 03, 2015 3:05 pm

I should add a bit of advice: if you want to set up your pyboard to fall back to an external power supply when USB is disconnected, you can use something called a "Diode-OR" circuit. Half of the diode-OR is already there; this is D1 which allows current to flow from USB VBUS to Vin, but not the other way. To implement the other half of the diode-OR, provide a 1N5819 or similar Shottky diode between your external power supply and Vin, again oriented so that current can only flow from the power supply to Vin. This way the Vin bus will get power if either VBUS _OR_ the external power supply is present, and will draw power only from the supply providing the higher voltage.

-Bryan

gratefulfrog
Posts: 149
Joined: Sun Mar 01, 2015 12:10 pm

Re: USB and Vin connected simultaneously

Post by gratefulfrog » Wed Nov 04, 2015 7:15 am

Hi,

Thanks for your advice. I'm not exactly sure what you meant, though.

You say:
if you had a power supply connected to Vin that was less than 5V, then you could have had unrestricted current flowing from your USB port through D1 to your power supply.
The PSU produces around 4.93v, so it is indeed less that 5v. Do you think that reverse potential could be heating up the LM2596 regulator?

I guess that a diode between the PSU and Vin is what I should test? My stock is very low, I can choose from below :
  • BAT46 Schotky diode, with a forward current rating of 150mA, which is low for my application
  • IN4004 rectifier diode, with much higher rating, but not Schotky...
Otherwise, I can go shopping, of course!

Thanks so much for all this help!
Ciao,
Bob

gratefulfrog
Posts: 149
Joined: Sun Mar 01, 2015 12:10 pm

Re: USB and Vin connected simultaneously

Post by gratefulfrog » Wed Nov 04, 2015 3:32 pm

I added a Schottky diode between the input and output of the LM2956 and everything is cooooool!!

Thanks so much for the tip!

Ciao,
B

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: USB and Vin connected simultaneously

Post by blmorris » Wed Nov 04, 2015 4:54 pm

@gratefulfrog - Good to hear it! I suspect that the problem has more to do with the LM2956 latching up because its feedback pin is energized before it gets turned on, and less to do with reverse current from the USB being injected to the ML2956 because of the voltage difference, but either way it's good that you have it working!

-Bryan

Post Reply