So the idea was to use an Arduino Leonardo clone that can emulate a mouse or keyboard and then program the keyboard sequences to be triggered from the press of a button. Initially I was going to do just the copy, cut and paste but as I was going to use the standard 5cm x 5cm Seeedstudio PCB service I thought I could add some more buttons.
I decided to do a PCB with six momentary push buttons, mainly because they were what I had in my box of components.
The botom row, blue, black and white buttons are copy, cut and paste respectively and I assigned the red, amber and green buttons to change the background colour of Excel cells to match the button colour (this was a request from another friend at work who uses Excel a lot)
The buttons could have any combination of key-presses assigned to them I suppose, 'Ctrl+Z' for undo etc.
Circuit Diagram
The connections are a bit out of order due to pinswaps on the PCB! |
I used the "Sick of Beige" 50mm x 50mm PCB template from Seeedstudio as I intend to use their Acrylic laser cutting service to create a top and bottom box to house the keyboard.
Keypad Concept |
Due to space availability I placed the Leonardo PCB on the underside of the PCB, this did mean that it was a bit fiddly soldering the pins for the Leonardo as I didn't want any pins sticking through the PCB into the body of the switch so solder the pins first and make sure they are flush with the button side surface, NOT protruding.
Make sure the pins don't go too far through. |
The pins can be trimmed |
Everything is powered by the USB lead plugged into the PC and there is an optional SMD or 3mm TPH LED on the button side that connects to a PWM capable IO pin, I set this to indicate power at 7% duty cycle and then pulse to 78% duty cycle for 50mS whenever a key is pressed.
I've ordered the acrylic tops and bottoms from Seeedstudio but they've yet to arrive.
All the files, including the Eagle schematic, PCB, gerber files and the sketch are here.