More about the Raspberry Pi’s USB ports

More about the Raspberry Pi’s USB ports
Image by Gareth Halfacree ( BY-SA 2.0)
Published: by
Last updated:
Categories
Raspberry Pi

Raspberry Pi B models have 5 USB ports. The USB type and speed improved with later versions. Here we discuss the Raspberry Pi’s USB ports.

Introduction to the Raspberry Pi’s USB ports

Raspberry Pi B models have 5 USB ports — one for power input and four to connect peripherals to. On the Raspberry Pi 4B the USB-C port doubles as an “OTG” port.

The four standard USB (Type-A) ports are used to connect peripherals such as a keyboard and mouse, game controllers, USB Drives, USB adapters, and external hard drives.

When more than four peripherals are required, a USB hub can be used to add additional USB ports to a Raspberry Pi.

Important factors when it comes to the USB ports of the Raspberry Pi are the type of USB ports, the USB port transfer speed, the current limit per USB port and USB boot capabilities. OTG functionality for the Raspberry Pi 4B is also discussed.

Raspberry Pi USB port information
Comparison between Raspberry Pi model’s USB version numbers and amount, recommended power supply, maximum USB current and Max USB port speed. Note that the Max. USB current and Max. port speed is shared between the four USB Type-A ports.

Sponsored links

Please support us by using these links they come at no additional cost to you, but we get a little commission each time they are used. These and others are available from Amazon.com and BangGood.

We have tested most of these products ourselves. Other selection criteria include affordability, quality, availability and average user rating and popularity by other buyers.

Links will open in a new window.
(Dead or old links can be reported in the comments section below.)

Catda Raspberry Pi 4B Starter Kit
Catda Raspberry Pi 4B Starter Kit
2019 Model B, 4GB RAM
1.5GHz 64-bit quad-core CPU & 4GB RAM, Gigabit Ethernet, Wi-Fi, Bluetooth, USB 2.0/3.0, headphone jack and duel Micro HDMI (4K). Kit includes power supply, MicroSD, USB MicroSD card reader, a case with heatsink and fan, mini-HDMI cable and USB-C PiSwitch.
Available from BangGood
iUniker Raspberry Pi 4B 8GB Starter Kit
iUniker Raspberry Pi 4B 8GB Starter Kit
2019 Model B, 8GB RAM
1.5GHz 64-bit quad-core CPU & 8GB RAM, Gigabit Ethernet, Wi-Fi, Bluetooth, USB 2.0/3.0, headphone jack and duel Micro HDMI (4K). Kit includes power supply, MicroSD, USB MicroSD card reader, a case with heatsink and fan, mini-HDMI cable and USB-C PiSwitch.
Available from Amazon.com
iUniker Raspberry Pi 4B 4GB Starter Kit
iUniker Raspberry Pi 4B 4GB Starter Kit
2019 Model B, 4GB RAM
1.5GHz 64-bit quad-core CPU & 4GB RAM, Gigabit Ethernet, Wi-Fi, Bluetooth, USB 2.0/3.0, headphone jack and duel Micro HDMI (4K). Kit includes power supply, MicroSD, USB MicroSD card reader, a case with heatsink and fan, mini-HDMI cable and USB-C PiSwitch.
Available from Amazon.com

Raspberry Pi USB types

Power to the Raspberry Pi B+, 2B, 3B, and 3B+ is supplied using the Micro-B USB (aka Micro USB) port on the side of the board. This port has been replaced by a USB Type-C on the Raspberry Pi 4B.

Raspberry Pi USB ports
The USB connectors used on Raspberry Pis are USB Type-A, also known as the common USB port, Micro USB (aka Micro-B USB), and USB Type-C (aka USB C or Micro-C USB). The Micro USB or USB Type-C ports are used for powering the Raspberry Pi.

The four larger Type-A USB ports at the bottom of the board range from four x USB 2.0 on the Raspberry Pi B+, 2B, 3B, and 3B+ to 2 x USB 2.0 plus 2 x USB 3.0 on the Raspberry Pi 4B.

Raspberry Pi USB port speed

USB Flash drives and external hard drives are commonly connected to transfer data to and from a Raspberry Pi. For data transfer, the faster USB 3.0 ports are preferred over USB 2.0 ports. At the time of updating this post, it was only the Raspberry Pi 4B that had USB 3.0 ports.

USB port speeds are dependant on their version and can be classified as follows:

  • USB 1.0/1.1 (low-speed) = 1.5Mbit/s
  • USB 1.0/1.1 (full-speed) = 12Mbit/s
  • USB 2.0 (high-speed) = 480Mbit/s (60MB/s)
  • USB 3.0 (SuperSpeed) = 4.8Gbit/s (600MB/s)

Unfortunately, these are not the actual USB port speeds of the Raspberry Pi. The USB ports of Models B+, 2B, 3B, and 3B+ have a single root USB bus from the processor which is shared with Ethernet. This means that the maximum bandwidth (480Mbit/s) is shared between the four USB ports.

The Raspberry Pi 4B has a PCIe lane running from the processor to the PCIe-USB Chipset, meaning its maximum bandwidth (4.8Gbits/s) is also divided between the four USB ports. The USB 2.0 ports will be limited to high-speed.

Changing the port speed of the Raspberry Pi

Sometimes the Raspberry Pi gives issues after connecting older USB 1.0/1.1 devices. In these cases, it might be necessary to change the Raspberry Pi’s USB port speed from high-speed to full-speed.

This can be done by adding the speed parameter to the USB driver in the /boot/cmdline.txt file. By default, this parameter will not be set.

To access and append the cmdline.txt file for this purpose, the nano terminal command can be used (with sudo privileges):

sudo nano /boot/cmdline.txt

and adding the following line to the end of the file:

dwc_otg.speed=1

The file can be saved and closed by pressing Ctrl + X and then Y and Enter.

The trade-off of downgrading the USB port speeds on the Raspberry Pi is that newer devices might now start to give issues. If this is the case, it’s better to change the USP port speeds back to their default and upgrade the devices instead.

Raspberry Pi USB current limits

Another important aspect of the Raspberry Pi USB ports is their current limit.

When the recommended power supply is used, the cumulative current output of the Raspberry Pi B+ and 2B USB ports is 600mA. This can be increased to 1.2A by changing the max_usb_current boot parameter in the boot configuration file.

To access and append the boot configuration file for this purpose, the nano terminal command can be used (with sudo privileges):

sudo nano /boot/config.txt

and adding the following line to the end of the file:

usb_max_current = 1

The file can be saved and closed by pressing Ctrl + X and then Y and Enter.

Since the Raspberry Pi 3B, the maximum current of the USB has been increased to 1.2A and it can’t be changed.

When the cumulative current of the connected USB devices is higher than 1.2A, the Raspberry Pi is starting to give errors or show abnormal behaviour or external USB drives are to be connected, it is better to use a powered USB hub (see below).

5V 2.5A Power Supply With On/Off Switch (US, EU)
5V 2.5A Power Supply With On/Off Switch (US, EU)
For Raspberry Pi 2/3
Input 100-240V AC. 75x41x29mm. Micro-B USB connector.
Available from BangGood
CanaKit 5V 2.5A Raspberry Pi 3 B+ Power Supply (US)
CanaKit 5V 2.5A Raspberry Pi 3 B+ Power Supply (US)
For Raspberry Pi 2/3
UL Listed. Input >100V AC. 3.75 x 2.75 x 1.25 inches. Micro-B USB connector.
Available from Amazon.com
Official 5.1V 3A Raspberry Pi 4 Power Supply (US)
Official 5.1V 3A Raspberry Pi 4 Power Supply (US)
For Raspberry Pi 4
UL Listed. White. Input: 100-240V 50/60Hz 0.5A, Output: 5.1-3.0A. 3.27 x 2.4 x 1.93 inches. USB-C connector.
Available from Amazon.com

Connecting a USB hub to a Raspberry Pi

A USB hub is a device that expands one USB port into several. This will allow more than, the usual, four USB devices to connect to a Raspberry Pi. Up to 15 USB devices can be connected to a Raspberry Pi at the same time.

USB hub
Example of a USB hub. In this case, one port is extended into four ports, giving 3 extra USB ports.

Some USB hubs are powered, while others draw their current from the main USB connection. Because the current limit on the Raspberry Pi’s USB port is fairly low, especially when other USB devices are also connected, it is advised that a powered USB hub is used instead.

Amazon Basics 7 port USB 2.0 hub 5V,4A power adapter
Amazon Basics 7 port USB 2.0 hub 5V,4A power adapter

Black. Includes 0.9m / 3ft. USB 2.0 cable, Plug-and-Play, backward compatible with USB 1.1, Transfer speeds of up to 480Mbit/s. Max. output per port is 500mA for 5 regular USB ports and 1.5A for 2 USB fast charging ports, max. ouput 20W (5V/4A) across all 7 ports.
Available from Amazon.com

Raspberry Pi USB boot

The Raspberry Pi 4B has USB boot capabilities. This feature allows the Raspberry Pi to boot from a bootable Flash drive connected to one of the USB ports.

Any Raspberry Pi compatible operating system can be installed onto a USB Flash drive in the exact same way it is installed on a MicroSD card.

USB boot is configured in the Raspberry Pi’s bootloader, which is stored in the EEPROM. Older versions of the bootloader still have USB boot disabled. Fortunately, by simply updating the Raspberry Pi’s firmware, the bootloader will also be updated to enable USB boot. Even if USB boot is enabled, the Raspberry Pi will revert back to the MicroSD card if no bootable USB device is available.

The Raspberry Pi’s firmware is updated using the following terminal command:

sudo apt-get dist-update

The updates will only take effect on the next boot, but before then the USB Flash drive can be connected and the MicroSD card needs to be removed. The Raspberry Pi can be safely shut down by using the shutdown terminal command:

sudo shutdown

To boot the Raspberry Pi after it has been shut down, simply connect the power supply again.

Raspberry Pi USB On-The-Go functionality

The Raspberry Pi 4B has so-called On-The-Go (or OTG) USB functionality on the USB-C port.

Technically speaking, OTG is a technology that allows a USB device (e.g. a mobile phone) to act as a host for devices such as keyboards, Flash drives, cameras, etc. It allows the mobile phone to switch back and forth between the host and peripheral.

Although referred to as OTG, the Raspberry Pi 4B USB-C port was designed to turn it into a peripheral. The other four USB ports can be used when the Raspberry Pi is to be used as a host.

This, for example, allows the Raspberry Pi to be connected directly to a PC using a USB-C cable and have SSH access to it. In this case, there is no need for a network connection, keyboard, mouse and/or screen.

Amazon Basics USB-C to USB-A 2.0 Fast Charging Cable
Amazon Basics USB-C to USB-A 2.0 Fast Charging Cable

Various colours, double-braided nylon cable, fast charging cable, 3A, 90 cm / 3 ft. Can also be used to connect a Raspberry Pi 4B to a personal computer.
Available from Amazon.com

Raspberry Pi USB accessories

To get started with the Raspberry Pi, the following accessories might be required.

Conclusion

Here we discussed the Raspberry Pi’s USB ports. The boards come standard with four USB ports which can be used to connect peripherals such as a keyboard and mouse, game controllers, USB Drives, USB adapters, and external hard drives. A USB hub can also be connected to the Raspberry Pi to extend the number of available USB ports.

Important factors when it comes to USB ports are their data transfer speed, the amount of power they can supply and USB boot capabilities.

The type of USB ports, the USB port transfer speed, the current limit per USB port, USB OTG functionality and USB boot capabilities of the Raspberry Pi were also discussed.

About the author
Renier busies himself with improving his English writing, creative web design and his websites, photoshopping, micro-electronics, multiple genres of music, superhero movies and badass series.
Behind the Scenes is a free, informative website. If you find value in any of our content, please consider making a donation to our cause, or becoming a Patron for exclusive content.
Donate via PayPal Become a Patron

Save, share & discuss

Your comment is important, but don't be a knob. Keep it constructive and polite.

Leave a Reply

Your email address will not be published.

More Raspberry Pi and microelectronics related posts