4
\$\begingroup\$

I have a batch of Sanguino 1.3a RepRap boards, with the following "bug" listed:

The USB 5V VBUS is connected to the output of the 5V regulator. This is bad for the regulator and bad for the PC. Some users report the regulator getting very hot (because it is trying to power the PC), other users report the PC giving USB over current errors. Nophead recommends cutting the 5V track to the USB connector. The only downside is the board needs the 12V supply before it will do anything.

We've seen this in several cases, the LED in the schematic will drop in brightness when USB is plugged in, and the voltage regulator gets really hot really fast. However, this behavior is intermittent, and I'm curious as to the cause, behavior, and how USB is expecting the +5V to behave.

You can see in the schematic below in the FTDI/USB2TTL panel that USB 5V connects to the board's 5V bus, and the "Power from screw terminals and vreg" puts 5V straight onto the 5V bus without any kind of diodes. So, I can see where this is happening. Are most USB devices either powered exclusively by USB's +5V power, or they just reference ground and let 5V float?

Full size schematic

Sanguino 1.3a schematic

\$\endgroup\$
5
\$\begingroup\$

how USB is expecting the +5V to behave

According to the specs from usb.org, there can be a current from 0mA to 500mA on VBUS (+5V). Reverse currents are not allowed.

Many of my older PC power units delivered only 4.9 Volt or even less on the 5 Volt lines. In that case the output voltage of the LM7805 will be higer and a reverse current flows into the PC. But this depends on the ATX power unit, and factors like temperature and CPU load (current).

Are most USB devices either powered exclusively by USB's +5V power, or they just reference ground and let 5V float?

Read the spec: Essentially these are the two choices you have.

\$\endgroup\$
7
\$\begingroup\$

I don't understand what you would use the USB's 5 V for. You have a 7805 to get 5 V from your 12 V, which you'll need anyway, so the 5 V will always be available, and with enough current without needing that 100 mA from the USB port. So I would disconnect the latter by cutting the trace at the connector, then you're sure it can't cause any conflicts.

The reason why you should never directly connect outputs from voltage regulators is that the world isn't perfect. If 5 V would be 5.000000 V you wouldn't have a problem. But regulators have a tolerance on their output voltage, often 5 %, so that 5 V may as well be 5.25 V. So most likely the two voltages aren't equal.

The second part of the problem is that voltage regulators have a very low output impedance, like a few 10s of mΩ, for an ideal regulator it would be zero. So a voltage difference combined with a very low resistance gives you a high current.

If you want to combine outputs from 2 regulators use Schottky diodes. They will give you a voltage drop of a couple of 100 mV, which may be acceptable. If you want you can add the same diode in series with the 7805's ground pin. Then you first lift the output to 5.3 V and a 0.3 V from the series diode will give you 5 V out. With a series diode the USB output will be lower, then the highest voltage has the priority.

\$\endgroup\$
1
\$\begingroup\$

In addition to not allowing reverse current on the 5V line (so don't drive it), USB does not permit driving currents down the D+/D- data lines unless the 5V line is powered. This means that even on self-powered devices, which do not draw their power from USB, the USB 5V connects to a VBUS sensing pin (often dedicated on USB capable chips, sometimes simply connected to reset). Also, the tolerance on USB power is 10%; anywhere from 4.5V to 5.5V is permitted. This may account for the intermittent behaviour.

\$\endgroup\$
  • \$\begingroup\$ Tolerance is +/- 5%, 4.75-5.25 \$\endgroup\$ – rsaxvc Apr 16 '17 at 8:37
  • \$\begingroup\$ Specs do change. I haven't tracked down where I originally read the 10%, but USB 3.1 spec 1.0 section 11.4.2 states "The voltage supplied at the connector of hub or root ports shall be between 4.45 V to 5.25 V." USB Power Delivery spec 3.0 rev 1.1 section 7.4.3 permits vSafe5V in the range 4.75-5.5V. USB ECN "USB 2.0 VBUS Max Limit" raised USB 2.0 Vbus max from 5.25V to 5.5V, in order to handle type C current ranges. \$\endgroup\$ – Yann Vernier Apr 16 '17 at 11:06
  • \$\begingroup\$ You are correct. My numbers are from the USB2 spec for a high power port. \$\endgroup\$ – rsaxvc Apr 16 '17 at 16:13
0
\$\begingroup\$

This question might be old, but I think it's very very important to add something to this.

Not only does the USB spec prohibit back-driving Vbus, but you will destroy your computer if you try this! This is not merely theoretical - someone destroyed their Macbook Pro by back-driving 5V into Vbus. It was deemed irreparable by Apple, requiring a new logic board. I imagine many other PCs can be destroyed this way. The damage was not confined to the USB port - the entire computer was ruined.

The number of errors I see in "hobbyist/maker" projects blows my mind sometimes. These people shouldn't be designing things to connect to expensive equipment like a computer at all. It seems lots of people just paste circuits around the community without ever taking the time to read spec documents when designing something. No-name Chinese manufacturers are also guilty of this. I can't stress the importance of complying with all the necessary specifications when you implement an interface. It's even possible that you could be legally liable if you publish a design that someone builds and causes damage.

So it is absolutely essential that you have a schottky diode in series with Vbus, if not a completely different design. Depending on the regulator used, it's not always necessary to protect that against back-drive - but always check the datasheet carefully.

Back-drive can occur in another way - simply by putting too much capacitance on Vbus. The USB spec requires no more than (IIRC) 10uF. Any more than that and you will back-drive too much energy into Vbus when the computer is turned off (not to mention the inrush energy being too large when powered up).

The more usual way to handle USB power is to use an LDO to bring it down to 3.3V and run your circuit from that. That also eliminates the problem of the potentially large tolerance of Vbus.

My personal feeling is that if an error this grave is present in the design, there are probably other very serious errors too. If possible, I would be inclined to source from another manufacturer/designer. It might seem like an unnecessary expense if you've already bought the board, but how much is the equipment the board will be connected to worth? What are the financial implications if those devices suffer damage as a result of an improper design? You might be able to salvage the board by doing some modifications to it, but you'll need to invest some time doing spec/datasheet reading first.

If the design uses a USB-to-serial conversion chip, there are some perils involved. Ideally the entire device wants to be powered from Vbus to eliminate issues - but make sure there is no possibility of back-drive by another device attached to your board such as a motor which might generate back-EMF or a serial data line which is pulled up to an external supply. If you're powering from a local supply, then you'll need to make sure the USB-to-serial chip can read Vbus to determine whether to drive D+/D-. One way to do this is to power the USB-to-serial chip from Vbus and the rest of your circuit from a separate supply. But now you have a new problem - latchup. There is the possibility that you might be driving logic signals into the rest of your circuit which is powered down, or the rest of your circuit drives logic signals into the USB-to-serial chip when it's powered down. Both can be catastrophic if you exceed the maximum clamping current (which may be listed in the datasheets of the relevant chips - or it may not). A series resistor can sometimes be used to limit the current, but never assume anything about the clamping current rating. Some devices can tolerate 10s of mA, others can only tolerate a few 100s of uA. This is just one of the reasons why multiple-supply designs can be a big headache and a real trap for those unaware of such issues. Life is so much easier if you can be certain there's only one power supply involved - and in the case of a USB device, that would be the computer's power supply. These days with low power MCUs and FPGAs, it's probably simplest to power everything 3.3/5V from Vbus and only use an external supply for things like motors. The transistors which drive the motors will provide the necessary isolation between the two supply domains. If using motor driver ICs, you need to check carefully to make sure the logic and high voltage parts can be powered independently with no sequencing requirements.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.