Remember when I said that I was going to try to tweak Ben Vallack’s Piano keyboard design to fit my hands and use case better? Well, I’ve done it, and am typing this article on it right now!
Before I get to the details, in the interests of full transparency I need to tell you that PCBWay got in contact with me (after I had started designing the board) and offered to sponsor me. I do get similar offers from time to time from all sorts of companies, but very rarely take them up. However, I felt fine about accepting this sponsorship as a) I had ordered the PCBs for the Piano from them (paying for them myself), and was very impressed with their service and the quality of the boards, and therefore b) I had already decided that I was going to order boards in matte black and gold ENIG finish for this keyboard from them before they made the sponsorship offer. The arrangement is that they paid the cost of producing the boards plus shipping, and in return I would write an honest review of their product and service.
So without further ado, here it is. Introducing the Nine keyboard…
As I have mentioned, there were a couple of things that I wanted to tweak. These were:
- To angle the thumb keys slightly, and place them at the optimum point for the size of my hands
- To shift the controller to the inner top corner of the board to make it easier to plug the USB-C cable in and still use the keyboard while it is charging, and also move the battery to the back of the PCB to allow upgrading to a larger, higher capacity battery in future
- To try to make the outline of the board a slightly more stable shape
- To add a pair of nice!view displays
Ben’s original design used Ergogen to generate the PCB layout, but while I had some success moving the thumb keys using that method, I found it tricky to figure out how to incorporate the pads and wiring needed for the nice!view. In the end, I decided that if I was going to do this, I might as well learn from scratch how to build a keyboard from the schematics up using KiCad. So that’s what I did: I recreated the design from scratch, building in the alterations I wanted to make as I went. I have to say that KiCad is incredible. The fact that anyone can download it for free, design a PCB and export gerber files that can be uploaded for PCB fabrication is astounding. The fact that it is Open Source also means that people like me with zero knowledge about electrical engineering can look at the source files that others have made public, and learn a huge amount. I am indebted to the maintainers of KiCad (I have made a donation to their 2022 Fund Drive, which seemed the least I could do), and to all those helpful people who have published keyboard designs or hung out on the keyboard Discord channels steering newbies like me away from errors.
The schematic is where you sketch out the components and connections between them for your design. This helps later on because it means that KiCad then ‘knows’ what should be connected to what, and can flag up errors using the Design Rules Check (DRC). Once I understood the basics of how you add wires and flags, I really enjoyed this part. Again, I studied the schematics of other keyboard projects to see how to connect up a power switch and a battery, but this step is not too difficult. I did go back and forth at various points between the PCB and the schematic to alter the pins that the switches were connected to as I realised that a different organisation would be easier to route. KiCad makes it easy to update the PCB with changes to the schematic though, so this wasn’t too much trouble.
Having the schematic is useful to remind yourself how things are wired up, and to make notes for anyone else (or future you) who wants to make the keyboard to ensure that components are placed in the correct orientation. You can trace connections from the PCB file, but I found it much more difficult on a busy board than glancing at the schematic.
Once this part is done, you move on to placing and wiring up components on the PCB.
When you sync the schematic, the components are added as a pile on your new PCB, but already provisionally wired together to form what is called the ‘rat’s nest’. These will not form physical electrical connections on the finished board, but are there to guide the routing process and to prevent you from connecting together components that should not be connected according to your schematic.
I’ll get to routing in a moment, because the first task is to place your components’ footprints in the locations of your choice. Obviously, when creating a keyboard, one of the most important jobs is to make sure that each keyswitch is spaced correctly from the next so that the keycaps don’t clash and that it works for your ergonomic layout. I placed the block of six main keys together parallel with the top of the board, and aligned the pinkie key so that the top of the 1.5U cap was in line with the top of the lower row of keys in the block. This is essentially the same as Ben’s design. I then experimented with positions and angles for the two thumb keys, ending up with them placed at 25° from vertical. One of the nice things about such a small keyboard is that you can print out the PCB file (to paper), and each half fits (rather comically) on to a sheet of A4 paper. You can then tape keycaps on to the paper in the positions you have defined, and fake type on this prototype to see how the placement works for you. I went through a few iterations of that process while tweaking, but it is a useful thing to do to refine your design. Changes of a few degrees or millimeters can make a surprising difference to how it feels.
Once you have placed all the components in their final positions, you need to draw an outline for the board. This was what I found most difficult, as drawing arcs and getting everything to join up into a closed shape is fiddly. I created something that — oddly enough — actually looks a bit like the outline of a grand piano from above. There is a bit more space at the upper inner edge of the board to accommodate the nice!nano controller and the power switch. I also extended the space under the palm a bit as I wanted to place the battery underneath the board it this area to allow for later use of a larger capacity battery if needed. I was fairly generous with board margins (connecting the top outer corner with a diagonal edge, for example) to try to improve stability, though at this point I was just guessing about whether this would make it more or less stable!
The final step was to wire everything up. As I said earlier, the rat’s nest wires help you to route the board, but I found that I needed several attempts to redo it until I got the layout I wanted. Each trace needs a certain clearance around it, and they cannot cross on the same layer, so you need to use vias to route traces from the front copper layer to the back (or vice versa) to make it work.
I faced a couple of issues which meant I had to decide on what compromises I was going to make. I was making a double sided board so that one design could act as both the left or right side of the keyboard by flipping it over. That’s fine for footprints with surface pads, as you just add a footprint to each side and wire them up appropriately on each layer of copper. Footprints with through-holes are more tricky as it means that you have to physically flip a component like a controller so that it is face up one side and face down the other, or create two rows of through-holes (one for each side), or add jumpers. The user would then close the jumpers on the appropriate side of the board to ensure that everything connects up to the correct pins on both sides of the keyboard.
The latter is definitely the most elegant solution, and is what Ben used for the Piano. However, a timely intervention by @TweetyDaBird on Discord alerted me to the fact that you a) need thicker traces for power and ground connections, and b) to avoid routing traces under the nice!nano’s Bluetooth antenna as much as possible to prevent connection issues. The interconnections for the jumpers made this quite difficult to do while providing enough clearance. While it is also better to have the nice!nano face up in order to provide line of sight for the Bluetooth signal, I decided to compromise and have one set of through-holes and mount the controller face up on the left and face down on the right. The right side only has to connect to the left side which is always pretty close, not the computer, so I figured this was a reasonable compromise. Thankfully, everything works fine. I had the same choice to make about the through-holes for the nice!view headers, but in that case I chose to make two rows of holes.
The final step before exporting the gerber files was to create a copper fill layer on each side to act as a ground plane. This isn’t strictly necessary for a keyboard like this, but it does provide better grounding for the board, and also means that you do not need to connect all the ground connections separately: they all get connected to the big ground planes. Again, on @TweetyDaBird’s advice, I made sure that I used an exclusion zone in the area directly under the nice!nano so that the copper fill would not block the Bluetooth signal. I also added a little logo that I made. I had decided to call my incarnation of this board Nine (imaginatively, since there are nine keys per side), and ‘designed’ the only logo that would work with my very limited graphic design skills. Basically, I can cope with circles and a few slightly curved lines. I quite like the way it looks though.
Fabricating the PCBs and building the keyboard
Exporting gerber files is easy, and PCBWay provide instructions about the settings required for them to fabricate the boards. Once you have uploaded the files, you’ll get a preview, which is handy to check that everything looks as you expect.
As I mentioned earlier, I chose the matte black soldermask and the immersion gold/ENIG finish, with white silkscreen. The ENIG finish is quite a bit more expensive than the standard one because each pad has the nickel plating over the copper pads covered with real gold. This improves the function and longevity of the board by preventing oxidation of the pads and improving electrical connectivity. The other reason to do it is that it looks gorgeous. Similarly the matte black soldermask costs a bit more than the other colours, but paired with the ENIG finish it is really stunning. I had thought it would look good, but it ended up far better than I had hoped. I don’t think the photos really do it justice — you have to see it in person to appreciate it. Part of my original plan was to use a transparent top case to make a feature of the board design (inspired by Geist’s stunning TOTEM keyboard), so these aesthetic considerations were important to me.
After ordering (FedEx International delivery), I had five beautiful PCBs in my hands only a week later, which was amazing. I have been really impressed by the quality of both orders that I have had from PCBWay. Everything has been precise, well-engineered and has a high quality finish. Drill holes are clean and perfectly sized, and even the silkscreens are crisp and clean.
I was so excited to get these boards in my hands, and couldn’t wait to start building them up. I was a bit anxious that I might have made a silly mistake in the design that would render them non-functional, but as you know already, they turned out really well.
Soldering everything up was pretty straightforward. I find the Kailh hotswap sockets easy to solder, and while the power switches and reset buttons are a bit fiddly given their tiny size, a bit of liquid flux on the pads before you solder makes it an easy job. I found that the gold finish on the pads seemed to make it easier to do a clean soldering job, which was lucky because I really didn’t want to mar that lovely satin black finish. I took a risky but pragmatic decision not to socket the controllers. I had the Mill Max sockets and pins, but the sockets I had were not the very low profile ones, and when I dry fitted them I found that the nice!view displays would have been awkwardly tilted up on the left side because there was not quite enough clearance above the controller. I do have a de-soldering gun, so I could have removed them if needed, but luckily everything worked fine (I flashed the nice!nanos before soldering them, which always seems a wise precaution). The only really tricky thing was fitting the tiny JST connector on the battery wires. Those things are the very devil to fit, and I hate them with a passion. Getting the little metal connectors onto the bare wires and inserting them in the housing always seems to take ages. This time I made sure that I located the socket in such a way that I could turn it 180° on each side so that the positive pin was always on the left. That way, I am less likely to make a fiery error if I have to swap batteries around!
Once I had finished building, I connected to Bluetooth on my computer, and lo and behold, everything worked perfectly! The re-arrangement of the keys feels is if it was tailor-made for my hands — oh wait, it was :-). The displays are not strictly necessary but I love them and find it very useful to know which Bluetooth profile is active (as I use the keyboard connected to two computers and sometimes my phone), and also what layer I am on. Having a display of the battery level for both sides is also very useful, as the host computer only shows you the levels for the primary (left) side.
At the moment, you will see that I am using the board without a case and with temporary rubber bumpons on the bottom. Even in this state, it is very stable, and I no longer find that holding keys on the top row causes the board to tip. I have designed a case though. As I mentioned, I was really inspired by Geist’s transparent case for his TOTEM. Before seeing that, I had no idea that you could get things 3D printed in transparent resin. Designing a case has been far harder than designing the PCB, though. I have found it very difficult to think in three dimensions, and have had to re-do things several times, which is a story for another time. I have already ordered a resin case from PCBWay (which I paid for myself), with a black base and a transparent top. I am pretty sure that there will be issues with at least the top part due to my own design mistakes. The engineers let me know that there is a region of the top case with very thin walls which might break, and asked me if I wanted to accept that risk or re-do the files. The problem was that I had clearance problems with the keys, so I couldn’t really make that part thicker without reworking the whole design, so I decided to risk it. I think I need to see how it fits (or doesn’t!) in real life before I make changes to the design, because I was struggling to visualise it. Although I do that all the time when I am sewing, starting with a 2D pattern and piece of fabric seems to make it much easier for me to think through how it becomes 3D. As it is, I have realised along the way that I could and should have moved a few components and stand-off holes on the PCB to make it easier to get a case to fit. Anyway, you learn by doing, and I have enjoyed this whole process so much that I don’t think it will be the last keyboard I design.
This has been an epic post already, so I will wrap up things up here. Once the case arrives, I will probably write Part 2 with a discussion about how bad I am at 3D design. I will also clean up my KiCad files and write some documentation, then release this design publicly as Open Source Hardware. Over time, I will add improved case file designs so that people can get them printed. I’m aware that these kinds of tiny keyboards are a minute sub-niche within the already small niche of ergonomic split keyboards. However, I have learned so much from studying other people’s designs that even if no-one else ever builds this keyboard, they may get some benefit from looking at the files.