Hi everyone,
This is going to be a long post but I'll try to answer a couple questions and also tell you the story that ended in the (unfortunate) group buy. I'm juggling between this project and a day job, so ultimately it took me a while but I hope you understand as most of us are in this situation
First of all - and this is something I probably should've started with in the first place - I would like to give you a little background about who I am.
So, to start over - hi, I'm Marcin! I'm a software engineer, currently involved more in site reliability and other cloud-related topics, but I've always had a passion for low level stuff. My journey with programming and the tech industry started with learning and writing code in C++ and it soon developed into several other technologies and at this point I'm very versatile. I've touched and written programs in a variety of languages - including some of the more obscure ones such as Common Lisp and ones that are much closer to hardware such as the assembly (x86, x64). Or even bare machine code.
However, it wasn't until a couple years ago that my friend and I entered this hobby. At that time we were often scrolling through r/unixporn tweaking our setups for optimal performance and comfort. i3, XMonad, spectrewm and that kind of stuff. Yes, I'm an optimization freak. Occasionally some of the cool pictures found there linked to r/mechanicalkeyboards and incidentally that's how we entered another geeky hobby. I started with a cheap board off of Aliexpress with Gateron reds. It was a refreshing experience but soon I started noticing all those intriguing small keyboards. And then ortholinear. I knew I had to get one - and so I did. I got my first 40% programmable ortholinear board and frankly, I was amazed. To keep the momentum I decided to switch to Colemak-DH layout. Spoiler alert: getting up to speed on a new layout is several orders of magnitude more time-consuming than just switching between stagger and ortho. But I can't complain - and it's still the layout I use on a daily basis.
Then I discovered those expensive rubber dome keyboards and soon enough I found myself with a HHKB and a Realforce. Having been a huge fan of the linear switches I must say I was amazed and really liked the typing experience on the Topre boards. But something was lacking. I already tried ortho and even though the feel was great and I've come to love the tactility I found myself switching often between my 40% and the Topres. The lack of programmability was also a huge drawback. I realised that *my* end-game keyboard was going to be a programmable 40% ortholinear with electro-capacitive switches.
That's how the seed was planted. This was back in 2018. After researching the topic for some time I created my first IC for a 40%, split (as that was something I was exploring back then) ortho EC keyboard to see if there would be other people interested as well. The response I got was mixed and fairly limited, but it was a start and soon enough I started developing the very first prototype.
One of the problems that haunted EC development was that there were no available parts. In order to have a custom EC board you needed a Realforce first. Then again, even if you had one you might want to alternate between keyboards and sourcing parts renders the donor keyboards essentially useless.
As such, I knew I needed to focus on creating capacitive conic springs - often sought by people that lost a couple during dome swaps. Apart from the different looks, these springs are somewhat unsual in that they are not the major component dictating the weight of an EC switch. They are also not linear. However, they are crucial for the operation of the keyboard as they're the medium for the electric charge to move around and causing the change in capacitance we're measuring. The fact that they're not the major component of how the switch feels has another important implication to their design - they are extremely lightweight. To the point where it's actually difficult to manufacture a spring so light with such a shape. Nevertheless, I started development and soon enough I had a first prototype.
Apart from the springs I obviously needed to design a PCB.
Back in the days the resources on EC boards were very scarce and weren't nearly as thorough as the recent analyses by Gondolirim or Drew. Anyway, I devoured all of them. Most notably I was heavily influenced by the guide written by Tom Smalley. It was extremely helpful and has laid foundations for this project. I've learned that sensing capacitive circuits is very tricky. The biggest advantage of the EC keyboards is also it's great pitfall - the signal is analog. Unlike digital signals, analog signals are very susceptible to external factors. Like Tom has noticed, we're measuring changes in capacitance on the order of a couple picofarads. This is an incredibly small value and any noise can affect the circuit badly. On top of that, extreme care has to be taken when laying traces on the PCB as inappropriate wiring can easily incorporate additional parasitic capacitance that causes - at best - the performance of the circuit to deteriorate. The magnitude of unwanted effects will vary based on the measurement method but the worst case scenario is that the device ceases to work. So even when you have a proper circuit it may still fail for non-obvious reasons.
How do you ensure it's working despite all the hurdles? To find the answer I went to study an enormous amount of datasheets, application notes and all sorts of pdfs tackling this problem. I read a lot of resources on designing smartphones - yes, smartphones - as, incidentally, that's probably also the largest cap industry making use of touch sensing technologies, and in particular of capacitive touch sensing.
The last piece of work was to implement QMK on the microcontroller of choice. Most new keyboards aren't actually that innovative in terms of firmware. They usually lean onto the same code and microcontrollers that've already been implemented in QMK. Building an EC board meant foregoing both the hardware - as I had to pick something capable of reliably sensing capacitance - as well as the code that was written for it - both because of the hardware as well as the different workings of an EC keyboard. I knew from the start that was going to require a significant amount of time.
Anyhow, in the meantime I started designing a PCB, and to ease the burden I decided to base my design on an improved but somewhat neglected chip from the AVR family. My intention was to make the integration with QMK as painful as possible, granted AVR powered the lion's share of the keyboards powered by QMK. The chip itself was rather big which was both a pro and a con. A pro, since it meant soldering it by hand was doable, and a con because, well, it was big. Unlike classic Cherry MX based designs, EC PCBs have much less real estate where you can place the microcontroller, which resulted in the PCB having a pronounced top. This is due to the aforementioned sensitivity, but also due to the fact that unlike in Cherry MX designs the PCB is also a part of the switching mechanism, so you can't try to stuff something in between the pins. Being a fan of thin bezels this additional space was something I was definitely not pleased with. However, for the time being I had to accept it.
In the end, despite being quite big for the package, the chip turned out to be small enough to be a pain to solder correctly.
What was supposed to be a boon quickly turned into a curse. Instead of making the development easier the architectural similarity actually made things worse. There are a lot of places in QMK (actually, in TMK) where it is implicitly assumed that AVR only consists of the older chips favoured by hobbyists. Eventually, I managed to get it to work and even showed something in another IC - this time with photos of the hand-soldered PCB and the spring prototypes. But I feared that due to those implicit assumptions there may be still bugs lurking, especially ones that might be very hard to debug later on.
I also learned that this chip wasn't actually that great for a capacitive touch sensor and was very inflexible in terms of development.
Shortly after I found out that the chip is to be soon phased out, which concluded with the decision to switch chips.
In the meantime I was improving the springs' design and in total I did another 3 rounds of prototypes, with great success. Finally, that was one component off the list! And the springs from my last run are actually powering my HHKB and Realforce to this date.
Anyway, back to the main venture. Having been made aware of the limitations of my previous chip I started looking for a viable alternative. Something more flexible. Something smaller, to get rid of that ugly top. This time I knew exactly what I was looking for. The chip turned out to be an ARM-based one, designed specifically around capacitive touch sensing.
This was great, both because ARM is an awesome family of microcontrollers (also much more powerful) but also because it gave much more control about individual parameters of the capacitive sensing process, including resistance and amplification. As I've already mentioned, we're operating on extremely low values here - and since the capacitive sensing circuits are acting on such low values and almost anything plays a factor, one of the key elements in capacitive sensing is tuning the circuit to achieve satisfactory performance. More parameters to control means we can come to a solution quicker.
The microcontroller change meant the PCB had to be adjusted slightly, but it wasn't too bad. The worst part was again getting everything soldered, as the package was again, very small. I failed miserably and lost almost all the parts and PCBs (and I swore not to ever solder by hand anything so small by hand). I managed to have it soldered and eventually implemented QMK on that board. It took a nice while to do that, but at least the development of the EC features has been a breeze compared to the previous chip. I never got around to implementing I2C though, since I started worrying about bringing this design to production.
Knowing I would focus on having all the components soldered profesionally I decided to switch to a smaller chip in the family so I can design a case that looks more natural. If you saw the renders of the case design for the first prototype you know what I'm talking about.
It was then that I decided to undo the split. You see, I realized how niche of a category I picked up. Not only EC, but also 40%, ortholinear and split!
I have a very clear outlook on how the future of custom electro-capacitive keyboards might look like. 5x12 grid orthos, macropads, numpads and splits. And not just keyboards. I would like to make the development of custom EC boards a breeze for everyone, similarly to how anyone can build their own custom Cherry MX keyboard.
If time has taught me anything, it's that it's hard to get proper parts for building custom ECs - and those that do have them, have little intention in sharing them. In fact, those of you that saw the original IC may even remember that creating those parts was one of my initial goals. Unfortunately, I bounced off the high costs of entry - as is usually the case with injection moulding.
My previous decision struck me, as out of all the keyboards projects I had on my list the one I chose was bound to have the lowest interest - meaning there would be less traction to keep all the other projects I have in mind.
So I doubled-down and got down to work. I thought a Planck-format keyboard would do much better and ensure there's enough momentum to keep developing the next projects on the list. Also it's simpler in design compared to a split, so I thought it might be best to postpone the I2C stuff until I have experience shipping a custom EC keyboard.
So I redesigned the PCB and this time I went with that other microcontroller from the start. It required some changes to the QMK code, but fortunately the lion's share of the code I've already written was compatible with it. More importantly, I started working on the enclosure and thanks to the reduced PCB real estate needed for the chip I ended up in the current design. I think it's a nice result for the tradeoffs I had to worry in the beginning.
All in all, since late January I've been involved with talks with different manufacturers collecting quotas for a GB run and evaluating their capability. I've since started cooperating with selected few which I was comfortable with (and it's not going to be their first keyboard GB order) and the prototypes I presented to you in the photos and also in the typing test are the result of that cooperation.
Drew, first of all thank you for posting - and I must say you have a very keen eye! All your remarks are correct but for the last one - that last resistor is used for microcontroller stability, not as part of RC circuit. I see this is a path you haven't explored, but all the other components that you were asking about are already included in the silicon and multiplexed internally.
Neither of the chips were an ST, so I haven't made use of your code actually
With this latest board I've been running consistently at >500Hz which I think is more than enough for a great typing experience and as far as I remember it's also faster than the stock boards. I'll see how far I can push this, but this hasn't been my priority so far.
As for the flaws - yes, this PCB has some issues. You can flex it if you tighten the screws too much. Like I've already mentioned this is something that I've already addressed in the next revision (which I should have soon), and rev2 includes a handful of screws to alleviate that.
And by the way, I really enjoyed your posts - although I wish you had written them a few years sooner!
I hope this gives you all an insight into what this project is and shows you my commitment. After working on something for so long you inevitably become emotionally attached to it, I had a hard time seeing beyond that.
I understand everyone's concerns and of course they are valid. This is my first public project and so I should obviously slow down - and therefore I decided to postpone the GB. In the meantime I will be sending out the prototypes for review to some of the more senior members of the community whom I'm very grateful.
(If I omitted anything I'll try to get back to it on nearest occasion. Right now I need to sleep badly. Gn!)