8000 GitHub - sarg/keyboard: WIP of my first custom keyboard
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sarg/keyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My journey to this keyboard began with a birthday gift. I got a Microsoft Sculpt Comfort keyboard and finally learned the proper 10 finger typing method. Then I got into spacemacs and fell in love with the idea of using space as a leader key. And as a newly adopted emacs user I began using Ctrl and Alt heavily. Reaching for control required unnatural wrist movement and I got to know that the solution is to remap Caps as Ctrl. I was living with this hack for a while until I learned a better idea - to remap LCtrl with LAlt. That’s when I started looking for the keyboards with shorter space, so that LCtrl is easily reachable by the left thumb. Eventually I stumbled upon a world of DIY keyboards and started dreaming about ergodox. It was too pricey and had not the ideal layout so I decided to build my own keeb. I had a rough understanding of what I’m aiming for - a handwired split keyboard with a orthogonal layout and a thumb cluster where I could leave hands on the home row indefinetely. So I started by ordering the parts - switches and caps. When the switches came I immediately started to design a layout for my keyboard which fits my hands the perfectly.

Parts

NameQtyPrice, $
Diodes 1n41481000.78
Keys Gateron Brown5021.00
Keys Gateron Red10
Keys Gateron Other5
Keycaps PBT DSA6517.90
Atmega32u412.88
Atmega32u413.22
Wires1 set2.2
3.5mm plug20.9
3.5mm cable11.58
encoder51.78
knob101.40
petg filament 1kg130
petg leftover-24
soldering paste12.29
soldering wire 100g111
soldering wire left-10
tent screws8
plastidip1
tent fixing nuts4
tent nuts M54
total62.93

Layout

./layout_v1.jpg

  • To find a best layout for my hands I’ve put several stripes of masking tape glue side up on a sheet of paper.
  • Then I’ve adjusted columns to my liking and measured the offsets.
  • I have Gateron switches which are Cherry-MX compatible. So the hole size is 14x14 mm and distance between holes should be 5 mm.
  • Thumb cluster is parameterized in polar coordinates.

Case design

v1

./cardboard_v1.jpg

v2

./cardboard_v2.jpg

manufacturing

I’m going to choose one of the options.

  1. PCB only jlcpcb, x5 ~ 27$ + 11$ shipping
  2. 3d printed
  3. laser cutted price estimation:
    • $5.14 x 2 + $9 (fixed, handling) = $19.28 (ponoko)
    • €8.20 x 2 + shipping (formulor.de), no 1.5mm material

3d printing it is. Next time I’ll try PCBs. It seems that you can use PCB as top plate and the manufacturer could mill holes of any shape.

3d printing

https://thomasbaart.nl/2019/04/07/cheat-sheet-custom-keyboard-mounting-styles/

Requirements.

  1. switch should be firmly attached to the keyboard switch is designed to be mounted on a panel 1.5 mm thick and soldered onto PCB you can select one of those options - pcb+panel, panel only, pcb only

    produces: mounting place

  2. switch should be positioned under the finger and easily accessible without much finger movement there are few ergonomic layouts that minimize finger movement. Just take one and adapt it to your hands

    2.1 keycaps are wider than the switch body. there should be minimal distance between keycaps so that they don’t touch ortholinear + thumb cluster shaped as an arc

    produces: layout

  3. mounting plate should be sturdy enough to not bend when typing

    produces: plate thickness

  4. switches should be wired to the controller pcb or handwiring. Both need some vertical space something that elevates the plate needs to be implemented:
    • pins
    • another plate

    produces: wiring space

  5. controller should have some place

    produces: controller location

  6. underside of the keyboard should be protected pcb or handwiring should be protected from water spills and mechanical damage

    produces: bottom plate

  7. optional: halves of a split keyboard should communicate

    produces: cable between halves, connectors

  8. optional: tilt/tent

    produces: tent brackets

from handbook of 3d printing make wall thickness proportional to nozzle width add fillets everywhere <45 degree overhang doesn’t require support

first print

For first print I’ve prepare a single row of 5 keys where each hole has size $14+i*0.1, i in [-2..2]$. I’ve found 14-0.2 the best. Then I’ve prepared small test case where I’ve mounted all the different types of switches I have. I had to redesign promicro mount after the print as the board wasn’t fitting nicely.

./test-print.jpg

Hand-wiring

BrownFox step by step - deskthority

The keyboard has 23 keys per hand - 3 rows of 6 columns and the fourth row of 4 thumb keys and an encoder button. It fits in a 4x6 matrix and requires 4+6=10 pins. Encoder takes 2 pins and serial connection takes another 1. In total: 10 pins for keys + 2 for encoder + 1 for serial + GND + VCC = 15 pins.

Some pins has extra functions and they have to be used last.

Firmware

Consult documentation.

Create new template with ./util/new_keyboard.sh

tree --noreport
.
|-- config.h
|-- keymaps
|   `-- default
|       |-- config.h
|       |-- keymap.c
|       `-- readme.md
|-- rules.mk
|-- sarg.c
`-- sarg.h

Let’s go file by file to find minimal set of tweaks:

config.h

#define MATRIX_ROWS 8
#define MATRIX_COLS 6
/*
quantum/split_common/matrix.c presumes that kbd is split evenly by rows

#define ROWS_PER_HAND (MATRIX_ROWS / 2)
*/

// pinout http://i.imgur.com/wMNx2u6.png
#define MATRIX_ROW_PINS { D0, D5 }
#define MATRIX_COL_PINS { F1, F0, B0 }

#define DIODE_DIRECTION COL2ROW

#define SOFT_SERIAL_PIN D0  // or D1, D2, D3, E6

info.json

Can be skipped, used in QMK web configurator.

rules.mk

BOOTLOADER = caterina
SPLIT_KEYBOARD = yes

sarg.c

Could be left as is.

sarg.h

Here you define a macro that returns array of arrays with your layout.

keymaps/default/keymap.c

Define layout in keymaps array.

First compilation.

bin/qmk compile -kb sarg -km default
...
Checking file size of sarg_default.hex                                                              [OK]
 * The firmware size is fine - 23964/28672 (83%, 4708 bytes free)

link

Nicinabox has a [very nice and detailed guide](https://github.com/nicinabox/lets-split-guide) for the Let’s Split keyboard, that covers most everything you need to know, including troubleshooting information.

GUIX

guix time-machine -C channels.scm -- environment --pure -m manifest.scm
python3 -m venv pyvenv
source pyvenv/bin/activate
pip3 install -U qmk

make firmware
make flash

flashing qmk-dfu

  1. build avrisp2 firmware from lufa
    make -C Projects/AVRISP-MKII/ MCU=atmega32u4 BOARD=LEONARDO F_CPU=16000000
        
  2. Flash avrisp2 firmware on promicro using avrdude
    while read i; do if [ "$i" = ttyACM0 ]; then break; fi; done \
       < <(inotifywait  -e create,open --format '%f' --quiet /dev --monitor)
    
    echo "Found device... flashing"
    avrdude  -patmega32u4 -c avr109 -P/dev/ttyACM0 -U flash:w:$1:i
        
    sh flash.sh Projects/AVRISP-MKII/AVRISP-MKII.hex
        
  3. Solder 6 wires for ISP programming
    [ProMicro as AVRISP-mkII] <==> [Target ProMicro (or other AVR)]
    GND <--> GND
    VCC <--> VCC
    PF4 <--> RST
    PB1 <--> PB1 (SCK)
    PB3 <--> PB3 (MISO)
    PB2 <--> PB2 (MOSI)
        
  4. Flash QMK firmware with bootloader (production)
    avrdude -p atmega32u4 -c avrisp2 -v -e -U lfuse:w:0x5E:m -U hfuse:w:0x99:m -U efuse:w:0xF3:m
    avrdude -p atmega32u4 -c avrisp2 -v -e -U flash:w:sarg_default_production.hex
        

    Fuses are not magical. These basically set clock source, bootloader size and enable some features of the chip. Sure the values should be chosen carefully, for that consult the official datasheet for the controller. See also: https://rfong.github.io/rflog/2021/09/29/avr/ https://docs.qmk.fm/#/isp_flashing_guide?id=flashing-the-bootloader https://www.engbedded.com/fusecalc/

  5. Repeat for the second ProMicro. Now that it has the dfu programmer, flash it this way
    dfu-programmer atmega32u4 erase
    dfu-programmer atmega32u4 flash AVRISP-MKII.hex
        
  6. From now on to flash the keyboard, press the QK_BOOT key (see layout) and it will reboot to bootloader.

About

WIP of my first custom keyboard

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0