Password Bot?

I’m going to keep this short and cut to the chase- Does anyone know if it would be possible to wire digital pins to a male USB connector, plug it into a computer, and send keystrokes to the computer when I press a button? I’d love to be able to get to my computer’s login screen and just press a button rather than CTRL-ALT-DELETE’ing and entering a password.
Derp!

You didn’t mention which Arduino you have, but it should be simple on the Leonardo, since it drops having the secondary processor for USB communication, and can appear to the computer as a USB keyboard, USB mouse, or serial port. http://arduino.cc/en/Reference/MouseKeyboard.

The Due has a secondary USB port that can be used as a keyboard.

For the Uno and Mega, I believe you can use a USB host shield to emulate a keyboard. Here is one such USB shield: https://www.sparkfun.com/products/9947?. Obviously, if a shield exists, you could replicate the important bits as stand alone components, but the shield can be more convenient than doing it yourself.

You'd need to use a USB driver rather than just wire the pins up as you suggest, but people have programmed Arduinos to emulate a keyboard and that seems to be what you're asking for here. (Personally I would think that hitting a few keys on a physical keyboard would be easier than plugging in a USB stick, and I wonder how many times you can plug things into a USB port before you wear the contacts out, but those are separate issues.)

MichaelMeissner: For the Uno and Mega, I believe you can use a USB host shield to emulate a keyboard.

A USB host shield is only required if you want to plug USB devices such as keyboards into the Arduino.

Sorry, I forgot to mention I have the Uno Rev. 3. :sweat_smile:

PeterH: You'd need to use a USB driver rather than just wire the pins up as you suggest, but people have programmed Arduinos to emulate a keyboard and that seems to be what you're asking for here. (Personally I would think that hitting a few keys on a physical keyboard would be easier than plugging in a USB stick, and I wonder how many times you can plug things into a USB port before you wear the contacts out, but those are separate issues.)

I think Nick Gammon mentioned he has a Leonardo plugged to his computer in addition to the regular keyboard, and he has 10 or so buttons, that when he presses a button, it enters in a standard amount of text for one of the newbie questions he frequently answers, such as how to get the lowest power Arduino and make the batteries last longer.

I just found this: http://mitchtech.net/arduino-usb-hid-keyboard/