-
-
Notifications
You must be signed in to change notification settings - Fork 104
USB power supply considerations
First of all, USB is complicated. The specifications aren’t entirely straightforward and sometimes seem to contradict themselves. Due to the complexity, this article can only give a brief overview. It is by no means a complete guide to USB and I will leave out information if they are not relevant. However, I will add conclusions considerations for „best practice“ with regards to sim panel building.
It is important to understand the difference between the actual USB specification and the USB connector specification. The latter defines the plug and receptacle and does not make any statement about the current that can be drawn from it. It outlines the mechanical (and electrical) characteristics of USB connectors. Typical connectors are USB-A, USB-B, MicroUSB or USB-C.
The USB specification on the other hand defines the function. The main difference between the USB versions is the data transmission speed. There is also an interesting difference in the power supply definitions between USB 2.0 and 3.x. We won’t deal with data transmission speeds here because it’s usually irrelevant and almost all appliances we use are USB 2.0 anyway.
Since USB is usually backwards compatible, a device using a USB-C plug can be anything from USB 2.0 to USB 4 Gen4. Remember: USB-C is just the definition of the plug! Therefore it is not possible to make a generally valid statement about the current capabilities of a cable or device without taking a closer look.
Before we start looking into the details of USB power supply, we need to introduce a few terms to bring us all on the same page. A USB capable appliance has two main properties: data operation and power supply.
- A USB appliance that transmits or receives data can be either a host or a device.
- A USB appliance delivering power is called a source, an appliance receiving power is a sink.
In almost all cases, the host will also be the source and the device will be the sink.1 Until the introduction of USB-C, there was a clear definition that let you distinguish a host from a device by looking at the connector. Hosts would always have a USB-A connector. USB-C changed this axiom. We will talk about it later.
The first thing we need to accept is that not we, or our sink, decides how much power we can get. It is the source’s (your computer‘s) decision. Always.2 As per USB 2.0 specification, the source must provide 100mA to every device. Yes, 100mA, or (as per specification) one unit load. This is called low-power mode. You probably thought of 500mA, right? Well… the sink can indicate that it is a high-power device and request up to 500mA from the source. This process is called enumeration and it’s a very complex thing that happens in the first milliseconds when you plug in a USB appliance. There is a lot more going on during this process, but we’ll focus on power supply.
The USB 2.0 specification states
A device may be either low-power at one unit load or highpower, consuming up to five unit loads. All devices default to low-power. The transition to high-power is under software control. It is the responsibility of software to ensure adequate power is available before allowing devices to consume high-power. 2
Host controllers monitor their power consumption. That's the reason why you cannot simply request more, but rather ask for more. However, the initial specification is already a bit older and has been updated a few times. Nowadays you can usually expect to the 500mA from a computer's USB port, because
Root port hubs: Are directly attached to the USB Host Controller. Hub power is derived from the same source as the Host Controller. Systems that obtain operating power externally, either AC or DC, must supply at least five unit loads to each port. Such ports are called high-power ports.2
For USB 3.x the same rules apply as for USB 2.0. The main difference is that we can get 150mA initially, and up to 900mA after enumeration. But wait! It is important to understand that you don’t get 900mA automatically if you plug your USB device into a 3.x port. You can only get the higher current if your device identifies as a USB 3.x device. A regular Arduino board, which is a USB 2.0 device, will not get more than 500mA from a USB 3.x port.
Yes... and this is the part where it becomes complicated. So far, we have only talked about the USB specifications. The thing we didn't take into consideration: Do manufacturers really care? No, they don't. Most USB hardware providers exceed the requirements of the specification with regards to power supply. They don't want to take the risk that random USB devices don't work with their hardware. In most cases you will be able to draw more power from a USB source. That's good for us! But please keep in mind: Strictly speaking, you're operating outside of the USB specification. There is no guarantee that it will always work with any hardware.
Here is the good news: Active USB hubs must provide 500mA per port.2 That means if you’re using a self-powered hub, you can always assume to have 500mA (or 900mA if it's a USB 3.x hub) available on every single port.
to be continued
1 https://www.usb.org/sites/default/files/USB%20Type-C%20Spec%20R2.0%20-%20August%202019.pdf Paragraph 2.3.3
2 https://www.usb.org/document-library/usb-20-specification Paragraph 7.2.1
- MobiFlight Connector Installation
- Mobiflight Connector BETA version installation
- Modules
- MobiFlight Connector Files Structure
- MobiFlight Connector Uninstall
- Modules Reset to factory default
- Verifying the WASM module installation and locating the MSFS2020 community folder
- Using a Winwing FCU with MobiFlight
- Providing logs from MobiFlight
- MobiFlight Connector How does it work
- Mobiflight Connector Main Window
- Flash module with MobiFlight firmware
- Input and Output devices
- Joysticks
- Midi Boards
- Sim Variables (for Output)
- Input Actions
- Merging configuration files
- Disabling specific COM ports
- Examples Output LEDs
- Examples Input Switch
- Example 7 segment display
- Example Servo motor
- Controlling LEDs with an output shift register
- Adding lots of buttons with an input shift register
- Beginner's guide to input multiplexers
- Key Matrix with standard MobiFlight and Multiplexers
- Tutorial Easy Driver and x.27 or x.40 Stepper Motor
- Tutorial for Airbus VS display via 7-Segment LED Module
- Example Analog Input Potentiometer
- Baron G58 Tutorial Gear, Flaps, Mags, ELT Input Output Programming
- Using Mobiflight to control arduino-based 3rd party panels (RealSimGear GNS530)
- How to use a VNH2SP30 DC motor shield with MobiFlight
- Using 3D printer mainboards
- Playing sounds by sending keystrokes to AutoHotKey
- Using the selector knob on a Honeycomb Bravo
- Using an adjustable 12 position switch as a GA starter
- Brightness of LCD displays with I2C
- Using three-position switches
- Transponder with one Rotary
- MSFS2020 RPN Tips and Tricks
- MSFS2020 Using the Custom Input Code Box
- MSFS2020 Install WASM module and Event List
- MSFS2020 How to Create and Use User Defined Lvars
- MSFS2020 How to Create a Blinking LED configuration
- MSFS2020 User Defined WASM Module Events Best Practices
- MSFS2020 Developer Mode, Model Behavior dialog and Console window
- MSFS2020 PMDG 737‐700 List of Events that require use of FSUIPC7
- MSFS2020 PMDG 737‐700 Calibrate throttle idle and reverse thrust using interpolation (Valkyrie)
- MSFS2020 PMDG 737-700 Chrono unit functions implemented in Mobiflight
- Configuring PMDG 737 Parking Brake Lever Auto-Release with a Servo in Mobiflight
- Using encoder to drive a value back and forth within a given range
- Adding a custom board to MobiFlight
- User guide - Community Board and Custom Devices
- Developing your own custom devices/boards