Is it possible to use arduino uno r3 as USB keylogger by connecting the usb male pin to CPU and keybord cable to female USB pin of arduino. So that the keystrokes are stored in EEPROM. Without using an external storage modules or other components?

I am new to arduino, even suggestions are appreciated.

Thanks in advance.Somthing like this

  • It might help if you explained what you are trying to do. Are you trying to capture passwords? Repeat tests? Nov 7, 2016 at 12:34
  • Yes it possible to to implement USB host in software but you need a few extra components, which are a few resistors and a USB socket. What youre trying to do is make arduino a USB host for keyboard-some folks have nearly done this. I give a link be low. to a USB host implemented in software for ATMEGA32 I see the source code is there-which you may try and modify for your uses–they give a driver for mouse-and say the keyboard host (youre interested in) is is possible and easy (but not done). ATMEGA32 is similar to AMTMEGA 8 (used in older arduino). Nov 7, 2016 at 15:13
  • Only a few componenets are used in the solution there-and its cheapers than a USB host shield-the software is there as a zip file -this is a suggestion for starting point-you need to modify software for you own use- see courses.cit.cornell.edu/ee476/FinalProjects/s2007/… Nov 7, 2016 at 15:14
  • But for emjulating a keyboard on arduino-there's different ways to do it on arduino-it been done Nov 7, 2016 at 15:20
  • Of course if you can manage to do the above you would have good bragging rights-becuase no one made a cheap USB host (for keyboard) for arduino/arduino library -instead most people use USB host shield (costing about ten dollars or more)-it would save money of course. Its not as difficult as it looks. Nov 7, 2016 at 15:23

3 Answers 3


USB-host is hard if not impossible to implement on an UNO.

Though I believe most USB keyboards support PS2 as well (normally done with a USB-to-PS2 plug). So you should be able to talk to the keyboard using the PS2 protocol, which is a lot easier. There are libraries to do this for you.

Next you could use V-USB to emulate a keyboard to the PC. For that USB connection you need to add some resistors and zener diodes, to stay withing the usb specification. This is all explained on the V-USB website.

Using a different Arduino that has real USB support might be a better option. Also the UNO is rather large, so not that easy to hide.


It is highly unlikely using an arduino uno r3.

USB Device: (To emulate a HID (Human Interface Device) Keyboard):

While there are Arduino libraries for emulating a keyboard, these will not work with the Uno R3. Instead, to make a Uno R3 act like a USB Keyboard Device, you need to reprogram the 2nd processor on the board and switch it from a USB Serial Device to a USB Keyboard Device. This is talked about in this stackexchange question.

USB Host (to talk to a USB Keyboard):

I do not believe there are any software solutions for emulating a USB Host on most Arduinos. Certainly not a Uno R3. A USB Host is a very complex software & hardware device. Instead, most Arduino projects use a USB Host Shield for this purpose.

  • Down voting with out a comment is not that unusual. However, it does make it difficult to improve the answer. Why do you think some of these answers are not correct?
    – st2000
    Nov 14, 2016 at 5:50

No, it's not. Or not with any degree of ease. The best you could hope for would be to intercept the USB data and try and decode it, but that really is beyond the ability of a lowly Arduino.

I have thousands of dollars worth of equipment aimed at doing that kind of thing - it's not a simple task.

  • Then is there any possibility to do this?
    – Ganesh
    Nov 7, 2016 at 11:14
  • If you use some device that can sample a signal in the high tens of megahertz (which an Arduino has no hope of doing) then you may be able to capture a waveform and decode it. Not with an Arduino though.
    – Majenko
    Nov 7, 2016 at 11:16
  • What are those device which can sample the signal. can you name them
    – Ganesh
    Nov 7, 2016 at 11:18
  • Microcontrollers that run in the hundreds of megahertz. FPGAs. CPLDs (maybe). I use a TotalPhase Beagle 480.
    – Majenko
    Nov 7, 2016 at 11:19

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.