# I need to read two USB devices

**URL:** <https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393>\
**Category:** General Guidance\
**Created:** [July 17, 2026, 4:02pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393 "2026-07-17T16:02:07Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![rva1945arduino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/rva1945arduino/32/1277974_2.png) [@rva1945arduino](https://forum.arduino.cc/u/rva1945arduino)\
**Post date:** [July 17, 2026, 4:02pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/1 "2026-07-17T16:02:07Z")

</div>

Hi  
I want to read signals from a joystick and a rudder pedals set, both USB HID devices.  
I know there are some USB host shields but they allow me to read only one device.  
Should I use a 2-Port USB Hub and connect it to the USB shield?  
Thanks

---

<div class="post-metadata">

**Author:** ![time\_document\_3108](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/time_document_3108/32/1245996_2.png) [@time\_document\_3108](https://forum.arduino.cc/u/time_document_3108)\
**Post date:** [July 17, 2026, 4:12pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/2 "2026-07-17T16:12:56Z")

</div>

yes you can use an USB HUB but make sure it is a powered hub

see this video at 5:45

[![](https://europe1.discourse-cdn.com/arduino/original/4X/c/8/8/c88c1a98d2e495f06315071e7121bc0fb9836d09.jpeg "How to use USB HID Devices as Arduino Inputs - Keyboards, Mice, Magstripe/Barcode readers, and more!") ](https://www.youtube.com/watch?v=a24kk8yusSE)

this document may be of relevance as well [HID Usage Tables for Universal Serial Bus (USB)](https://usb.org/sites/default/files/hut1_21.pdf)

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [July 17, 2026, 4:24pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/3 "2026-07-17T16:24:34Z")

</div>

maybe worth looking at the ESP32-S3 File\>Examples\>USB\>CompositeDevice

thinking again rather than device you probably need OTG Host  
have a look at [EspHostExamplesHID](https://github.com/tanakamasayuki/EspUsbHost/tree/master/examples/HID)

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [July 17, 2026, 5:21pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/4 "2026-07-17T17:21:58Z")

</div>

might help to know what board you are using?

---

<div class="post-metadata">

**Author:** ![rva1945arduino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/rva1945arduino/32/1277974_2.png) [@rva1945arduino](https://forum.arduino.cc/u/rva1945arduino)\
**Post date:** [July 17, 2026, 6:08pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/5 "2026-07-17T18:08:31Z")

</div>

I can use a MEGA or an UNO.

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [July 18, 2026, 8:59am UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/6 "2026-07-18T08:59:35Z")

</div>

I doubt if a UNO or Mega would support two USB OTG Host devices

the ESP32-S3 will - e.g.

```cpp

// ESP32-S3 USB OTG Host CompositeHID example

// library https://github.com/tanakamasayuki/EspUsbHost/tree/master

// file>Examples>CEspUsbHost>HID>EspUsbHostCompositeHID

#include "EspUsbHost.h"

EspUsbHost usb;

static int32_t posX = 0;
static int32_t posY = 0;

static void onKeyboard(const EspUsbHostKeyboardEvent &event)
{
  if (!event.pressed)
  {
    return;
  }

  Serial.printf("keyboard: address=%u iface=%u keycode=0x%02x",
                event.address,
                event.interfaceNumber,
                event.keycode);

  if (event.ascii == '\r')
  {
    Serial.print(" ascii=Enter");
  }
  else if (event.ascii >= 0x20 && event.ascii != 0x7f)
  {
    Serial.printf(" ascii='%c'", (char)event.ascii);
  }

  Serial.println();
}

static void onMouse(const EspUsbHostMouseEvent &event)
{
  if (event.buttonsChanged)
  {
    uint8_t pressed = event.buttons & ~event.previousButtons;
    uint8_t released = event.previousButtons & ~event.buttons;
    if (pressed & ESP_USB_HOST_MOUSE_LEFT)
      Serial.printf("mouse: address=%u iface=%u left press\n", event.address, event.interfaceNumber);
    if (released & ESP_USB_HOST_MOUSE_LEFT)
      Serial.printf("mouse: address=%u iface=%u left release\n", event.address, event.interfaceNumber);
    if (pressed & ESP_USB_HOST_MOUSE_RIGHT)
      Serial.printf("mouse: address=%u iface=%u right press\n", event.address, event.interfaceNumber);
    if (released & ESP_USB_HOST_MOUSE_RIGHT)
      Serial.printf("mouse: address=%u iface=%u right release\n", event.address, event.interfaceNumber);
    if (pressed & ESP_USB_HOST_MOUSE_MIDDLE)
      Serial.printf("mouse: address=%u iface=%u middle press\n", event.address, event.interfaceNumber);
    if (released & ESP_USB_HOST_MOUSE_MIDDLE)
      Serial.printf("mouse: address=%u iface=%u middle release\n", event.address, event.interfaceNumber);
  }

  if (event.moved)
  {
    posX += event.x;
    posY += event.y;
    Serial.printf("mouse: address=%u iface=%u pos: x=%ld y=%ld delta: dx=%d dy=%d wheel=%d\n",
                  event.address,
                  event.interfaceNumber,
                  (long)posX,
                  (long)posY,
                  (int)event.x,
                  (int)event.y,
                  (int)event.wheel);
  }
}

static void onConsumerControl(const EspUsbHostConsumerControlEvent &event)
{
  Serial.printf("consumer: address=%u iface=%u %s usage=0x%04x %s\n",
                event.address,
                event.interfaceNumber,
                event.pressed ? "press" : "release",
                event.usage,
                espUsbHostConsumerControlUsageName(event.usage));
}

static void onSystemControl(const EspUsbHostSystemControlEvent &event)
{
  Serial.printf("system: address=%u iface=%u %s usage=0x%02x %s\n",
                event.address,
                event.interfaceNumber,
                event.pressed ? "press" : "release",
                event.usage,
                espUsbHostSystemControlUsageName(event.usage));
}

void setup()
{
  Serial.begin(115200);
  delay(2500);

  Serial.println("EspUsbHost multiple HID example start");

  usb.setKeyboardLayout(ESP_USB_HOST_KEYBOARD_LAYOUT_JA_JP);

  usb.onDeviceConnected([](const EspUsbHostDeviceInfo &device)
                        {
                          Serial.print("connected: ");
                          espUsbHostPrint(device); });

  usb.onDeviceDisconnected([](const EspUsbHostDeviceInfo &device)
                           {
                             Serial.print("disconnected: ");
                             espUsbHostPrint(device); });

  usb.onKeyboard(onKeyboard);
  usb.onMouse(onMouse);
  usb.onConsumerControl(onConsumerControl);
  usb.onSystemControl(onSystemControl);

  if (!usb.begin())
  {
    Serial.printf("usb.begin() failed: %s\n", usb.lastErrorName());
  }
}

void loop()
{
  delay(1);
}

```

serial monitor output connecting a USB Hub, keyboard and two mice

```arduino
EspUsbHost multiple HID example start
connected: device: address=1 portId=0x01 vid=05e3 pid=0608 class=0x09(Hub) speed=full-speed product="USB2.0 Hub"
connected: device: address=2 portId=0x14 vid=413c pid=2113 class=0x00(per-interface) speed=low-speed product="Dell KB216 Wired Keyboard"
keyboard: address=2 iface=0 keycode=0x04 ascii='a'
keyboard: address=2 iface=0 keycode=0x05 ascii='b'
keyboard: address=2 iface=0 keycode=0x06 ascii='c'
keyboard: address=2 iface=0 keycode=0x07 ascii='d'
keyboard: address=2 iface=0 keycode=0x08 ascii='e'
keyboard: address=2 iface=0 keycode=0x09 ascii='f'
connected: device: address=3 portId=0x12 vid=045e pid=00a4 class=0x00(per-interface) speed=low-speed product="Microsoft(R) Compact Optical Mouse"
mouse: address=3 iface=0 pos: x=8 y=-11 delta: dx=8 dy=-11 wheel=0
mouse: address=3 iface=0 pos: x=9 y=-13 delta: dx=1 dy=-2 wheel=0
mouse: address=3 iface=0 pos: x=11 y=-15 delta: dx=2 dy=-2 wheel=0
mouse: address=3 iface=0 pos: x=12 y=-16 delta: dx=1 dy=-1 wheel=0
mouse: address=3 iface=0 pos: x=14 y=-17 delta: dx=2 dy=-1 wheel=0
mouse: address=3 iface=0 pos: x=15 y=-18 delta: dx=1 dy=-1 wheel=0
mouse: address=3 iface=0 pos: x=16 y=-18 delta: dx=1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=16 y=-17 delta: dx=0 dy=1 wheel=0
mouse: address=3 iface=0 right press
mouse: address=3 iface=0 pos: x=-118 y=-56 delta: dx=1 dy=1 wheel=0
mouse: address=3 iface=0 right release
mouse: address=3 iface=0 pos: x=-117 y=-56 delta: dx=1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=-116 y=-56 delta: dx=1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=-115 y=-56 delta: dx=1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=-114 y=-56 delta: dx=1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=-113 y=-56 delta: dx=1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=-108 y=-53 delta: dx=1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=-107 y=-53 delta: dx=1 dy=0 wheel=0
mouse: address=3 iface=0 left press
mouse: address=3 iface=0 pos: x=-106 y=-52 delta: dx=1 dy=1 wheel=0
mouse: address=3 iface=0 pos: x=-105 y=-52 delta: dx=1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=-104 y=-51 delta: dx=1 dy=1 wheel=0
mouse: address=3 iface=0 left release
mouse: address=3 iface=0 pos: x=-105 y=-52 delta: dx=-1 dy=-1 wheel=0
mouse: address=3 iface=0 pos: x=-106 y=-52 delta: dx=-1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=-136 y=-49 delta: dx=-1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=-136 y=-49 delta: dx=0 dy=0 wheel=1
mouse: address=3 iface=0 pos: x=-137 y=-50 delta: dx=-1 dy=-1 wheel=0
mouse: address=3 iface=0 pos: x=-137 y=-50 delta: dx=0 dy=0 wheel=1
mouse: address=3 iface=0 pos: x=-136 y=-49 delta: dx=1 dy=1 wheel=0
mouse: address=3 iface=0 pos: x=-135 y=-49 delta: dx=1 dy=0 wheel=0
connected: device: address=6 portId=0x11 vid=192f pid=0416 class=0x00(per-interface) speed=low-speed product="USB Optical Mouse"
mouse: address=3 iface=0 pos: x=554 y=-63 delta: dx=-2 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=550 y=-65 delta: dx=0 dy=1 wheel=0
mouse: address=3 iface=0 pos: x=550 y=-64 delta: dx=0 dy=1 wheel=0
mouse: address=3 iface=0 pos: x=549 y=-64 delta: dx=-1 dy=0 wheel=0
mouse: address=3 iface=0 pos: x=550 y=-64 delta: dx=1 dy=0 wheel=0
disconnected: device: address=6 portId=0x11 vid=192f pid=0416 class=0x00(per-interface) speed=low-speed product="USB Optical Mouse"
mouse: address=7 iface=0 pos: x=637 y=110 delta: dx=0 dy=1 wheel=0
mouse: address=7 iface=0 pos: x=638 y=110 delta: dx=1 dy=0 wheel=0
disconnected: device: address=7 portId=0x12 vid=045e pid=00a4 class=0x00(per-interface) speed=low-speed product="Microsoft(R) Compact Optical Mouse"

```

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/0/5/8/05874b7acc6a440bbeebde2dddf5876066b09da6.jpeg)

---

<div class="post-metadata">

**Author:** ![time\_document\_3108](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/time_document_3108/32/1245996_2.png) [@time\_document\_3108](https://forum.arduino.cc/u/time_document_3108)\
**Post date:** [July 18, 2026, 11:02pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/7 "2026-07-18T23:02:59Z")

</div>

> [@horace](#):
>
> I doubt if a UNO or Mega would support two USB OTG Host devices

why wouldn't they?

it's all in how one parses the data coming in the USB

that's why I linked the document that shows the whos and whats of the USB world

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [July 19, 2026, 5:23am UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/8 "2026-07-19T05:23:46Z")

</div>

I should have said  
_I doubt if a UNO or Mega would support two USB OTG Host devices concurrently_  
the answer is to experiment  
try connecting two USB HID devices to a UNO/Mega and USB Host shield and see if it works

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [July 19, 2026, 10:46pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/9 "2026-07-19T22:46:11Z")

</div>

You may be able to do it on the UNO, consider an external serial module connected to a TTL to USB adapter. This is a desperation suggestion, not a solution. Your data throughput will also be limited.

A Mega would be a better choice as it has a total of 4 hardware serial ports. Using one of those along with a USB to TTL converter should work.

Since you did not specify the application or data rates this may not work, Regardless you will be data rate limited. Your software will also have a big impact on your throughput.

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [July 19, 2026, 11:38pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/10 "2026-07-19T23:38:03Z")

</div>

A LONG time ago, I played some with some of the USB Host shields. Some of them were more reliable than others. One of them I tried was either this one or a previous generation one by Sparkfun  
[SparkFun USB-C Host Shield - SparkFun Electronics](https://www.sparkfun.com/sparkfun-usb-c-host-shield.html)

There are also several of them available from [Amazon.com](http://Amazon.com), like:

[Amazon.com: HiLetgo USB Host Shield for Arduino UNO Support Google Android ADK USB HUB : Electronics](https://www.amazon.com/HiLetgo-Shield-Arduino-Support-Android/dp/B01MTU9OLM/)

I had a couple of cheap ones that I had difficulty making them work, but some of them are probably fine.

I was using the library:  
[felis/USB\_Host\_Shield\_2.0: Revision 2.0 of USB Host Library for Arduino.](https://github.com/felis/USB_Host_Shield_2.0)

The main times I played with this was to compare things between this and the USB Host library and support for the Teensy 3.6 and 4.x.  
If you look at the Teensy 4.1 product page, you will see where there are pins setup for USB Host:  
[Teensy® 4.1](https://www.pjrc.com/store/teensy41.html)  
using the host cable:  
[PJRC Store](https://www.pjrc.com/store/cable_usb_host_t36.html)  
Note: PJRC stuff (Teensy) is now sold by Sparkfun.

Back to the USB Shield and library. The library support multiple USB devices, which will require a USB Hub. In the library I mentioned, there is an example for a mouse and keyboard:  
[USB\_Host\_Shield\_2.0/examples/HID/USBHIDBootKbdAndMouse/USBHIDBootKbdAndMouse.ino at master · felis/USB\_Host\_Shield\_2.0](https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/HID/USBHIDBootKbdAndMouse/USBHIDBootKbdAndMouse.ino)

Note: I don't know the current state of this library. At one point I believe there were some that were working on a new version of the USB Host Shield library code, but I have not followed it, so no idea if it now exists or the state of it.

Hope that helps.  
Kurt

---

<div class="post-metadata">

**Author:** ![rva1945arduino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/rva1945arduino/32/1277974_2.png) [@rva1945arduino](https://forum.arduino.cc/u/rva1945arduino)\
**Post date:** [July 21, 2026, 1:05pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/11 "2026-07-21T13:05:55Z")

</div>

So far I just want to see it working with just one joystick. I'm using the Mega and a Host Usb Adk Shield. I noticed that if the shield is installed, I can't upload any sketch, an error message appears:  
Error: timeout  
Error: timeout  
Error: timeout  
Error: timeout  
Error: timeout  
Error: timeout  
Error: timeout communicating with programmer  
Error: stk500v2\_getsync() failed; try -x delay=n with some n in [-80, 100]  
Error: unable to open port COM10 for programmer wiring  
Error: unable to open port COM10 for programmer wiring

so I upload a sketch that I asked to GPT to monitor the output, and then install the shield, but no output. Is there any valid sketch that works? I need to see the output while moving the axis.

---

<div class="post-metadata">

**Author:** ![rva1945arduino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/rva1945arduino/32/1277974_2.png) [@rva1945arduino](https://forum.arduino.cc/u/rva1945arduino)\
**Post date:** [July 21, 2026, 1:17pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/12 "2026-07-21T13:17:03Z")

</div>

I guess I have to power the USB device because I connected the rudder pedals that have a LED and it doesn't turn on.

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [July 22, 2026, 8:40pm UTC](https://forum.arduino.cc/t/i-need-to-read-two-usb-devices/1452393/13 "2026-07-22T20:40:11Z")

</div>

USB devices (keyboard, mouse, etc) need 5V power  
e.g. the ESP32-S3-DevKitC-1 has a link on the back of the PCB which enables the USB power to a device  
The USB Host shield must have some means of providing 5V to a USB device  
do you have a manual or a schematic for the USB Host shield?
