Arduino Nano as HID

Hii there,

I recently found a Arduino Nano laying around on my shelf, and I wanted to do a project with it. My idea was to turn it into a little keypad thing. (Where people normally would use a Teensy) So I snatched up a few switches from my parts bin. I have 1 switch added to the thing for now (GND -> Switch -> D2). However, I do not know how to continue...

I just want to add like 8 buttons or so (up,down,left,right,x,c,COMMA,PERIOD) so I can take a little keypad pad for Stepmania with me in my pocket.

However, when I look on using an Arduino Nano as HID I get 0 usable results. all of them talk about other Arduinos and the Serial monitor.

I thought, maybe somebody here can help me.

Is it possible at all? or should I search for a different project to use this Arduino with?

Cheers.

For the ignorant, what is HID and Stepmania?

Weedpharma

You can use the old UsbKeyboard.h and the nano but you will need IDE 1.0.6 to compile. You'll need to purchase the V-USB 3.6V zeners and required resistors.

|500x375

I have several pixs of various USB_VUSB adapters for Arduino. http://forum.arduino.cc/index.php?topic=195003.0

And http://forum.arduino.cc/index.php?topic=135623.0

General overview here: https://www.hackster.io/rayburne/arduino-to-excel-using-v-usb-cbf701

Ray

HID is just Human Interface Device, that's been in use in the forum for a long time.

Stepmania, I have no idea.

Hello i have made a keyboard using a pro mini was actually the hardest thing i made.

here is a image

I think if i remember correctly i watched This video and a few others to make mine too a while hope this helps.

weedpharma:
For the ignorant, what is HID and Stepmania?

Weedpharma

HID is Human Interface Device like CrossRoads told you.
Stepmania is a game like Dance Dance Revolution :slight_smile: (but mainly aimed at keyboards, although it’s played with those dance mats as well)

mrburnette:
You can use the old UsbKeyboard.h and the nano but you will need IDE 1.0.6 to compile. You’ll need to purchase the V-USB 3.6V zeners and required resistors.

I have several pixs of various USB_VUSB adapters for Arduino.
http://forum.arduino.cc/index.php?topic=195003.0

And
http://forum.arduino.cc/index.php?topic=135623.0

General overview here:
https://www.hackster.io/rayburne/arduino-to-excel-using-v-usb-cbf701

Ray

So basically, I need an old version of the IDE to do this?
and this V-USB is some kind of adapter that I can hook up between the Nano and the PC so that I can use it as HID?
Can’t the nano do it by itself though the USB cable?

josephchrzempiec:
Hello i have made a keyboard using a pro mini was actually the hardest thing i made.

here is a image

I think if i remember correctly i watched This video and a few others to make mine too a while hope this helps.

Hmm… it seems interesting I will try this out in a moment.

On mine i use D2 and D4 for the USB connection. there are a few resistors and diodes needed. I followed the video to do the same way on mine when i made my keyboard.

Ah okay.

I have started on some basics, but I’m stuck… already.

I got this code:

#include "UsbKeyboard.h"
int ledPin = 13;
boolean hasRun = false;

void setup(){
   pinMode (ledPin, OUTPUT);
   TIMSK0&=!(1<<TOIE0);
   cli();
   usbDeviceDisconnect();
   delayMs(250);
   usbDeviceConnect();
   sei();
}

void loop(){
   UsbKeyboard.update();
   if(hasRun == false){
     UsbKeyboard.sendKeyStroke(KEY_E);
     hasRun = true;
   }
   delay(1000);
}

void delayMs(unsigned int ms){
  for (int i = 0; i < ms; i++) {
    delayMicroseconds(1000);
  }
}

But all what hapens right now is that the 3 LEDs on the nano board light op, stay solid, and no keyboard input is send at all. (it should send “E”).

Is my code wrong or?

Are you using a FTDI to be the USB If that is the case it won't work.

YOu have to follow the wiring setup as in the video to make it the Arduino will be the USB no FTDI on it.

No, I use the USB port on the Nano. But I guess I can't do it like that... bummer...

I will look for another nice project for the Arduino then (if I can't use the build-in USB thing). Because I want to put it in my pocket (I have quite big pockets) without having extra shield attached to it that make it more bulky than it has to be.

the nano has a FTDI can't use that. There are 2 ways of making a keyboard from a arduino one is to simulate a keyboard, that You will be a Leonardo it doesn't have a FTDI attached to it like a nano or two to make a True Keyboard leave the nano unplugged and follow a wiring and sketch that is in the video to make a True HID keyboard. the keyboard on your PC that is attached to your PC is a HID keyboard. Human interface device. What that means is a middle man between you and your PC.

The FTDI will not work as a HID device. Bottom of your nano there is Either a FTDI chip or a CH340 CHIP both do the same things and they will not work as a HID device.

Hmm... yea, then I will just look for another fun project for my micro (as I don't have the money right now to order stuff like breadboards, diodes etc.

Thanks for the help anyways.

Do you have a Arduino Leonardo?

If you did you can follow This video it is much easy to do.

only an Uno and a Nano :\

Wait a minute before you do that Take a look at this video this might be a better way. Click here

He uses a (I think) Leonardo, so his code and setup is the same as the setups I've tried already :C