Programmable Macro Keyboard with an Arduino Pro Micro (32u4), Cherry Switches + Stealth Foot Pedal

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
the Arduino Pro micro the one with the 32 you for chip on it is very handy at making generic USB HID devices keyboards being the crowd favorite here I'm a few light years late to this party but there's still much to talk about I was in the market for a custom macro keyboard to speed up workflow primarily an Eagle CAD and Inkscape if you've never heard of a macro keyboard well it's for shortcuts hotkeys multi key commands or inputs that are shortened into a single key press this speeds up workflow and makes some applications easier to use if not faster a general example is binding copy and paste ctrl-c and ctrl-v to single keys another example is making a hot key to open the windows calculator application there isn't a hot key shortcut built-in but if we know the keystrokes to get to it we can program that macro into a single key press because all the programming is done in the hardware this device essentially is plug-and-play for any Mac or PC platform I'll expand more on shortcuts and macro keys later in this video so a macro keyboard the existing options out there are good there's many DIY solutions but as always why buy it when you can build it for three times the cost this prophecy is especially true if you forget to label the other half of your nets like my first PCB batch I'll just put this over here anyway I borrow some of the best ideas and another revision later I ended up with this first off is the build cost flexibility you can populate the PCB with all cherry switches or generic 12 by 12 millimeter tack switches usefulness is the same coolness factor is reduced but so is the total cost in parts I wanted to add rotary encoders to this keyboard these are optional but very useful when you start to explore the realms of keyboard shortcuts if you omit them the footprint will only fit a 12 by 12 millimeter switch at the moment I didn't realize the 12 by 12 button fits in this footprint of the rotary encoder until later so this idea was quickly scrapped which is a smaller 6 by 6 millimeter button so another revision later anyway rotary encoders have you ever been in the middle of designing and wanted to jump back and forth between placement binding the arrow keys to the rotary cutter does exactly this it also makes her a crude at your sketch another obvious function is zoom in and zoom out these encoders have the button built-in so in this example I can zoom in and out with the plus and minus keys map to the encoder or press the built-in encoder button to go to a one-to-one scale neat another weird idea is to bind undo and redo to the rotary encoders this lets me jump back and forth between when I can't make up my mind regarding a design it also makes for a interesting way to make video footage as I can delete a bunch of stuff and step forward and backwards through time using the rotary encoder or this key map to it I think that's cool okay so admittedly these are just basic features what happens when you run out of hands for input devices use your feet this 3.5 millimeter stereo jack breaks out to buttons well technically just one because I don't know what I was thinking when I made this wiring diagram anyway just one button is routed to an external switch so say a foot pedal or just any button on the floor that you can hit with your feet it's very handy if you use your PC like a drum kit or need an abort button to make yourself look busy at a moment's notice warned that later when we program the macker the last feature I added is the mode switch and these status LEDs since we are programming this macro keyboard why limit it to just one application specific profile the mode switch will cycle between four profiles or as many as you can remember this printout is how I brainstorm shortcuts and reference what key does what until it's committed to memory the mode LEDs just cycle binary 0 1 2 & 3 again you could program more than four sets of application key macros but good for you if you can remember more than 4 sets of 16 shortcut buttons the rest of the tour features a potentiometer breakout I guess this could be a volume knob I haven't thought of what its useful is specifically for me the reset button is really helpful for programming the Arduino Pro micro when using HID modes so let's flip to the back side for some circuit level stuff since the rotary encoder and the 12 by 12 millimeter buttons are swappable and they share some of the same connections I made sure the option was there to keep the encoder lines open if you're using just the button this solder jumper keeps the rotary encoder signal path open since it shares the same path as half of the button to enable the rotary encoder signal pass you just have to solder the respective jumpers on the backside of the PCB this keyboard functions as a row column matrix so multiple key presses in one cluster could produce ghost keys without a diode you can solder a diode to every key if you'll be pressing multiple keys at once if not just solder the diode bypass jumper for each key and carry on I did add a resistor in line for LED backlit cherry keys why I didn't use a resistor array until now I'm just not sure my original intention was to make this compatible with both variations of the pro micro I'm referencing the one with the micro USB connector and the other one with a mini USB connector the mini USB connector is superior try and change my mind I didn't realize the mini USB from micro has a different IC package and therefore has a federal AO finally we have key caps standard key caps don't help much when keys have multiple uses assigned so blank keys would be better at the time of this video my blank key caps have not arrived in the mail so I decided to print them with a FDM printer this is an ender 3 Pro I am regretting why I bought green filament but anyway at 18 minutes per key cap and one day later I have this we can take this a step further and use an SLA printer printing 20 keys at once takes around 90 minutes however the post-processing is a bit of a chore the resin is very sticky so soaking the keys and isopropyl alcohol does dissolve the uncured resin after this they were still just a bit sticky so I let these sit and the Sun for another hour I'm just to note the resin is cured by UV light the results are pretty impressive for this print the layer height was point 1 millimeters for the SLA printer and 0.12 for the FDM so pretty close to the same layer height but the process of how these printers work reduce significantly different results but blank keys might not even matter you can also cut out the pictures of your shortcut icons and glue them to whatever key caps you have it's up to you so while I was editing this video some of the key caps that I was waiting on actually came in and those are these really flat shallow ones and along with these are for height clear caps it doesn't really matter the whole point of printing the key caps because well was because I didn't have any other than these like standard replacement ones with letters so I want a blank ones and if you do print them you can get pretty close to results to what you would actually order and if you have a printer I think it's actually cheaper just to print your own key caps if you can make do here's a side-by-side of like the key caps installed and based on height preferences and profiles it's really up to you with the freedom of 3d printing you can get you can definitely get the results you want but anyway I noticed most custom keyboards recessed their keys into a grid this definitely solves the alignment issue when soldering the Cherry MX switches I printed this jig to help the keys stay square with respect to each other when soldering it's still kind of a chore to solder these finishing touches include a little angled stand to add some razzle dazzle to the overall look and some rubber feet would also be fine as well let's talk about programming this bad boy keyboard H and keypad H are the bread and butter of this entire project the Arduino keyboard H library explains how keyboard functions are called and I mean specifically how to mimic a key press writing a character or pressing mini keys to create a macro however the keypad H library runs the show as far as pulling the Arduino inputs for a roll column matrix check out the built-in examples from these respective libraries and you'll be on your way the most helpful information from these resources are the keyboard key definitions shown here the next most useful being the commands like keyboard press print rights and the vitally important release command it's best to experiment by testing the behavior of these as you just guess and check and see what things do just be careful if you're experimenting it might be useful to have a master control to disable the keyboard in case you make a keyboard that constant locks your computer and you have no way to reprogram it let's talk hardware the row-column method is how we get 16 button inputs from 8 microcontroller pins that's 4 rows and 4 columns speaking of the 4 by 4 matrix layout this button panel is a quick way to get started I built my keyboard from the example sketch since this made sense to me at the time however the PCB I laid out evolved from a 4 by 4 grid pattern well I'm using the software setup for a 4 by 4 matrix or 16 total keys however my hardware is not in the literal 4 by 4 matrix it's about three rows give or take a button or two on each row it's still 16 keys total just with a unintuitive layout as far as the software is concerned my schematic has a sense of order but when I started arranging the components I didn't realize what chaos I was creating but I'm at the point of no return the lookup table based on the row columns looks like this but translated to my layouts it ended up looking like this I'm certain this will be confusing so let's move on the bare-bones code layout just cycles through our mode counter 0 to 3 and executes only these specified macro assigned keys inside that mode there's other ways to write this I'm getting there but this is what I started with whatever code you write I found it can be tricky to getting the timing just right when uploading to the Arduino since the Arduino needs to switch over to being a vanilla hid device and remain a--such there's a small window to upload a program after reset meaning after pressing the reset button on the Arduino there's a short period of time when it's in a bootloader state and will accept being programmed outside that window it will revert to its USB HID state which is good that's the whole point of this thing however if you miss that window the uploader will just throw errors at you and you might not know what's going on the reliable way for me and your results will vary was to hold down the reset until I hear the Windows Device disconnect jingle and then press upload when the IDE is around 80% compiled I release the reset button on the air you know 80% of the time it works all the time you don't have to be an application wizard to find this macro keyboard useful you could program some quick chat text for each key here's some of the rocket League quick chat text assigned to these keys lastly let's focus on productivity if you're doing work while at work and you need to quickly switch between work and work modes do it with the emergency footswitch mentioned earlier we'll use a couple macros to firstly minimize all applications that you're currently working on and then add a bunch of applications that essentially make it look like you're deep diving into important and busy work all at the press of a button since this is all tied to the press of a key there's no need to panic you're prepared for anything [Music] so what does this cost to build the cherry switched version is around $35 while the twelve by twelve millimeter tax switch button is around 21 here's a breakdown including part numbers for digi-key if you're not in a hurry of again getting most of these parts on eBay will save you something like forty to fifty percent cherry switches are around a dollar each and buying key caps doubles that unless you go custom which it's much more but that's the point of custom I guess here's some ideas while I was browsing the internet for stuff again you can print your own I'm getting sidetracked it's pretty easy to go down a rabbit hole here what am i doing with my life technically the one unit I built here is something like seventy five dollars this is known as the R&D cost which is me jumping the gun and ordering $45 worth of PCBs rot with my own mistakes half of that is shipping but shipping something dead-on-arrival is still funds spent in R&D economies of scale will bring my total cost down so you should buy PCB for me if you want one of these PCBs to make your own please see the links in this video's description I'll have more details regarding assembly and a build materials link below okay well here are some final thoughts this was fun it's definitely an ongoing but a pretty rewarding project as far as its usefulness this revision right here in the video Rev 3 it wasn't a total loss the foot pedal breakout still works only one button works as intended the other one well you need a bodge wire to essentially get to it or I'm using my grandma but I slayed her PCB which just breaks out the TRS jack and with some bodge wires you can get both both buttons functioning I just whatever I was doing with that schematic I ended up switching the common to this pin and well that was dumb so that needs to be fixed this board does support three millimeter LEDs that are for backlighting the actual keycaps but if you don't want to do that the layout does support surface mount LEDs and that's what it looks like if you have clear Cherry MX switches and you want to eliminate the keys this is fine the resistors for each LED have to be soldered on individually and that can be a with a resistor ray I see package but right now the even with thermals the pads dissipate so much heat it's it's very hard to solder the one side of this resistor so that needs to be fixed either way going forward finally I'd like to take the rotary encoder footprints and just Vanessa in a way that you can actually put regular key switches here so it becomes a 13 keypad ad that's just what the numbers work out but I know it can be done it just requires some messing around with the packages as far as for both footprints well thanks for watching everyone hopefully you learn something and I'll see you next time
Info
Channel: Ryan Bates
Views: 123,814
Rating: undefined out of 5
Keywords:
Id: acJ6gufBN_A
Channel Id: undefined
Length: 14min 54sec (894 seconds)
Published: Fri May 01 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.