One Handed Chording Keyboard

by akmnos22 in Circuits > USB

4792 Views, 37 Favorites, 0 Comments

One Handed Chording Keyboard

V1 Finished (Correct Orientation).jpg

Two hands are required to type on a regular keyboard. A mouse needs one hand to operate. This results in needing to move a hand between the mouse and keyboard often, which gets tiring.


To solve this problem, I designed and built a one-handed keyboard that uses key combinations (chords) for inputting keys. This allows me to keep one hand on my mouse and one hand on the keyboard, while still being able to type. I built this in Ms. Berbawy's Principles of Engineering class as part of my SIDE Project.


My project was inspired by CrazyRobMile's 6-key Pico Chord Keyboard and Infogrip's 7-key BAT keyboard, a commercial product that was discontinued. I would also like to thank cribbit from the geekhack forum for their "A modern handwiring guide" post.

Supplies

Engineering Notebook Blurred.jpg

Materials

  • 7x Cherry MX Compatible Switches
  • 7x Keycaps
  • Raspberry Pi Pico
  • Micro USB cable
  • 20-pin female-to-male header
  • 20-pin angled male-to-male header
  • Solid core wire (red and black is preferred, but any color will work)


Tools

  • Soldering station (including wire stripper and wire cutter)
  • Multimeter
  • CAD Software
  • FDM 3D Printer, such as the Prusa Mini and corresponding slicer software
  • Computer or laptop


Throughout the design process, I used an Engineering Notebook to keep track of my progress. This was very helpful as it kept all of my notes and drawings in one place and allowed me to reference past decisions months later.

Create Case

Bottom Half Print 3.jpg
body_v3_top_indents.PNG
body_v2_bottom1.PNG
body_v1_1.PNG

Tools in this step: CAD software, 3d printer


CAD a keyboard case that consists of a top and bottom half. The top half should have slots for the keyboard switches.

Each keyboard switch hole should be 14 mm by 14 mm, but tolerances need to be taken into account. The area around the switch should be at most 1.5 mm thick to allow the switch to snap in fully.

The bottom half needs to have a hole on the side that will allow a micro USB cable to pass through.


Keyboard switch placement should be done in a way that allows you to use the keyboard comfortably. Start by placing your hand on a piece of paper, palm down. Use the hand that you plan to use the keyboard with. With your other hand, mark down where your fingers rest. Scan and import the paper into your choice of CAD software and place the holes for switches in those spots.


Print your keyboard case design using a 3d printer. I designed mine in OnShape and printed it on a Prusa Mini using Galaxy Black PETG filament.

Place Switches Into Case

Top Print 1A.jpg
Top Print 1B.jpg

New materials in this step: Top half of keyboard case, Keyboard Switches


The switches should snap into their slots with little force. Orienting them in the same direction will line up the pins and make soldering easier.

Solder Header to Pico

Pico Headers Cropped.jpg

New materials in this step: 20-pin female-to-male header, 20-pin angled male-to-male header, raspberry pi pico

Tools in this step: Soldering Station, Multimeter


Solder the female-to-male header to the raspberry pi pico so that the header is connected to pins 1-20 with the female end on the back (the side that does not have the BOOTSEL button). This is the left side of the pico in this pinout diagram.


Next, plug the male-to-male header into the female-to-male header and use a multimeter to ensure that the headers connect correctly.

Solder Ground Wire

Solder Redo Ground.jpg

New materials in this step: Solid Core Wire (Black)

Tools in this step: Soldering Station, Multimeter


Start at one end of the keyboard. Strip one end of your solid core wire and wrap it around a pin of the first switch. Be careful to avoid bending it, as the pins are easy to accidentally snap off.

With the wire flat against the switch, solder the joint. Move onto the next switch. Strip a wire segment, wrap it around the pin, and solder. Repeat this for all seven keys using the same length of wire.


Leave a length of wire at the end or solder a piece in the middle for later. This wire should be able to reach the center of the keyboard area.


Use a multimeter to check that the non-ground pin of each key is electrically connected to the ground wire when the corresponding switch is pressed, and that it is not electrically connected when the switch is released.


🛈 Keyboard switches do not care which pin is used as ground. An electrical connection is made between the two pins when the switch is pressed, and no connect is made when the switch is depressed.

Solder Switches to Header

Solder Redo Finished.jpg

New materials in this step: Solid Core Wire (Red)

Tools in this step: Soldering Station, Multimeter


Open this raspberry pi pico pinout diagram. Uncheck the SPI, I2C, and UART checkboxes.


For each key on the keyboard, find a GP_ pin on the diagram and the corresponding pin on your male-to-male header. Cut a piece of wire, strip both ends, and solder it to connect the keyboard pin and the header pin.


⚠️ Try to minimize the length of wire so that it sits against the keyboard and doesn't move much. Movement will bend the pins on the switches and eventually break them.


Repeat to solder each key, but make sure that each key is connected to a different GP_ pin. Note down which switches are attached to which pins for later.


Solder the ground wire from step 3 to a header pin that the pinout labels as Ground.


You can detach the pico from the male-to-male header for this step, but make sure that the male-to-male header is oriented correctly when soldering.

Attach Keycaps

V1 Finished.jpg

New materials in this step: Keycaps


Attach your keycaps to the switches by lining up the cross with the slot on the underside of each keycap.

Install Libraries

CIRCUITPY libs.PNG

Plug your Raspberry Pi Pico into your computer using the micro USB cable.


If your pico does not have CircuitPython installed already, please follow Adafruit's CircuitPython Installation Guide first.


Download the Adafruit CircuitPython libraries and save it in your downloads folder. Do not put it on the pico yet.


⚠️ Make sure you download the correct zip file that corresponds to the version of CircuitPython you installed on your pico. As of writing, the latest stable version is 8.x.


Unzip the downloaded file into your downloads folder. Find a folder named "lib" and open it.


Next, ensure that the pico is plugged into your computer and you see a drive named CIRCUITPY. If you see a drive ending with BOOT or you see a RPI-RP2 drive, disconnect and reconnect the pico without holding the BOOTSEL button.


In a separate window, navigate to the CIRCUITPY drive. Create a folder named "lib2" in lowercase on the CIRCUITPY drive. Copy the "adafruit_hid" folder from the "lib" folder (from your Downloads) to the "lib2" folder. Your file structure should look like this:

CIRCUITPYTHON (drive)
lib2
adafruit_hid
__init__.mpy
consumer_control.mpy
(other .mpy files)

Now, rename the "lib2" folder on the CIRCUITPYTHON drive to "lib".

Install Keyboard Software

CIRCUITPY root.PNG

Download code.py from the file list below. Move it onto your CIRCUITPYTHON drive, outside of any other folders. Your file structure should now look like the following:

CIRCUITPYTHON (drive)
code.py
lib
adafruit_hid
__init__.mpy
...

Eject and disconnect the pico. Reconnect it after 5 seconds. It should now show up as a keyboard device.


You will need to edit code.py using a text editor to configure it with the pins you used. In the CONFIG_INPUT_PINS section, change the number after "mc.pin.GPIO" to the pin number you used for that switch.


🛈 If you would like to customize the keyboard software, I recommend getting the Mu Code Editor, which will allow you to view the serial output for debugging and quickly update code. You can download it from their website: https://codewith.mu/


Keyboard chord combinations can be configured by editing the code. A list of keycodes can be found in adafruit_hid's keycode.py.

Downloads

Close Case

FBD7M1ELTWYH7JZ.jpg

Pass the micro USB cable through the hole in the bottom half of the case.


Align the two halves of the case and push gently. If you did not include a latch/screw mechanism in the design, you may need to put tape on the inside to hold the case closed.

Keyboard Use

10k Map Reference Image.PNG

Switch your computer keyboard layout to QWERTY, if it is not already. Otherwise, the chord tables will be inaccurate.


Chords are triggered by holding down multiple keys at once and releasing them. Learning to type may take a few hours. Shift, alt, and control can be input by pressing a thumb key and releasing without entering a different chord. They will be held until the next chord is entered. Double tapping shift, alt, or control will keep it held until you tap it again.


To input symbols like $ and %, input Shift then input the number key of choice. For $, you would press and release the middle thumb key - shift - then press and release the chord right+pinky - the chord for "4".


manualmap_chords.csv contains a table of chords for the code.py provided earlier. This can be imported into your spreadsheet software of choice (Excel or Google Sheets). Set up conditional formatting for filled cells to make the periods easier to see. The thumb column is either blank, "b" (blue/left), "g" (green/middle), or "y" (yellow/right) depending on which thumb key needs to be pressed for the chord.


Alternatively, you can print out the 10K Map Reference.pdf file, which is already color coded for the default chords. Blue rows require holding the left thumb key in addition to the chord. Green rows require the middle thumb key, and yellow rows require the right thumb key. A black row means no thumb key should be held.