Git Product home page Git Product logo

hid-relay's Introduction

HID-Relay

Make wired USB devices Bluetooth-enabled.

Arduino project to pipe USB HID reports from a USB Host Shield out through a Bluetooth HID module.

Requirements

Arduino Pro Mini (3.3V version)

USB Host Shield mini

Bluetooth HID module with UART: RN-42 or a firmware converted HC-05/HC-06

Conversion Instructions Parallel Programmer OR USB FT232RL Programmer (<-preferred)

Software Setup

You need the Arduino/Genuino IDE (I used 1.6.8) and the latest release of the USB Host Shield 2.0 library. Be sure to get the library from github as the one pulled via the Arduino IDE's library downloader seemed to be out of date.

Hardware Setup

Powering the project

The Arduino, Bluetooth module (check your specs, some HC-05, and HC-06 may come on a breakout board expecting 5V), and USB Host shield all run off of 3.3V, but devices you want to plug into the USB connecter will be expecting 5V. To deal with this you'll want to supply the Arduino 5V via the RAW pin (it's regulator will then supply 3.3V to VCC feeding the Host Shield and Bluetooth module). Then route a wire from this 5V source to the Host Shield's power bus. A Bus power trace must also be cut on the Host Shield to prevent this 5V from damaging the 3.3V components there.

More detailed information here: https://www.circuitsathome.com/usb-host-shield-hardware-manual

Assembly

The Arduino/Shield can be soldered together with either on top, but I prefer the Arduino up to maintain access to the reset button and pin assignment silkscreen. It's also a bit more compact as the Pro Mini will sit within the height of the Host Shield's usb connector.

I recommend against permanently soldering the bluetooth module into this project, or at least connecting it's power via a jumper or wire disconnect of some kind. Your programmer will be flashing the arduino on the same Rx/Tx pins your bluetooth module is listening on. Uploading a sketch is bound to fail if you can't cut the bluetooth power.

My solution here was to mount the ProMini/HostShield sandwich onto some perf board with female headers on either side. The bluetooth module got glued to a perfboard "shield" with male headers which was easy to plug in and out of the base.

N-Key Rollover?

This project so far only seems to allow up to 6 simultaneous key-presses (minus modifier keys like ctrl,alt, etc, which are handled seperately). I'm not sure yet if this is a limitation of my particular keyboards reporting, or the host shield library possibly truncating reports. More research is needed.

Additional Considerations

Currently I have tested just a few HID keyboards and mice with this project. All keyboards so far have all worked whether plain wired keyboards or with proprietary wireless dongles (Logitech unified recievers, and others), but mice have been inconsistent. One of my older logitech keyboard/mouse combo seemed to work perfectly with it's unifying reciever, while most other mice I've tried either failed to work altogether or present very drawn out or delayed cursor movements. This might be a speed limitation of the bluetooth module not being able to keep up with some of the faster mice's throughput. More research is needed.

hid-relay's People

Contributors

juancgarcia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hid-relay's Issues

Delays and multiple keystrokes

Hi,

I finished building my keyboard by following your tutorial. I used a custom build GH60 mechanical keyboard for the project. GH60 has several layers and can act as a mouse too, so I don't know whether it's recognized as a combo device?

The relay works fine on Android and iOS (I haven't tested it on a macOS). The problem occurs when using the keyboard with windows. The pairing process does not have any problems and connects as it's supposed to. But when start typing the is a noticeable lag and register several key inputs for a single stroke. Like for "asdfg" it types "asddddddddffffffffffffffffgggggggggggg" with a huge lag.

As you know I have added some modification to the build.
-> Soft latch switch for turning ON/OFF
-> Auto shutdown timmer
-> RGB LED as an indicator

I was unable to find any bugs which could cause that. Any ideas?

Modified code
Soft latch power switch Schematic.pdf

Suggestion: Use SoftwareSerial

It appears you're using the same serial pins as the ones that are used to flash the arduino.

why not use SoftwareSerial, which allows you to simulate serial ports on different pins?

I just stumbled on your project, and it is currently late, but I will submit a pull request soon™ to do that.

status indicators (Num, Caps)

I noticed that while pressing NumLock it changes actually switches the status, but keyboard LED is not showing this.
Interestingly with the USBHIDBootKbd.ino Indicators work fine ( without switching it the status on the connected device)
I was trying to compere this code to Code here to USBHIDBootKbd (part of USB 2.0 shiled library, and could not isolate the difference.
Do you have any ideas on how to fix this ?
(Thanks a lot for the code and the effort!)

USB HID directly to BT

Hello.
I am not into hardwares and arduino stuff, but I was really interested by the video you made on youtube about HID Relay.
I am currently looking for a way to transmit USB HID reports (signals) directly to the PC, so there is minimal latency created.
I have found that USB HID signals and Bluetooth HID signals are almost identical, so I am wondering if directly feeding the signal to the pc via bluetooth be done.
If it cannot be done using bluetooth, I would like to build a simple dongle instead of bluetooth, so the signal will go like:

PC---Dongle---RF Signal---Transceiver---USB Device.

So, it's basically a wireless USB cable.
Are you interested in this project? I think this might help your channel

Delays and random lags

Hi,

Thanks a lot for a detailed explanation of how to wire it up, great work!

I have assembled it slightly differently, since I am using this RN-42 from Sparkfun, instead of HC-05.
https://www.sparkfun.com/products/12576

I have this keyboard: https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=1564

My idea is to fit the whole thing inside the keyboard, so instead of soldering HC-05 on top of the board, it attaches directly to FTDI pins, which makes it USB port height.

At the moment it is still outside, and I am powering it from the power supply, 5V.

Bluetooth keyboard is discoverable on my Mac, and I can type without any noticeable delays. But if I press and hold a key, sometimes it works, sometimes it stops after 5-10 characters, randomly, as I type it misses some characters.

Have you noticed something like that? I heard something about fast data mode for RN-42, but I am not sure what is the root cause here.

Powering Keyboard externally?

I know this isn't an issue with the project, but I don't know where else to ask.
I am a beginner in the whole arduino scene and decided to use this project to do my first steps.
Currently, I have the problem that my mechanical keyboard won't work with this. Cheap 5$ Keyboards work, but not my mechanical.
I suspect it is insufficient power to the keyboard, but I have no way to find out.
Does anyone know, if it is possible to power the keyboard externally from a 5V source?

Request for help implementing HID protocol in BrailleTouch project

Hello,

I hope this message finds you well. I am reaching out to you because I am working on an open-source project called BrailleTouch. Our goal is to create affordable Braille displays for blind and deaf-blind individuals.

We are currently stuck and unable to get the HID Braille to receive information from the screen reader and continue programming. As someone with experience in this area, your expertise could be of great help to our project.

I believe that an open-source Braille display could be incredibly useful and have many benefits for those who are blind and deaf-blind. Your knowledge of the HID protocol could be particularly helpful in implementing the protocol in our Braille display.

Please take a moment to review our project on GitHub at https://github.com/brailletouch. If you're interested in helping, please let me know.

Thank you for your time and consideration. I look forward to hearing back from you.

Best regards,

Cergio Monasterio

Can't run with Leopold KB (FC750R)

Did everything right, tested with other keyboards (cheap Logitech \ Metoo Zero from Aliexpress), but cant realy figured out why it doesnt work with my Leopold kb...
Maybe someone tested this project with other high-end keyboards?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.