Coder Social home page Coder Social logo

klepcbgen's Introduction

KLE PCB Generator

This script makes it easier to create your own keyboard with fully custom key layout. It reads a file exported from the online Keyboard Layout Editor and generates a KiCAD project from this, complete with schematic and layout. After manually finalizing the design you can generate the files a production service (such as OSH Park or Eurocircuits) needs to manufacture your PCB.

The generated schematic is pretty much complete and contains all key switches connected in rows and columns, a functional control circuit built around the ATmega32U4 (including external crystal, reset switch, programming header and a USB connector) and mounting holes. The layout is only partly routed, but contains all switches (including stabilizer mounting holes for keys that need it) in the correct position.

Features

Current klepcbgen features are:

  • Generate a project compatible with KiCad 5 and 6 (But check this first)
  • Use only standard KiCad libraries
  • Keys of different widths and/or heights
  • Add stabilizers to keys 2 units or more wide
  • Cherry MX switch mount
  • Limitation: layouts with at most 18 columns and 7 rows

Currently not supported are:

  • Keys with secondary width/height (So no ISO ENTER keys for now, sorry!)
  • Rotated keys
  • Vertical keys (e.g. numpad ENTER and "+")
  • Alps switches

Installation

Start by downloading and unzipping the code or by cloning the repository:

git clone https://github.com/jeroen94704/klepcbgen

Then install the required dependencies, using the following command:

pip install -r requirements.txt

(Note: On Windows, make sure to execute this command in a shell with admin rights)

Usage

Please read this wiki page for usage instructions.

Kicad 6

Additional instructions regarding Kicad 6 can be found here.

Future improvements

Core features:

  • Smarter options for rows/columns grouping, as the current approach does not allow for a full 104-key layout
  • Support foorprints with stabilizers for vertical keys (numpad enter and 0)
  • Add the option to use Alps footprints (Supported in KiCad as Matias switches)
  • Support ISO-ENTER
  • Support rotated keys

More advanced options:

  • A board outline compatible with swillkb's online Plate&Case Builder.
  • Support for easy generation of keyboard firmware.
  • Lighting: obviously RGB is all the rage, so I would like to add options to generate a PCB which includes lighting
  • Split layout: I'm a big fan of ergonomic/split layouts (I'm currently typing this on a Kinesis Freestyle Pro)
  • Wireless: Becaue cables are a nuisance.
  • Alternative control circuits: The ATmega32U4 is not the only option, and frankly doesn't have a lot of spare pins, e.g. for lighting

Donate

If you find this project useful a small donation is much appreciated (but by no means required or expected): https://ko-fi.com/jeroen94704

License

klepcbgen © 2020 by Jeroen Bouwens is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/

klepcbgen's People

Contributors

hulto avatar jeroen94704 avatar pcaro avatar pjvds avatar rastersoft 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

klepcbgen's Issues

.sch fails to open due to blank line

Hi:

I created a layout and exported as JSON, and then applied your program to generate the KiCad files. But when I try to open it in the current KiCad version, it reports an error in a line (it varies depending on the layout). Opening the .sch file with a text editor shows that in the specified line there is a blank line. Manually removing that line makes the file work.

Missing net ID - Extra Row added in PCB Layout

Attachment: JSON layout file, error image

example_layout.txt
error_1

With that error and layout file, I did a bit of digging and found out that there is Row_6 that tied to net 0, which I'm not sure what it is. That row have only one key (I don't know what key it is) and 3 diodes. After remove those module, the PCB load successfully, but I'm not sure whether it is correct.

Nonstandard ICSP pinout

If I'm not mistaken, the ICSP in the generated files follows the pinout:
MISO-VCC
MOSI-SCK
RST-GND

whereas most arduinos use the pinout:
MISO-VCC
SCK-MOSI
RST-GND

Use Skidl + PCBNew for extensibility

Do you think it's possible to migrate the project from using text templates to using something like Skidl for the netlist creation and PCBNew for the part placement? I think that expands the capability of the entire project without being limited to templates.

Generated PCB does not match schematic sheet

Having some issues, and opening this issue as a bit of a reminder to dig deeper when I have a chance. Open to suggestions however!

Created a new file with the Leopold layout from http://www.keyboard-layout-editor.com/#/ (with an extra button - still working on the actual layout). Getting a feel for this tool, the example JSON file generates properly. However, upong using my custom layout (gist), it renders like so:

image

So while the elements are there, they aren't placed correctly on the PCB itself.

It's getting late where I am, so I could be missing something very obvious. Hope to get back to this soon~

adding more keys

As I'm looking for a "regular" keyboard with extra keys I was hoping to use this to generate the PCB. Now I'm guessing the 104 keys aren't feasible due to limited I/O of the 32u4. Would using a 74HCxxx multiplexer fix this issue or as a complete alternative, a RP2040?

Column allocation doesn't take filler into account

I have a keyboard where the top row has a large gap in it:
http://www.keyboard-layout-editor.com/#/gists/8c20b446f56a42b79fa6ec21ffdee3db

After adding a bunch of prints, I can see that SET-UP is correctly put in col 0, but the next arrow key is put in col 1 even though it's 9 spaces to the right. The layout actually fails due to too many columns anyway, but if it didn't the resulting "grid" would be horrible to lay out. If a key has the f field, that should be added to the running col for a row.

(also, a --verbose option would be really useful!)

Errors should be more user-friendly

Running on default ANSI 104 layout gives cryptic error:

ERROR: Key placement produced too many columns. klepcbgen currently cannot generate a valid KiCad project for this keybo
ard layout.

Need to check code to understand what is wrong with the layout and correct the JSON layout.

A hint on how to change the configuration file could be more usefull instead of logic error description.

I can't give you a precise example but something like "on row XX, this parameter can't be managed"
Or in this case "keyboard can't have more than XX columns sry."

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.