Close
0%
0%

Ergonomic handheld mouse / keyboard alternative

A wireless input alternative that's actually ergonomic!

Similar projects worth following
AlterErgo is an open-source handheld Bluetooth controller that actually strengthens your fingers, instead of potentially causing Carpal Tunnel Syndrome or other RSI issues.

Start with a $5 finger strengthening device for guitarists designed to reduce RSI. Add electronics to measure how much you've squeezed each finger, and measure the orientation you're holding the device, and based on those signals, transmit virtual mouse or keyboard commands wirelessly over Bluetooth Low Energy to a computer (any modern Windows, Mac, Linux, Android or iOS device). You could use it to control a Smart TV / HTPC / Kodi media player from your couch, or to lazily scroll web pages up & down and surf the web from your bed, or use it just to give your hand an occasional break from your regular ergonomic mouse or trackpad.

Most "ergonomic" computer mice, keyboards and trackpads just harm you less than standard models. But this device can potentially heal you! (slowly)

I've tried using many alternative computer interfaces to control computers, robots or games in the past, such as:

All of these devices work well for some specific uses, but either they still cause RSI health problems, or they have difficulty performing a common operation such as mouse clicks, scrolling or selecting items. For example, eye and head trackers can move the mouse cursor quite easily, but when you want to actually click on something or scroll a webpage down, you typically need to stop and hover to a special location for 5 seconds (to select a left or right mouse-click) and then hover over the desired click location.

So I found a finger-strengthening aid (designed to reduce RSI for guitarists and pianists) and I hacked it to easily perform some of these common operations such as mouse clicking, mouse scrolling, or pressing common keys. It can be used by itself (such as from your couch) or in combination with a head tracker or eye gaze tracker.

By combining 4 analog finger inputs, a 3D accelerometer a 3D gyroscope, and a pushbutton, there Are quite a lot of different ways you could use this device! And since it uses Bluetooth BLE, even without installing custom software it can wirelessly control any modern PC (Windows, Mac, andLinux), mobile (Android and iOS), including some smart TVs and TV media players!

The finished device can be used in either your left or right hand, or you can build 2 of them such as to perform key input with your left hand and mouse input with your right hand! The 400mAh battery lasts roughly 10 hours of continuous use, so you might need to recharge it with a micro-USB cable every few days or weeks, depending on your usage.

Building and customizing it yourself:

If you want to make one of these devices yourself, follow the Build Instructions below. It requires SMD soldering, ordering parts from various locations, and programming a microcontroller using mbed (a free online compiler). So I'd estimate it typically needs 1 or 2 whole weekends to build it all, and costs around USD$50 in parts. The mouse & keyboard behaviour is highly customizable even if you don't know how to program in C/C++, such as to send Spacebar instead of Backspace. But if you want it to combine finger position with device motion or orientation such as to send Spacebar when you squeeze finger 1 and the board is upright, or send Backspace when you squeeze finger 1 while the board is upside-down, then you'll need to understand C/C++ code. It should also be fairly easy to use this device as a wireless joystick for PC gaming, using the BLE HID Joystick service, but I haven't tested it. You could also add a push-button input to this device fairly easily, since the Tiny BLE already has a small push-button that you can re-purpose if you wanted an extra push-button in addition to the 4 fingers and motion sensors.

Notice that my device doesn't have any physical cover....

Read more »

View all 9 components

  • Video demo

    Shervin Emami08/27/2018 at 12:54 0 comments

    I posted a video showing the basics of how to use it as a simple wireless keyboard, including pairing it in Windows 10 and testing the pressed keys:

  • Magnetic sensor is out of stock at most suppliers!

    Shervin Emami08/27/2018 at 11:39 0 comments

    I was going to order parts to build a 2nd device, so I can have a keyboard in my left hand (Spacebar, Enter, Escape and Backspace), and a mouse in my right hand (Left-click, Right-click, Wheel scroll up, Wheel scroll down).

    But it looks like the DRV5053VAQDBZR magnetic sensor that I used is currently out of stock at Digikey, Mouse, Farnell / Element14 and various other distributors! It looks like they won't be back in stock for a few months. Luckily the manufacturer Texas Instruments in USA still has several thousand left in stock, and TI is willing to sell them in packs of 5 sensors for $4.80 with free shipping to various countries.

    So if you are having trouble finding these specific magnetic sensors, try

    https://store.ti.com/DRV5053VAQDBZRQ1.aspx

    If TI stops producing this sensor one day, there are a few other magnetic sensors with similar sensitivity that should work OK as a replacement.

  • Other uses for this device

    Shervin Emami08/26/2018 at 21:27 0 comments

    After posting this project on the web I've had a few questions about other use cases for this device:

    Can it be used as a VR controller?

    Not really because it only has a 6-DOF IMU, and for a VR controller you would want either a 9-DOF IMU (with a quaternion-based Kalman filter or similar) to sense the position or a different position detection sensor. If you added this to the board yourself then I think it actually would be a good VR input device, since it gives you multiple keys and/or analog inputs.

    Can it be used as a basic chording keyboard?

    Yes, it would be very easy to use it as a 4-key chording input. Just modify the lines at the bottom of main.cpp to processing multiple variables such as:

    if ( (fing1 > FINGER1_PRESS && !press_keyup[1])
      && (fing2 > FINGER2_PRESS && !press_keyup[2]) ) {

    I personally haven't used chording keyboards so I haven't implemented it, but there's no reason for it not to work.

    Can it be used to control a quadcopter drone?

    Yes potentially, either by using the analog finger positions or the analog motion inputs. But since the code is configured to send BLE keyboard or mouse inputs, you would need to do some work for it function as a drone controller, unless if you find a drone that already takes BLE keyboard or mouse or joystick inputs (I'm not sure if that exists?). Using it as HID Joystick to control a drone flight simulator on a PC would be a relatively easy option.

  • BLE keyboard works! BLE mouse works!

    Shervin Emami08/26/2018 at 10:01 0 comments

    The hardware in Tiny BLE is capable of being a BLE keyboard and mouse, but unfortunately they don't provide source code for this right out of the box. There is a demo project for Tiny BLE using the mbed online compiler (https://github.com/Seeed-Studio/Tiny_BLE), and I also found sample code of a BLE keyboard and of a BLE mouse using mbed (https://github.com/jpbrucker/BLE_HID), but they aren't designed specifically for Tiny BLE. So they need to be merged together.

    Unfortunately I didn't find good sample code that allows a single Bluetooth BLE device to behave as both a keyboard and mouse at the same time. The only code I did find that is capable of both at the same time was some code on a forum at https://community.cypress.com/thread/11130 that uses theCypress PSoC Creator graphical tool, and therefore the generated code is quite large and tricky to understand.

    So my device will act as either a keyboard or a mouse, but not both at the same time.

    Anyway, after a bunch of trial & error (is it just me or is Bluetooth extremely unreliable?!), I got it to work as a keyboard, and then with a code rebuild, as a mouse! I used the free mbed OS and online compiler, because BLE apparently doesn't easily fit into the restricted flash size that free versions of compilers such as Keil and IAR support.

  • I broke my battery connector!

    Shervin Emami08/26/2018 at 09:41 0 comments

    While building this project, I accidentally dropped my device and the battery connector came off!

    I tried to solder it back on but it wouldn't work anymore :-(
    I've ordered a new Tiny BLE, but for now I'm using the other battery socket on the Tiny BLE. Everything still works, but I have to charge my LiPo using a separate LiPo battery charger.

  • Testing the magnetic distance

    Shervin Emami08/26/2018 at 03:11 0 comments

    I received my low, mid and high sensitivity magnetic sensors, and my low, mid and high strength magnets, to cover a very wide range of magnetic sensitivity. A whole smorgasbord of magnets and magnetic sensors!

    (Notice the 4 different tiny magnets on the bottom of the photo)

    First I grabbed the most sensitive magnetic sensor, and soldered it onto a random SMD prototyping board, and tested if I could detect the metal pole that is already part of the exerciser. Unfortunately the pole wasn't magnetic at all, so I knew I'd need to glue an actual magnet to the end of the metal pole instead.

    So then I did a quick test of a random magnet and a random sensor, and I could definitely detect that! I tried various combinations, and found that if I use a high strength magnet or a highly sensitive sensor, then unfortunately each finger effects multiple sensors. Or if I use a weak magnet or a weak sensor, there isn't any interference between fingers but I can't detect the whole range of movement, meaning I'd have to squeeze to the end before it gets detected. But if I use just the right amount of magnetic strength and sensitivity, it works perfectly! Detection of the full motion range and with interference between fingers! The best results were by using this combination:

    After I knew which magnet and which sensor to use, it was time to actually install one into each finger of the exerciser!

  • Can I measure the finger movement?

    Shervin Emami08/26/2018 at 02:22 0 comments

    I occasionally play guitar, and when I'm not on the guitar I'm probably eating or on a computer. I bought a guitarist finger exerciser a while ago for about $5 in a music shop, that seemed useful to reduce RSI / Carpal Tunnel syndrome.
    One day I was on the couch watching Netflix on my TV-connected laptop, with a mini keyboard + trackpad on my lap and my finger exerciser in the other hand, and I thought: can I measure these finger squeezes and use it to control my computer? Surely I can measure something, either a digital open/closed signal or possibly even an analog distance. When I opened up the exerciser I saw that each finger is made with a thin metal pole that's surrounded by a metal spring, that presses against the plastic surroundings.

    The metal spring is the part that strengthens your finger muscles, and the metal pole would be to make sure it only moves straight along the axis.

    When you squeeze a finger, the metal pole comes closer to the end of the tiny plastic cylinder, but it stays inside. So I tried finding a surface-mount Infrared LED and optical sensor that is tiny enough to send a reflection into the hole and measure the reflectance. But I realized it's such a small hole (around 3mm diameter) that it would be very tough to get it to work, and it would have a relatively large amount of electronics on the end to fit all the parts, so it might become a little uncomfortable to hold, but it probably could be done with some effort.

    Then I thought that maybe I'm lucky and the metal pole is magnetic and the metal spring isn't, and then I'd possibly be able to measure the metal pole using a magnetic sensor. I didn't have enough experience with magnets and magnetic sensors to know if I'd need an ultra sensitive sensor or a fairly weak sensor, or whether the pole was magnetic at all.

    So I decided to read the spec sheet of roughly 20 different types of magnetic sensors, until I realized that while many of these sensors measure a yes/no presence of a magnet, or they measure a changing amount of magnetism (such as an electric guitar pickup), I want a magnetic sensor that measures a stationary magnet and the sensor sends an analog output. Luckily I found a sensor that does this and comes in multiple sensitivity ranges. I still wasn't sure if the metal pole is magnetic or if I need to glue a weak magnet or a strong magnet to the end of the pole. I also didn't know if the magnetism of one finger would interfere with the other sensors, since each finger is quite close apart. So I decided to buy several tiny SMD magnetic sensors of low, medium and high sensitivity, as well as several tiny magnets of low, medium and high strength. I figured there has to be some combination that works pretty well!

View all 7 project logs

  • 1
    Remove the rubber end of the guitar exerciser and insert magnets

    When you first buy it, the unmodified guitar exerciser looks like this:

    Simply pull the large grey rubber palm-rest off. This section is designed to come off easily (so you can adjust the springs).

    Insert a magnet in each of the 4 black plastic holes. Don't worry about which way around the magnet is, because you'll measure it later to see if you need to swap the magnet around.

    You don't need to glue the magnet, it will hold onto the metal pole by itself using magnetism :-)

  • 2
    Cut slits into the rubber palm-rest

    You'll need to pass 6 wires from the Tiny BLE board into your 4 sensors that will be kept inside the rubber palm-rest. So cut a slit roughly 1.5mm thick x 8mm long, in the edge of rubber to allow wires to pass through.

    Also cut small slits (1mm thick) on each inner rubber flange so that a few wires can pass between each finger board from the left side all the way to the right side.

    You don't need to add wiring just yet, but to give you an idea of what parts of rubber to cut, this is what your wiring will eventually look like:

  • 3
    Remove the corners of 4 small SMD adapter PCBs

    You need 4 PCBs that are small enough to fit into the existing gaps of the rubber piece, while still having enough pins to hold the 3-pin sensor and some wires. I used a wire cutter to shrink SOIC to DIP adapter PCBs to fit. The pins don't line up perfectly with the sensor, so you might consider building custom PCBs instead so the soldering is easier.

View all 9 instructions

Enjoy this project?

Share

Discussions

D H wrote 09/08/2018 at 11:16 point

Can this detect presses that are only half way down?

  Are you sure? yes | no

Shervin Emami wrote 09/09/2018 at 03:33 point

Yeah it's an analog sensor, so it can tell if each finger is at 5%, 10%, 15%, etc...

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates