Hacker News new | ask | show | jobs
by MikeTheGreat 1622 days ago
I saw your answer to 'how to get into hardware design'. If you're willing to answer noobie questions I've got another one for you :)

I put together an ErgoDox by following the directions (and by soldering. Lots of soldering :) ) but I don't really understand how the circuits work.

In particular I'd like to put together a keyboard that connects the switches using wires instead of a PCB, but I don't know why there's all the ICs here and there, or what they're doing, or even where to find a circuit diagram of the ErgoDox, nor how to analyze those circuits.

Could you recommend a good 'next step' for getting more familiar with the various parts that go into something like an ErgoDox?

I'm enough of a noob that I'm not going to be surprised if you just link me back to your repo here (in which case I apologize in advance) :)

5 comments

I tried to give a bit of an overview of this in the 'hardware design' section of the documentation [0]. It has some external links to further documentation and tutorials in it too. But the learning curve is very steep.

I'd maybe suggest looking for an electrical engineering intro book or course at a level you feel comfortable with, just to get an idea of the basics.

For the ErgoDox keyboard, the schematic is actually available on their own repo [1], but it's going to look quite intimidating initially. But I found a pretty great looking article explaining the electrical design of the ErgoDox that you might find useful [2]. The ErgoDox actually looks very similar electrically to the threeboard, it uses the same MCU (atmega32u4), but of course has the extra complexity of communicating with the other half of the keyboard over the 3.5mm connector.

[0]: https://github.com/taylorconor/threeboard/blob/master/docume... [1]: https://github.com/zsa/docs/blob/master/ErgoDox%20EZ%20Schem... [2]: https://kandepet.com/dissecting-the-ergodox-the-ergonomic-pr...

Thank you for sharing the [2] link - I think that's what I'm looking for. I read through the 'big' ideas (like how the keypress matrix works, etc) but I wasn't clear on why there's like 3-6 other ICs / components in the ErgoDox too - stuff like "Why is this resistor here?".

I was thinking of trying to make a keyboard that used a much cheaper CPU (like one of those $1-2 ones from China, or the Pico Pi) and realized that if I swap out that out that I'd have no idea where to put resistors, or why :)

I'm definitely going to look through your stuff too - a 3 key keyboard might be a much easier way to start, actually :)

You don't need a PCB. The Ergodox uses two ICs. One is the microcontroller; it is a mini computer that reads the state of the keys (which ones are pressed right now) and emits the relevant USB messages so your computer interprets those as keystrokes. The other is an i2c i/o expander that reads the keys for the other hand exactly like the microcontroller does. (The microcontroller periodically asks it to scan the matrix on its behalf.) It exists so that only four wires need to span the gap between the two hands, instead of one wire for each row and column. You could, of course, just treat both halves as one keyboard and run the matrix wires between the two sides, and omit the i/o expander. It's basically an optimization for split keyboards. (I have built ergonomic keyboards before, and just make it one big thing instead of two halves. Simpler. But takes up more desk space and is less flexible.)

Each key also has a diode which might look like an IC. This is to prevent "ghosting", where pressing a certain combination of keys looks identical to pressing another combination of keys. The lowest of low-cost keyboards don't include this, because if you only press one key at a time, ghosting can't happen. (Most people don't press more than one key at once, except for modifiers like Shift + letter. They work around this by handling modifiers specifically, often not including them as part of the matrix.) Here's an explanation: https://deskthority.net/wiki/Rollover,_blocking_and_ghosting

The search term you want for building a keyboard without a PCB is "handwiring". Here are some guides: https://geekhack.org/index.php?topic=87689.0 https://matt3o.com/hand-wiring-a-custom-keyboard/

I thought I had some better resources in my bookmarks, but I don't.

Here's a keyboard PCB I designed a while ago: https://imgur.com/gallery/lZglox7

I followed the ai03 tutorials (https://wiki.ai03.com/books/pcb-design/page/pcb-guide-part-1...) to design the MCU area of this (The 32u4 and supporting hardware), but if you look at the traces, you can see that the switch matrix is dumb-as-bricks and can easily be replaced with some kind of handwiring.

Don't try to replicate the diode banks if you want sane wiring. The linked tutorial assumes someone is designing for function instead of form.

I actually built my first mechanical keyboard hand wired, it helped understand the basics of how it all worked.

I don't remember if it was this exact guide, but I'm pretty sure I was following Matt3o's guide when I did it: https://matt3o.com/hand-wiring-a-custom-keyboard/

edit: it may have actually been this one: https://deskthority.net/viewtopic.php?f=7&t=6050&start=

Search for a 6-key handwired tutorial, like this one: https://medium.com/cracked-the-code/a-complete-guide-to-buil...

The only parts you need are switches, wires, diodes, and a Pro Micro clone from eBay.

I recommend 6-key because they are supported out of the box by QMK and there are plenty of tutorials.

It looks like the tutorial I linked to above doesn’t actually explain how the matrix / diodes work, so you’ll want to google for an explainer.

Happy hacking!