Using digital pins on Nano as a USB port for HID device

I'm wanting to make a small rubber ducky with an Arduino Nano. From what I've read, it's not possible to make this from the built in USB port. I was able to achieve this with my Uno using this.
Is it possible to use two digital pins of the Nano as the D+ and D- pins in a USB port?

What is the reason you can't use another board that supports HID, like the Pro Micro? There do exist libraries to emulate USB on a 328 type AVR, but the software integration with HID libraries is not going to be easy.

A 32u4 mini would do the job nicely.

That is what a Pro Micro is. The Keyboard library has a list of compatible hardware.

With all the pro mini, micro, and nano boards out there I find it easier to specify the processor. I see that you are absolutely correct though.

That one is confusing. You could say it about Every Nano, too. :slight_smile: "it won't run on my Nano" sound familiar? 30 posts later we find out it's an Every.

1 Like

I'd like to use the hardware I already have without buying any more. I also don't want to use the built in USB port for hid communication. I want to leave it for serial communication

Since the time of the first replies, what have you found out? I guess you realize you would have to use the existing HID library or another one (if there even is one). So looking there would give you a very good idea whether it could be supported without any hardware USB port.

Unless, you want to write your own from scratch...

Have you searched for a library to do the bit-banged USB port? Or, will you write that from scratch as well?

V-USB implements a bit banged connection on arbitrary I/O pins (ATmega and ATtiny), but it is very limited.

Not with that firmware. It runs on the 16u2 processor that the Arduino UNO uses for a USB-to-Serial chip. The Nano uses a dedicated USB-to-Serial chip which can't be re-programmed.

I think your only hope is the V-USB library mentioned above by @jremington.

What exactly is the purpose of this "rubber ducky" ?

What will it do when plugged into a USB port ?

https://github.com/hak5darren/USB-Rubber-Ducky

      _      _      _      USB       _      _      _
   __(.)< __(.)> __(.)=   Rubber   >(.)__ <(.)__ =(.)__
   \___)  \___)  \___)    Ducky!    (___/  (___/  (___/ 

The USB Rubber Ducky is a Human Interface Device programmable with a simple scripting language allowing penetration testers to quickly and easily craft and deploy security auditing payloads that mimic human keyboard input. The source is written in C and requires the AVR Studio 5 IDE from atmel.com/avrstudio. Hardware is commercially available at hakshop.com. Tools and payloads can be found at usbrubberducky.com. Quack!

Or, of course, allowing bad guys to quickly and easily craft and deploy malicious software

Bad guys will never think of using this firmware for nefarious purposes.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.