Hi everyone! This is the fifth post on building the HacKeyboard. In case you haven’t read the first ones, here are the links:
Making the PCB
This part of the project was one of the most time-consuming and frustrating. I’ll tell you why. The PCB is too big. Too big to order from a PCB manufacturing service because it is too expensive and too big to make with the usual homemade PCB methods. However, with a few attempts and a lot of patience it can be done. I used the toner transfer method. This method is fairly simple:
- Print your PCB in glossy paper in a laser printer;
- Clean your PCB from any grease;
- Put the printed PCB upside down on top of the PCB;
- Apply clothes iron for a few minutes;
- Soak the PCB with attached paper into water and carefully remove the paper;
- Verify that the toner tracks are attached to the PCB;
- Put it into a corrosive solution like ferric chloride or hydrochloric acid with hydrogen peroxide until the non-protected copper is etched;
- Remove it from the corrosive solution and clean it water;
- Remove the toner with a stainless steel sponge;
- Drill the PCB holes;
I could go on trying to explain it in detail, mentioning all the tricks and tips, it but instead I’m going to recommend you to follow some great instructables that other people have made and that are very, very well explained:
- PCB Making guide
- Two Sided PCB Using Toner Method
- Most Simple Home-Made PCB by Toner Transfer
- Toner transfer no-soak, high-quality, double sided PCBs at home
- Easy, Consistent & Cheap Toner Transfer Method for Single & Double Sided PCBs
If you follow these guides, you’ll understand how it works. There’s no way you can go wrong 🙂
However this is not a usual PCB and I ran into several problems:
- Since the PCB is bigger than an A4 sheet, you have to print it in 4 parts;
- Since the PCB is double sided you need to align all 4 parts;
- Since the PCB is too big you need to get a powerful iron. If you use a weak iron it won’t melt the toner enough to make it stick to the copper since the PCB simply acts as a huge heatsink; If you have two irons, use two irons. If you have three… you know what to do. 🙂
- When removing the paper some small parts of the toner traces would also get removed. I had to fix them using a sharpie;
- The etching process has to be carefully controlled. Since I would have to waste a lot of etchant to get the whole PCB covered, I used a sponge to etch specific parts of the PCB (learned it in this great instructable). This takes time and patience but allows you to monitor the etching process, and stop it and fix it if necessary.
- I used hydrochloric acid (33%) with hydrogen peroxide(10 vol) as the corrosive solution and had to replace the corrosive solution several times since the amount of copper to be etchet would quickly saturate it. I usually use 50% acid with 50% hydrogen peroxide.
In total I had to make 3 attempts to get the PCB done but then I finally got one that was good enough to continue with the project.
Here are some very helpful tips:
- Important: Do it in a very well ventilated area and if possible use a mask for your mouth/nose, don’t forget the latex gloves and the protective glasses! You don’t want acid in your eyes 🙂
- Important: When mixing the acid with the hydrogen peroxide, always pour the hydrogen peroxide first. This way if any drops of etchant jump out while you pour the acid, they will have a smaller concentration of acid.
- Do it in 4 steps:
- Toner transfer the first part;
- Toner transfer the second part, carefully aligning it with the first, cover the other side of the PCB with tape or vinyl, etch it and clean it;
- Drill 3 or 4 guide holes;
- Toner transfer the third part, carefully aligning it with the first or second;
- Toner transfer the fourth part, carefully aligning it with the remaining three, cover the already etched side with tape (both sides) or vinyl, etch it and clean it;
- Closely watch the corrosion process and if the toner is coming out somewhere, stop the corrosion, clean it, dry it, fix the traces with a sharpie and then resume;
- To align between parts on the same side, cut an X in a regions where one of the parts is on top of the other and fold the tips outwards. Then align the traces of the PCB with the lines in the folded parts.
- When using guide holes to align between both sides, use a light on the other side of the PCB to see if the two layers are aligned.
NOTE: Some of the photos in this part are from one of the early revisions of the board, but they serve the purpose of showing the PCB making process.
Once I got the PCB etched, it was time to drill all the holes for the through-hole components and vias. This step also took some time but was fairly easy to do, specially with a small bench drill. I took a 0.7mm drill and put it into the bench drill and proceeded to drill all the vias and all the leaded component holes. To make it easier I used KiCAD to print a PCB without any traces, just with holes and then marked every hole as I drilled the PCB. Since there were lots of holes to drill, it was easy to skip a few if you didn’t do this. I provide all this helpful files in postscript format here.
Once finished, I took a 1mm drill, put it into the bench drill and proceeded to drill all the switch holes and also the programming connector holes near the micro USB ports.
After this super fun step where I had to make a bunch of wholes in the PCB, it was time to go into an even more super duper fun step… wire all the vias! (/irony). Although this was very easy to do, it also took some time. To do it I took a piece of scrap multifilar wire and removed the insulation. Then took 2 or 3 thin wires, rolled them around each other and then inserted them in a via hole and solder them in both sides. Afterwards I cut the excess and repeated for all the via holes in the PCB. Once again, having a sheet with all the hole locations printed helps keeping track of which vias have already been connected.
Finally, it was time to solder all the components. I followed the component placements in the KiCAD PCB file and started with the SMD components like the microcontroller, eeprom, charge-pump regulator, micro USB ports, SMD resistors and capacitors, WS2812B LEDs and only then proceed for the diodes and the programming connector. I took special attention making sure I soldered the WS2812B LEDs in the correct position, since their orientation can be tricky to figure out. Looking at the datasheet to confirm is also useful.
The diodes had to be soldered on both sides of the PCB, since their leads are also used to connect traces in both sides of the PCB.
If you’re wondering why we need the diodes, they are necessary to prevent something called ‘ghosting’. Ghosting is when you press two keys and the keyboard doesn’t know which keys you’re pressing. Why and when does this happen? Well, the keyboard is a big matrix of switches, and as all matrixes, is composed of lines and rows. If there are no diodes, when you press two switches on to different lines and two different rows, when the microcontroller reads the matrix there are four key possibilites, instead of 2, and it can’t tell which ones are correct.
Let’s consider an example: assuming you have a QWERTY keyboard, imagine you press ‘Q’ and ‘S’. If there are no diodes, the microcontroller will not know if you’re pressing ‘Q’ or ‘W’ and also doesn’t know if you’re pressing ‘A’ or ‘S’ because ‘Q’ and ‘A’ and ‘W’ and ‘S’ are in the same columns and same rows. The diodes prevent this from happening since they isolate each column or row from each other.
Soldering tip: for SMD components like the microcontroller, the EEPROM and the Charge Pump controller you can use a technique called drag soldering that is very well explained in this instructable: How to Solder SMD ICs the easy way!
The PCB was finally done! 🙂 Time to connect the “extra” devices 🙂
Are you enjoying this project? Follow the link to continue reading and for the full set of photos of the build: [HacKeyboard, an open hardware mechanical keyboard – part VI]
Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! 🙂