0

I'm trying to use V-USB library to emulate a keyboard using Arduino Nano but because of precaution, I don't want to use it's built-in USB port.

My idea is to add another USB port so I cant power my device with the new USB port and use free digital pins as input/output of the new USB serial port in V-USB project.

What circuit I should use and how to add extra USB port to Arduino Nano.

asked Dec 16, 2016 at 11:50
3
  • By far the easiest way would be to buy a second Nano and connect the two together. Commented Dec 16, 2016 at 11:54
  • @Andrew of course it's easiest way but I care about the cost of the project! Commented Dec 16, 2016 at 11:54
  • 1
    The circuit diagram for connecting V-USB read.pudn.com/downloads194/sourcecode/embed/911688/… Commented Dec 16, 2016 at 13:57

2 Answers 2

4

USB is deceptively simple. The underlying protocol is very complex. So a complete answer to your question requires some USB background.

USB is divided into 2 types. USB Hosts and USB Devices. We are not concerned about USB Hosts here. USB Devices only need to know about their own functions / features. If they are a serial port device, like the FTDI chip on the Arduino Nano, they only need to "speak" basic USB protocol and the serial CDC USB protocol. If the USB Device was a keyboard, it only needs to know the basic USB protocol and the HID USB protocol.

In order to offer up a USB port the Arduino Nano uses an FTDI chip FT232RL. This chip supports a Serial Port USB Device. It does not appear to support HID USB Devices. So your decision to use V-USB is necessary not because of power but because the Arduino Nano's built in USB port supports a protocol other than USB CDC.

What circuit I should use and how to add extra USB port to Arduino Nano.

The circuit suggested is on the V-USB web page appears to contain the necessary information:

enter image description here

Of course you will have to do some research into V-USB software to see which are the appropriate pins to use on your Arduino Nano.

answered Dec 16, 2016 at 13:32
4
  • The OP wants to use V-USB! Commented Dec 16, 2016 at 13:57
  • I see what you mean. I'll edit my answer. Thanks. Commented Dec 16, 2016 at 14:29
  • Since Arduino Nano have internal oscillator, can I setup only left side of the circuit? Commented Dec 17, 2016 at 13:41
  • My understanding is that USB is very picky about frequency. Perhaps this is the reason that the V-USB web page included the external crystal. However, the V-USB web page does say: "Can be clocked with 12 MHz, 15 MHz, 16 MHz 18 MHz or 20 MHz crystal or from a 12.8 MHz or 16.5 MHz internal RC oscillator.". Commented Dec 17, 2016 at 14:29
1

You can use a USB host mini module for the Arduino NANO and the USB Host Library r2.0 enter image description here

You can implement a keyboard with this...

answered Dec 21, 2016 at 16:13

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.