Hello fellow 'instructablers'! In this instructable I'll present you a brand new project that I’ve just completed. In fact, I’m using the project itself to write this instructable. I present to you the amazing, the fantastic, the magnificent… HacKeyboard!
What is HacKeyboard?
It looks like a computer keyboard, and it is, but not an ordinary one. It’s story and hidden functions add a lot more to it. “Under the hood” you’ll find that this keyboard has:
Oh, and should I mention that it was built using parts from old keyboards, making it very cheap to make? :)
In the video you can see it in action! :)
As mentioned in the previous step, any of the special functions of the keyboard can be used without requiring any special software. Everything is done using key combinations. On the top right corner of this keyboard there is/was the Pause/Break key, which maybe 99,9% of the current computer users never used nor know what is it used for. Well, I know what it can be used for but I don’t use it, so I replaced it with a Power key, the key that makes the magic happen in this keyboard. Once you press Power, the keyboard enters a power mode where you can use some other keys to use the special functions of the keyboard. Here’s the list of key sequences to use the special commands:
Save macros:
Play macros:
Activate/Deactivate keylogger:
Play the keylogger log:
Activate/Deactivate the hidden internal 8GB USB storage:
Changing colors:
The video above shows all the functions in detail.
Some time ago I was given a small lot of old computers and computer peripherals and among the peripherals there was an old IBM Model M2 keyboard with buckling spring switch mechanism and Portuguese layout. The “click, click click” of the keys just made me remember the old keyboards that almost sounded like old typewriters. If you were born in the 80s or before you know what I’m talking about. The keyboard had a PS2 connector, which I plugged into an old desktop computer. It worked perfectly and I thought my usual desktop keyboard was just going to be replaced as soon as I manage to buy a USB to PS2 adapter. However, once I got one and tried it I became disappointed because the “<>” key didn't work. I got another converter and no luck either. Maybe those converters aren't just made to be used with keyboard with Portuguese layout.
In the meantime, I started to investigate a little more about keyboards and found out that there are communities like GeekHack and Deskthority with endless discussions about mechanical keyboards: new products, vintage keyboard collections, keyboard mods, DIY keyboards, etc. Who would have guessed? While browsing those forums I just saw some amazing tenkeyless compact mechanical keyboards and then I just decided that I wanted to get one! However, I soon became disappointed to find out that at that time there wasn't a single Portuguese tenkeyless keyboard being manufactured. It seems like the Portuguese market is to small to be profitable enough for manufacturers. Even when talking about normal mechanical keyboards with Portuguese layout, I think there are only 3 or 4 and only half of them have a real Portuguese layout since the others seem to have been adapted from another language because some keys have a different size and a few symbols are in different positions. Oh!… and there’s a common thing with mechanical keyboards… they’re pretty expensive (from 90€ upwards)! So, I found myself in the situation that I really wanted a product that I couldn't buy anywhere at that time. It seemed like the end of the road, but it wasn’t… We live in an era where information is freely available online and digital fabrication tools are making their way into the homes of common people. As a Maker, the solution as simple: “I’ll just make my own”, I decided.
Most keyboard that you find on stores nowadays (basically all of them except the high-end gamer products) use a silicone membrane with a silicon dome under each switch, having each dome a small contact that will trigger the keypress once you push the key down. After some time of usage the contact gets wasted and sometimes you have to push the key down harder to make a keypress.
Differently, mechanical keyboards use actual, physical switches underneath the keys to determine the user has pushed a key. When you press a key, you press it's switch down. When you press the switch down, the keyboard sends a signal to the PC telling it that you pressed that key. These switches are far more durable than the rubber domes and have two very important features: a 'click' sound that provides direct feedback to your ears and a mechanism that automatically pushes the switch down once you push it to a certain point. Unlike rubber dome keboards, where you just know that the key has been pressed when you look at the screen, with mechanical keyboards you have tactile and audible feedback that let you know that the switch has been pressed for sure. There are some claims that due to this direct feedback, you can type 30% faster with mechanical keyboards. There are also other claims that say that you get less 'finger fatigue' with mechanical keyboards because the mechanical switches do part of the pushing down force for you, but you probably only need to worry about this if you're a programmer or professional gamer.
Among mechanical keyboards you can find several types of mechanical switches, being the most common nowadays the Cherry MX switches. You can find them in several variants, having each a different type of audible and tactile feedback. These are the switches you find in expensive high end gaming products that are available in the stores. Since they are still manufactured you can buy individual switches and keycaps in several online stores.
Another type of switch that was very common was the ALPS and the SMK Alps mount switches. You can find these in many old keyboards. Some of the keyboards that I know that have them are the Siig Minitouch, the Monterey K108, and the Focus-2001. I'm sure there are many more, but these are just the ones I know of at the moment. I actually like more the SMK Alps mount switches than the Cherry switches. However, unless you find them on old keyboards I never found any store that sells the individual switches nor keycaps for these kind of switches.
There are also other variants of mechanical switches like the Topre, the buckling springs, and others, but I'm sure you can find more information in the links below if you're interested in this topic :) .
More information here:
http://www.pcworld.com/article/242037/mechanical_keyboard_faq_pick_the_right_switch.html
http://www.pcworld.com/article/240939/mechanical_keyboards_should_you_switch_.html
http://lifehacker.com/how-to-choose-the-best-mechanical-keyboard-and-why-you-511140347
Now that you know a little bit about mechanical keyboards, let's get into building one from scratch :) As with all projects, safety first!
Please pay attention to this step, it is very important, if not the most important step in this instructable. :) During this process you will need to use some tools and chemicals that may be dangerous and harmful if you don't take appropriate safety measures.
For this project you will need various tools but you don't need to have all of them. If necessary it may be easier and cheaper to just pay for some cutting or etching services. Here's the list:
Keyboard parts:
Protection:
Soldering:
Isopropyl alcohol (optional)
Machining:
Chemicals:
Others:
Software:
Note 1: In case you have access to a laser cutter, all the equipment with this note are not necessary because the laser cutter can be used to replace them all. If you have access to one, the project will be a lot easier, faster, safer and will come out a lot more perfect. Throughout the instructable I'll mention where a laser cutter would be specially useful. A laser cutter is a huge plus in this project! Having one would have been a great help.
Note 2: In case you have access to a laser cutter, you can use extruded acrylic, which is cheaper than cast acrylic. The laser cutter will cut it just fine without any melting problems.
For this project you will need several electronic parts. All of them are very affordable and although most of them are SMD parts do not be afraid of not having the required skills to solder them. It's actually quite easy :) I find it even easier and faster than soldering through hole parts. Later in this instructable I'll also provide some references to other instructables that contain some very good tips and tutorials on how to do it.
Here's the component list:
I bought most of the stuff on ebay. In case you're a student you can use your school/university email to order free samples of the Microchip and Maxim parts, which are the 'less cheap' parts.
To make a mechanical keyboard the first things you have to get are the switches and the keycaps.
I started looking for switches and keycaps online but once again I ran into some problems to source the components. The only switches that I could find were the Cherry switches, which can be bought in several varieties (no click, more clicky, less clicky, etc.) but they’re pretty expensive (I don’t recall the exact prices but it was about 1.5$ per switch, plus shipping) and a keycap set could cost about 40$ plus shipping and I couldn’t find a keycap set with portuguese symbols printed on them. I could try to buy a set with blank keycaps and then try to engrave them in my TheMaker2 CNC but the amount of money I would have to spend plus the time I would have to work on it made me give up on the idea of buying every single part. It would even be cheaper to buy a complete mechanical keyboard with portuguese layout just to get the Cherry mechanical switches and printed keycaps to make the tenkeyless keyboard.
The solution for this, as mentioned in this step's title is to gather old keyboards.
You can get lucky and get a keyboard that has both or you might need to get some until you get the switches/keys/colors/layout you want for your keyboard. There are various places where you can get them:
As I mentioned before, I managed to get an old Monterey K108 (I actually got two of these :) ) with SMK Alps Mount switches and an old NGS keyboard with the layout that I desired (Portuguese) and ALPS compatible keycaps. All of them for free! :)
This step is very easy to do :) Just remove any screws from the old keyboards, open it and then desolder all the switches using a soldering iron and a desoldering pump. Be careful no to break the pins. I noticed they can break if you bend them too much. In one of the pictures I show you how it is inside. This switch was not "clicking" so I decided to open it up to see what was wrong. It turned out to be a small metal piece that was not bent as it should. I just fixed it, closed it and it started clicking again :)
This is an optional step that you can do if the keycaps from the old keyboard are too yellow. The plastics of the housing of many electronic devices contain a fire-retardant component called Bromine that is responsible for the "yellowing" of the plastics when in contact with light and oxygen. That's why if you keep your vintage electronics closed in a box they won't change color as much as if they are exposed to those two components. In a simple way, this component sort of removes oxygen from the plastic to prevent fires and by removing oxygen the plastic changes color.
It turns out that some clever people who love vintage computer came up with a solution to reverse the plastics back to their original color. In a simple way, they found a way of returning the oxygen to the plastic.
There are several variations of the recipe and although I didn't need it for this keyboard I have tested one of them with success in some keys from other old keyboards. Here's what I did:
The keycaps that I used for this test were only slightly yellow but even so I noticed improvements.
Since the keycaps are very small I also tried putting them into a transparent water bottle with hydrogen peroxide exposed to UV light for a few days and I also noticed some improvements on the color of the plastic keys.
I only provided you with a very short description of the process. If you think this step is necessary for your keycaps I recommend you to read this great instructable: Retr0bright, how to turn a yellow Gameboy white again: The EASY way!
The keyboard case design was inspired in some other keyboard designs I saw online. I decided to go for a simple case with 4 layers of plexiglass/acrylic: top layer, 2 middle rings and bottom layer. The top layer need to be machined to have square cutouts to fit all the switches. Using a digital caliper I measured all the different keycaps and the switches dimensions and then I started designing the top layer in FreeCAD, which is a great open source 3D design software. Once I finished the top layer, I designed the middle rings and the bottom layer, which were a lot simpler. The bottom layer is just the same as the middle rings but without the inner cutout. You can get my FreeCAD files here and modify them to suit your own ideas. If you want you can also get the keyboard layout in vectorial format here.
Once you finish your design, you'll want to export the designs as .svg or .dxf files, which are the files used by CAM (Computer Aided Manufacturing) software.
To cut the acrylic plates you have to options
In my case, I used my homemade CNC, TheMaker2 (instructable here).
I started by importing the .svg files from the previous step into HeeksCAD and generated the toolpaths using the Profile operations (HeeksCAD files here). Then I placed the cast acrylic plates in my CNC machine and put hot glue around them to hold them steady in the CNC table. Since it would be the longest CNC machining I had ever done and I didn't have any leftover acrylic to retry in case something went wrong, I defined the toolpaths to make the cut in several small Z steps (0.5mm) and a slow feedrate. The machining of the front plate alone took 6 hours. The middle and bottom layers were much faster. It took some time but the resulting plates were great! :)
Remember, if you try to follow the same procedure, make sure you get cast acrylic, not extruded acrylic. Cast acrylic will be machined just fine, without melting. On the other hand, extruded acrylic will melt around your cutting bit, which is something you do not want to happen.
Having access to a laser cutter would have reduced the machining time to just a few minutes :)
Since I used an endmill with a 1.5mm radius, the inner corners of the cutouts for the squares also had a 1.5mm radius. To fit the switches the corners had to make a sharp 90º angle. To fix this I used a small file in all the corners (yes, I had to manually file 89x4 = 356 corners :) )
At this point I tested all the parts I had ready so far to see if everything was fitting as planned and no mistakes were made. I inserted all the switches and keycaps in their places and stacked the four layers of acrylic to check for any errors. I also got a first vision of how it would look and feel and was pretty excited with the result so far :) Everything was perfectly aligned and looking good :)
When you reach this point, if something is not correct, fix it and only then proceed to the next step.
I proceeded to glue the two middle layers with super glue. In this step it is very important to be careful to glue them perfectly aligned. If I had 6 mm acrylic available I could have made a single ring instead of two, which would avoid gluing and would look a little better.
After having the acrylic layers glued I marked some spots to drill the mounting holes in all the layers and used the drill press to drill 2mm holes only in the bottom layer and in the two middle layers. I didn’t do this step in the CNC because I didn’t have any 2mm cutting bit at that time. I made a total of 10 holes:
If you use a laser cutting service, you may put the holes in the design before cutting and you can skip this step. Remember, do not drill the top layer at this point, only the bottom and middle layers.
In the top layer I used the Dremel to make some pockets to fit some M2 nuts at the same positions mentioned in the previous step. The remaining space around the nuts was then filled with epoxy resin, which also held the M2 nuts in place. To prevent the glue from getting into the thread of the nut, I placed the screw inside the nut before applying the glue.
When the glue was completely dry I removed the screws and filed the excess glue until the surface was leveled with the acrylic. Afterwards, to remove any remains of glue from the thread of the nut I used a small drill an manually rolled it inside the nut.
I didn't want the heads of the screws to show outside the acrylic plate since I didn't find it aesthetically pleasing. To fix that I used the drill press to open little bores for the heads of the screws in the bottom layer. When doing this you must be careful because you can go only at 2 mm of depth. Otherwise you'll just drill through the acrylic plate, which is something you don't want.
When I previously pre-assembled the parts I verified that the Enter key could jam a little bit if pressed in the corners. Since the key is big and the switches are not made to be used with side forces, it could be uncomfortable to use. To solve that I decided to add some clips to the bottom of the key to apply a stabilizer, just like the ones used for big keys like the Space-bar and the Right Shift keys. This clips are used to fit a piece of metal that distributes the force applied to long keys, so that the force is also applied vertically, even if you press the key in the corner. To make the clip holders I used a piece of rigid PVC and small files and saws. I tried my best to make them similar to the ones in the Right Shift key that you can see in the photos. I did them manually because they are very small and I had no other way of doing them. If I had a 3D printer at that time I would surely design and 3D print the clip holders. If I had a laser cutter, I could make them laser cut as well in no time. To make the metal clips I used a paperclip and some small pliers to bend them accordingly. When ready, I glued them to the bottom of the keycap with epoxy glue.
At this point it was time to place the key stabilizer clip holders in the top layer, which were removed from the original Monterey K108 keyboard.
To place this clip holders in the top layer, once again I used the Dremel to open some pockets in the approximate positions, placed the clip holders inside and filled them with epoxy resin. To make sure the clip holders stayed in the correct position, I mounted the switches and keycaps for these keys with the metallic clips in place while the epoxy resin was drying.
Once the glue dried, I removed the switches and used a craft knife and some small files to remove the excess glue.
Since below the space-bar there were to aligning plastic pieces, I also had to make some small guide tubes for them, which were also glued in place with epoxy glue. The guide tubes were made of some PVC rod drilled in the middle. To make sure they were glued in the correct place, I placed the space-bar key in place, pressed it a few times to align the guide tubes and then let it the glue dry. Once dry, I removed the key and the switch.
Finally it was time to make it pretty, instead of a mess of scatched acrylic with holes and glue :) .
First I assembled the hole case and use an electric sander to remove small misalignments between layers. I wanted it to be perfect! :)
So, to hide all the Dremel made pockets and epoxy glue, I used carbon fiber vinyl to cover the top and bottom layers. To apply the carbon fiber vinyl I used a heat gun to heat it and then slowly stretched it until I covered the acrylic layers. A hair dryer could also be used, but I didn’t have any in my home lab :) .
When applying the vinyl you have to be very patient, specially in the top layer, which has some protruding parts. Take it slow, heat it a little bit and stretch it well and if you see bubbles appearing, pull it a little bit back and retry. Take your time and be gentle. If you’re careful you can even wrap it around the edge to the back of the plate without any wrinkles.
Once you manage to wrap it around the edge, take your craft knife and cut the excess in the bottom of the plates. In the top plate, also use the craft knife to cut away all the 89 squares.
It was finally time to assemble the case and apply rubber feet to the bottom. The rubber feet I used can be found in any hardware shop. I used three small rubber pads in the bottom and two big rubber pads in the top to give the keyboard a little slope.
If you are following this instructable and building your own keyboard, now is the time to put the switches in place, grab a sandwich and a drink and appreciate your own work while you regain energy for the electronics part :) The mechanics part of the keyboard is mostly done and there's only one little thing left to do after the electronics part is ready.
In the beginning of this instructable I provided a list of components that will be used in the electronics part of this project.
Just as extra information, the list of components provided is the result of three iterations of the schematic and PCB. To reach the final design I designed three versions of the schematic, three versions of the PCB, manually fabricated three huge double sided PCBs, including drilling, vias and soldering components. It took me some time to do all of this, but I didn't give up and reached a final working design.
Gladly for you, you won't have to go through all of it since now the working design is fully open source and you can just use it it or work on it to make your own modifications (different switches, different layouts, extra features, etc.)
As previously mentioned, I used KiCAD for the electronics and PCB design. All the KiCAD project files and schematic and PCB in PDF format can be downloaded in my Github.
Brief explanation of the electronics: HacKeyboard has a single microcontroller, the PIC18F4550, which has built-in USB. The word 'microcontroller' and the reference 'PIC18F4550' may seem complicated or strange but it is basically the same kind of thing as the ATMega328 that you find on Arduinos, but from a different manufacturer, with a different architecture and different built-in features. Having that said, the microcontroller is responsible for managing and controlling everything on the keyboard:
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:
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 other great instructables that other users have made and that are very, very well explained:
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 run into several problems:
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:
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;
Or... all of these problems can be avoided in a very simple alternative method:
NOTE: Some of the photos in this step are from one of the early revisions of the board, but they serve the purpose of showing the PCB making process.
This step will also take some time but is fairly easy to do, specially with a small bench drill. Take the 0.7mm drill, put it into the drill press and proceed to drill all the vias and all the leaded component holes. It helps if you go into KiCAD and print a PCB without any traces, just with holes and then mark every hole as you drill the PCB. Since there are lots of holes to be done, it's easy to skip a few if you don't do this. I provide all this helpful files in postscript format here.
Once finished, take the 1mm drill, put it into the bench drill and proceed to drill all the switch holes and also the programming connector holes near the micro USB ports
This step will also take some time, but again, is easy to do. Take a piece of scrap multifilar wire and remove the insulation. Then take 2 or 3 thin wires, roll them around each other and then insert them in a via hole and solder them in both sides. Cut the excess and repeat 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.
Now is the time to solder all the components. I recommend following the component placements in the KiCAD PCB file and starting with the SMD components like the processor, eeprom, charge-pump regulator, micro USB ports, SMD resistors and capacitors, WS2812B LEDs and only then proceed for the diodes and the programming connector. Make sure you solder the WS2812B LEDs in the correct position, since theire orientation can be tricky to figure out. Look at the datasheet to confirm.
The diodes must 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 processor 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, image you press 'Q' and 'S'. If there are no diodes, the processor 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!
We're almost done with the electronics :) Now it's time to prepare the USB Hub. You should try to find a hub similar to the one shown in the pictures on ebay since they have a low profile and a small PCB with no soldered connectors. They're very cheap (probably the cheapest), very common and very easy to find. Here's the step by step of what you have to do at this point:
Now that we have prepared the USB hub, let's attach it to the PCB. Find a nice spot without any solder blobs and glue it to the PCB with hot glue. If you think it's necessary, you can put a layer of tape below to prevent any short-circuits.
After gluing it in place, the wires should be soldered on the right place:
One of the photos clearly shows all the connections and you just have to do the same thing :)
This step is very simple, but once again you must be careful:
In this step it's necessary to find a small spot to glue the USB drive to the PCB. In this case, since we're dealing with a double sided PCB I recommend putting a piece of electrical tape or kapton tape in the keyboard PCB to prevent short circuits. Then you have to:
The photos in this step clearly show where each wire should go, in case you have any doubts :)
And you're done with the all the wiring and component soldering! :)
In this step you won't have to do anything. I'm just writing about it so that you know how the code was made.
I decided to use JAL to develop the firmware since I didn’t have a lot of time to get it working for Lisbon Mini Maker Faire. JAL, or Just Another Language, is a high-level language for a number of Microchip PIC microcontrollers that precedes the Arduino framework. As a curiosity, Massimo Banzi, one of the Arduino co-founders, was an early JAL developer. Another reason why I decided to try JAL was that there was a USB HID device sample code in JALlib that ended up making the first steps into developing firmware for a full keyboard much easier.
Before starting developing code I first did some research on how people usually do it in the other DIYkeyboard projects. AVR-Keyboard project on Github from Fredrik Atmer was particularly helpful as inspiration. Basically I ported the code to JAL with some changes and then added all the extra functions to HacKeyboard. A funny thing is that I had to write a function to control the WS2812B LEDs from scratch… funny because I did not have an oscilloscope to measure the timings on the output pins of the PIC18F4550 and had to basically guess the timings from the MCU operating frequency and instructions per instruction cycle. After a few attempts I managed to get it working.
You can check the source code in my GitHub, including the pre-compiled .hex file.
Optional: As I mentioned, you don't have to do anything in this step, unless you want to modify something in the code. In case you want to modify something you will need to download JALlib from the JALlib Github. To compile just use a command with the following structure:
$./(path to compiler) + (path to your .jal file) + (-s) + (path to JALlib libraries) + (options)
Example from inside the compiler directory:
./jalv2 file.jal -s ../lib/ -no-variable-reuse -no-fuse
Note: the variable -no-variable-reuse will use more PIC memory, but it will compile faster.
The command above is for the Linux command line but should be very similar for Windows.
At this point, the keyboard is almost complete :) . It has a case, it has electronics and know it just needs the code to make it all work.
In this step a PIC Programmer is needed. You can get them for very cheap on ebay.
Since the microcontroller we're using is not a PDIP package, we can't insert it into a ZIF programming socket that some programmers have. As such, we will have to use the ICSP (In-Circuit Serial Programming) interface which uses 6 pins:
Since we only need to upload the code once and it would make the PCB a lot more complicated, I didn't put any direct header for this programming interface. So what I did was to solder a wire to each trace connected to each of these 6 pins and connected them to the programmer, as can be seen in the photos. You can do the same and upload the pre-compiled hex file and then desolder the wires.
NOTE: In some previous steps I mentioned a programming header near the micro USB boards. This programming header is a serial interface only meant for development. What I actually did for development was to use the method described above to burn the Tiny Bootloader into the PIC (.hex file also available in my Github) and then I used the Serial programming header to program the keyboard. Why did I do this? Because it is much faster and easier to upload and debug the code using the serial interface. If you're planning on developing or tweaking the code for the keyboard, use this step to burn the bootloader and then check the next steps, which describe how to use the Tiny Bootloader.
This step is a repetition of the previous step, with the difference that you will upload the pre-compiled tiny bootloader .hex file that will make it easier to upload and debug the code.
By the way, in case you're wondering what is a bootloader, it is a very small program that sits in a specific position in the microcontroller's memory and allows you to upload new code to the microcontroller using a standard serial interface, instead of a more complicated programming interface.
So, what you have to do is follow the instructions on the previous step and burn the tiny bootloader pre-compiled .hex file instead of the pre-compiled hex file.
To use the Tinybldlin to upload new code to the microcontroller, download it from here, install it and run it. Tinybldlin is the version for linux but there is also the version for Windows.
Then Browse to select your desired hex file.
Connect a USB to Serial TTL converter to the Serial programming header and also plug it into a USB port on your computer.
Select the 115200 bps baud rate and the correct USB port and click on Upload.
If you connected everything correctly, you have just uploaded new code into your keyboard :)
In the pictures you can see some tests I did during the development of the code using the serial interface.
This step is optional but very important because one of the most important things to do is to Share What You Make! :) I couldn't complete the keyboard until Lisbon Mini Maker Faire 2014 but I took what I had anyway: the complete case and the three PCB iterations with a working PCB.
Although the project wasn't finished, it was very pleasing to share the project with other makers and with the visitors of the Faire. Having it with the PCB outside the case actually made it more interesting because everyone could see how a keyboard works. Even little kids were amazed to see it because for them a keyboard 'is just that thing that you buy on a supermarket' and never wondered how it worked. Using a small piece of wire I could simulate keystrokes and they could see the PCB outputing characters to the laptop screen and the RGB LEDs changing colors.
Some vintage computing enthusiasts that visited the Faire were also amazed with the keyboard and provided great feedback and great ideias for future projects.
I went there to share something but I think I got much more in return :)
Now that the PCB is done, it's time to put it into the keyboard case. However, to do that we'll first need to open a slot in the middle layers for the connectors. To open the slot, I cut a 27mm section from the second layer (counting from the bottom), 55mm away from the right edge of the keyboard. Actually, instead of cutting it, I used a file to remove enough acrylic until the connectors fit. Using the file takes more time but results in a straight slot.
Now that the slot for the connectors is ready, we can put the PCB into the case and solder the switches to the PCB. I recommend you to remove all the switches from the case and put them back in one by one, so that you can get their pins into the respective PCB holes. It will take some time but it will go by very fast. It's almost finished! :)
Now that all the switches are soldered, close the case, tighten the screws a little bit, connect the keyboard to your keyboard and be proud of what you've accomplished :)
If you managed to build your keyboard up to this point, you have just made what once was only possible in big factories with big machines and lots of workers. Better yet! You have made a keyboard with features that no other keyboard on the market has! :)
Now it's time to enjoy the RGB colors of the LED ring, the special features that will give you extra productivity while working / gaming and the great tactile and audible feedback of typing in a fully mechanical keyboard :)
Enjoy! :)
To conclude this project, once again I took it to a Maker Faire, this time Lisbon Maker Faire 2015 (no longer Mini and now one of the 4 Featured Maker Faires in Europe). This time I took the finished keyboard and once more I was very happy to share the project with visitors and other makers. Some of the visitors of the previous edition went to the Faire again and went to see the progress of HacKeyboard. Once again, more suggestions, more feedback and more ideas :)
In the end I was very happy and proud to be awarded with a 'Maker of Merit' award! :)
If you followed this instructable to make your own HacKeyboard and reached this point, Congratulations! You have just completed an extensive project that involves a wide set of maker skills :) .
Please share photos of your work in the comments section below. I'd love to see all the variations that may appear with different switches, keycaps, vinyl colors and textures, etc.
If there is something that you find unclear, please place your questions in the comments below so that everyone else can see them. I'll do my best to reply and update this instructable whenever necessary.
In this instructable I only used enough photos to explain the process of building the keboard. If you want to see more pictures, I have a public gallery with more than 440 photos of the build process here,
Also, feel free to visit my blog to check some of my other projects and tutorials: The Bit Bang Theory.
And don't forget, You Can Make Anything!
Share what you make :)
I have a small request to everyone who likes this project: please vote for me in the Tech and Make it Glow Contests :) Thanks!