I have a USB HUB and have connected to it a USB keyboard and a USB mouse. As long I have not connected a Notebook to it those devices don't turn on. 5V is always turned on! So I could charge my phone. How do they know there is no notebook connected? My Arduino is always on. I want to emulate this with an Arduino. Without the need of extra software on a notebook, the Arduino should be able to tell if a notebook is connected to the USB Hub or not. Please help.

  • 2
    On the Nano, the FT232RL chip does the USB communication. This chip has a PWREN option. When you configure the chip for this, the selected pin will be HIGH if there is no USB host. You could carefully solder a wire from the selected pin (CBUS0-4) to one of the Arduino pins, so the ATMega328 can read it out.
    – Gerben
    Mar 7, 2019 at 16:09
  • just monitor the current of the hub, it will increase a lot if everything turns on.
    – dandavis
    Mar 7, 2019 at 17:53
  • I want to understand how a cheap USB mouse is doing it, and do the same thing with an arduino. Mar 7, 2019 at 19:57
  • those devices don't turn on .... how do you know? .... you have no way to test that
    – jsotola
    Mar 8, 2019 at 0:48
  • Sure! The usb mouse does not light up (the red laser beneath) and on the keyboard you can not get any lights to light up (for example the numpad light) Mar 8, 2019 at 5:43

1 Answer 1


With Arduino Nano, you don't have control over the USB, because it is handled by the USB-to-TTL-Serial chip on the board. The MCU is to this adapter connected only with RX and TX of the Serial interface.

With Arduino Micro you could retrieve the state of the USB connection, because he MCU ATmega32u4 has a build in USB support an handles the USB connection from application (sketch).

  • So the digispark would work, too? Mar 7, 2019 at 19:56
  • ATtiny doesn't have native USB but Digispark has circuit for V-USB (software USB)
    – Juraj
    Mar 7, 2019 at 20:41
  • @Alexander_Projects, did the answer help?
    – Juraj
    Mar 21, 2019 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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