Close

Inventory usage

A project log for RKey

My very own ISO mechanical keyboard. Custom PCB with many options and features.

rozzy87rOzzy87 02/04/2021 at 21:000 Comments

The PCB design phase has ended, and I finally ordered a batch of 5 pieces. This is the lowest amount I could get, even though a single board's footprint is way bigger than most of cheap PCB orders in total. (I'm thinking an average 5$, let's say 10 pieces of 40mm by 80mm board from JLC)

So I'll have 5 boards, from which at most I need 2. The others? Well I have one friend who is willling to support me by taking one off my hands, but he wouldn't want a full size keyboard. Ideally he would like a 75% layout but that is fundamentally different from a full size. So I came to an agreement with him having a tenkeyless layout. You know: the almost full size, without a numpad. 

Now this posed a new problem: I had to design the layout in a way so that the numpad is not in any way necessary for the PCB to function. By function, I mean the LEDs are working as intended. And then it hit me: why stop here? There is a layout referred to as 60% which is just the alphanumeric part of a full sized keyboard. So in this spirit I routed the backlight LEDs' traces in a way that you can snap off the numpad, arrow key section, and the function row as well to incorporate 4 separate layouts in one PCB. Neat!

The final PCB design
This is the back side of the PCB. As you can see it marked on the silkscreen, it can be cut along the lines to get different layouts (and perhaps make your very own separate numpad for your 60% layout.
The front side
It's a bit harder to realize, but the front of the PCB contains the traces for the backlight, which is routed from the position of the right Ctrl button, in a way that if you cut off the numpad, or the arrow section, or the function row, you still have one continuous trace for teh LEDs

In the end I've decided to try and utilize all the boards in different ways:

  1. My friend gets one. He'll decide if he is using all of it, or just the TKL layout. Most likely it'll be a wired TKL with RGB and maybe a built-in USB hub.
  2. One full size wireless for my media and game focused PC, connected to the TV. I'll use the Logitech K270 donor for this one. Referred to in the future as "the K270"
  3. One full size wireless for work. As latency is not a real concern I'll use an ESP32 with the BLE HID library. Addressable RGB. Nickname: "the ESP32" Yea, I need to work on my creativity...
  4. One TKL, and a numpad. Yes, separately. Just for kicks. By this time, I'll have some experience and decide if this will be wireless or not. 
  5. If I don't mess up any of the previous ones, I'll have the last board as an ultra compact 60%. I don't see this happening yet, LOL.

The last two is seemingly so far in the future that I don't even plan any other details about them as of now.

The K270

Since this will be the most annoying - mainly because of the huge amount of hand wiring over the PCB - this will be the first I'll try to make. The K270 has 8 media keys that won't be present in the mechanical version. At least not in the standard form... You see, the K270 only has one status LED for the Caps lock, so the area with the status LEDs will be almost empty. I was thinking this calls for a rotary encoder! I could use the LED on the left side and I have a place on the right for the encoder. I could make a cute little knob to control the volume, and also use the encoders built in button to mute/unmute.

The problem with this however is that the encoder is not really electrically compatible with a the K270's board. So I will need a control circuit that imitates a switch being pressed. Maybe an Arduino Nano with  some deep sleep to not consume too much battery power. It could sense the encoder movements, and trigger a transistor for e.g. 100 ms for each impulse.

The second reason I would use a Nano instead of an ATTiny85 is that I would like to monitor the user interactions. If 5 minutes pass without any keypresses, I could  switch off the backlight and switch it on after registering a keypress. I could also use an analog readout on an LDR to determine if the backlight is even needed or not.

For the backlight, I need to see how much power the WS2812s are consuming, that will decide if I'll use these or some standard LEDs. Maybe I'll start by soldering the neopixels on one of the PCBs, and measure much battery life could I achieve. If I'm not satisfied, I'll use another PCB for this one, and keep the one with the neopixels for a wired project.

Battery management-wise I'm planning to use a cheap chinese LiPo charger module, and maybe a boost converter for the arduino. I don't know if the latter would be necessary or not. Battery charging would be possible via an exposed USB type-C connector. There will be a separate master-power switch to turn off the whole thing. I would power the K270 receiver directly from the battery, maybe with some low dropout regulator to maximize the voltage at 3V. If it turns out that I need to use simple LEDs for backlight, I'll need another boost converter to stay efficient.

Mechanically I will go by hot swap sockets without a plate. Considering hot swap sockets are not really meant to inhibit plateless designs, I'm prepared to see some sloppy switches, as the holding power of the sockets alone will not be enough. In that case, I'll be on the search for some FDM printed plates. Or laser-cut. We'll see. I can always switch to another PCB if neither works out.

The ESP32

Since this is a scratch build, I'm not limited in any way, hooray! Well, except for the microcontroller pin count that is. the ESP32 has a lot of pins, but some of them are not recommended to use in some circumstances. See here. It has basically 23 pins you can use with minor restrictions. Well, my full size layout matrix has 21 columns. this won't work. 

Enter the shift register. We only need to scan a single column at a time, and we always need to step to the next column whatever happens right? This is perfect! 3 pieces of  74HC595 chips daisy chained and we have 24 columns to scan! I just need to make a convenient PCB to fit next to the ESP, one pin each for clock, data, and reset, that means we still have 20 pins to read the rows, control the backlight, and whatever other devices I might add.

Speaking of the devices, I would really like to try a 0.91" OLED display next to an Xbox thumbstick, but to be honest, I didn't really find a real use for a display on a keyboard. For the thumbstick I thought I could emulate a mouse with it, and use the built in button as a left click. (maybe hold for a right click?)

Backlight, Battery management, and mechanical design would be the same as the K270. The ESP32 boards have an AMS1117 3.3V regulator built in.

The others

Not decided yet. Really. If everything works out fine, I will spend a better part of 3 months working on the first two projects 1-2 hours a day after work. We'll see.

Discussions