Giter Site home page Giter Site logo

winnedatsch / aw_1-keyboard Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 3.0 7.62 MB

A split (semi-)wireless keyboard with ZMK support based on the NRF52832

License: GNU General Public License v3.0

C 24.86% CMake 1.49% C++ 73.64%
keyboard bluetooth-low-energy nrf52832 zephyr

aw_1-keyboard's Introduction

aW_1 Keyboard

This repository contains the PCB, case design, and firmware for the aW_1 split (semi-)wireless keyboard. The aW_1 layout is a modification of the ErgoDox layout with straightened rows and removed thumb clusters. It is therefore fully compatible with ErgoDox keysets. It is compatible with the ZMK keyboard firmware.

Final Keyboard Front and Back

Design Philosophy

The aW_1 is based on the Nordic NRF52832 that provides both the CPU and bluetooth module in a single chip, which allows for lower power consumption. It can be operated from a standard JST-connected battery, or plugged in via USB-C, which will simultaneously charge the battery. The two keyboard halves are connected with a USB-C cable, hence the "semi"-wireless, with the right half containing most of the circuitry and the left only containing an IO expander. A different approach would be the one pursued by the Mitosis (https://www.reddit.com/r/MechanicalKeyboards/comments/66588f/wireless_split_qmk_mitosis/), which does require a dongle that both halves communicate to. I prioritized the ability to quickly connect the keyboard to laptops, mobile devices, etc. and potential pairing of multiple devices at the same time over cutting the last remaining wire. The connection between the halves is USB-C instead of TRRS because TRRS is not hot-pluggable. Like with an ErgoDox, the there is only a single reversible PCB design for both halves, which makes it cheaper to order.

Folder Structure

  • case: Contains the DXF Files for a low-cost case design built from 5 layers of laser-cut acrylic.
  • firmware/custom: Contains a custom firmware implemented with the Zephyr RTOS. The firmware implements all the essential functionality expected of a keyboard firmware (Bluetooth connectivity, layout customization, sleep mode), but lacks some important features (advanced layer config, multiple Bluetooth profiles, etc.). It has mainly served as an educational effort, but for day-to-day usage the ZMK firmware is recommended (see below).
  • firmware/zmk: Contains the board configuration for the ZMK keyboard firmware. This firmware is recommended for regular use, as it is more stable, customizable, and offers additional features.
  • pcb: Contains the KiCAD schematics and layout files for the reversible PCB.

ZMK Setup & Flashing

Due to the very strict licensing requirements of ZMK, the board configuration for the GPL-licensed aW_1 cannot be added to ZMK's main repository. Fortunately, flashing the firmware is still a relatively simple process:

  1. Setup ZMK locally by following its Toolchain Setup guide. Let {zmk} be the local folder that you have cloned the ZMK main repository into.
  2. Copy the firmware/zmk/aW_1 folder from this repository into {zmk}/app/boards.
  3. Switch to the {zmk}/app folder and run west build -b aW_1.
  4. Install the Nordic nRF Command Line Tools (including the separate install of the Segger drivers for J-Link on MacOS and Linux).
  5. Connect the keyboard to your computer with your choice of Segger J-Link.
  6. Run west flash in the {zmk}/app directory.

That's it! Your keyboard should now show up as a Bluetooth device. If not, try restarting the keyboard by switching the power switch off and on again.

aw_1-keyboard's People

Contributors

awdas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

aw_1-keyboard's Issues

Power remains on when the power switch is off and the main USB port is connected

When both the battery (BT1) and the main USB port (J3) are connected, and the power switch (S1) is set to off, there remain roughly 2.7V on the +3.3V line. This might be an issue with the switch itself, or some unintended loop in the 3.3V line wiring. It does not seem to affect the hardware negatively (at least short-term), apart from the power switch not working as intended.

Add I2C connection detection

Currently, when the left keyboard half is disconnected while the board is running, all I2C calls will error out, since there is no check for an alive connection before interacting with the I2C bus. The right half of the board will continue to function normally.

To avoid a flood of error messages, the firmware should check if the port expander (U2) is present as a slave on the bus and only then issue commands to it. This still leaves a short timeframe for errors each matrix scanning cycle (between the check for a slave and the finishing of all I2C commands), but further scanning cycles after disconnection should not produce any more errors.

Add sleep functionality to firmware

In order to improve standby time, the board should go into a low power state after no key has been pressed for a configurable amount of time. The board should then be wakeable by pressing any key. The NRF52 chips support this functionality, and a POC has already been done on an Adafruit Feather running Arduino.

Move JTAG connector further from the microprocessor

The JTAG debug connector (J4) is placed quite close to the main microprocessor (U5), which prohibits the use of 10-pin sockets with a plastic housing. There is enough space for 10-pin headers without housing, so programming the board is possible in the current version.

Add support for multiple BLE connections

The board should support maintaining multiple BLE connections, and switching between them with a key combination, similar to what modern Logitec mice provide. The board should have a certain number of slots, each mappable to a specific paired device, and BLE notifications should be sent only to the device in the currently active slot. The slot-pairing mapping should be saved between power cycles.

Improve C++ code quality

The firmware does not adhere to modern C++ recommended practices in multiple instances (interaction with raw pointers & arrays, typedefs instead of aliases, no regard for move semantics, etc.) and should be thoroughly refactored. Review by a developer with more C++ experience may be required.

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.