nbaptist16 / yampad2

Yeah, it's an Automated Mechanical numPad πŸ˜›

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yampad_top

QMKYAMPAD v2


An automated macropad based on the world-famous YamPAD by mattdibi


Inspired by the technology of player pianos, this self-typing keyboard is able to receive and recognize a string of commands, such as a password via loaded text file, and enter it on its own via a series of controlled servo motors while still remaining fully functional as a standard keyboard.

Project completed as MSR Winter Project '21

Construction:

Components

Electronics:
β€’ Mini Maestro 12-Channel USB Servo Controller
β€’ TowerPro RC 5V Servo Motor (x5)
β€’ Pro Micro - 5V/16MHz
β€’ 0.91" OLED Module 128X32 LCD LED Display Module IIC
β€’ 1N4148W-13-F Diodes, SMD(18 pcs)
β€’ MLCC SMD/SMT 16V .1uF X5R 0805 10%(9 pcs)
β€’ AA Battery Holder
β€’ MX Kailh Sockets(18 pcs)
β€’ YamPAD PCB (ordered here)
β€’ Mini Maestro 12-Channel USB Servo Controller
β€’ Mini Maestro 12-Channel USB Servo Controller
β€’ Mini Maestro 12-Channel USB Servo Controller
β€’ Mini Maestro 12-Channel USB Servo Controller
β€’ Mini Maestro 12-Channel USB Servo Controller
β€’ Mini Maestro 12-Channel USB Servo Controller
β€’ Mini Maestro 12-Channel USB Servo Controller
Hardware:
β€’ 12" x 12" x 3/8" Acrylic Sheet
β€’ 12" x 12" x 1/8" Acrylic Sheet
β€’ 12" x 12" x 1/4" Acrylic Sheet
β€’ 6-32 x 2" Phillips Drive Flat Head Machine Screws(x5)
β€’ 6-32 Machine Screw Nuts (x15)
β€’ M2-0.4 x 12 mm DIN 912 Hex Drive Class 12.9 Socket Head Screws (x10)
β€’ M2-0.4 DIN 934 Class 8 Hex Nuts (x10)
β€’ Binder clips, small (x3)
β€’ Mounting tape
β€’ Standard sewing thread (the thin stuff)
Keys:
β€’ Cherry MX Red Linear Platemounted Keyswitch (10 pack) (x2)
β€’ KIT21 (purple) DSA Blank Keycaps 1U (10pcs)
β€’ KIT21 (white) DSA Blank Keycaps 1U (10pcs)
Optional: β€’ Assorted jumper wires
β€’ Sewing kit
β€’ Screwdriver set


Assembly

The different layers of the assembly (please see figure 2) should be cut out first via laser cutter. The thickest piece (the main PCB housing in Figure 2) must be machined a little to create a pocket for the PCB and its surface mounted components according to the drawing that can be found here. Also be sure to cut out a little space for the usb to fit, as seen in the drawing, with the band saw. File down the edges as needed. Once that's done, you can solder up the PCB with all of its components (diodes, capacitors, pro micro, reset button, and LCD) and pop it into the main PCB housing.

Perhaps the trickiest part of this entire project is the threading of the keys. Using a needle and needle threader helps significantly here, but it is also possible to thread everything without such tools. (Fold a portion at the end of the tread and twist it a bit to the point that it fits through the key switch/servo horn holes.)

The thread should be divided up into N pieces, each 9" long, where N is the number of keys that with auto-type capabilities. The desired N key switches are disassembled (most easily with the use of a flathead screwdriver (as seen in the demo video), but this can also be done without a screwdriver) and threaded. Once the desired keys are threaded, the ends of each string are threaded through the corresponding holes in the pcb (as seen in the example below).

fig1

Figure 1. Strings (black) threaded through preipheral holes while center of switch (yellow) and leads fit through remaining holes; PCB image generated by OSH Park

Once the thread ends are through their respective holes in the PCB, they are threaded through the bottom plate (please see Figure 2) and the designated servo horn (please see Figure 3).

fig2 fig3

Left: Figure 2. Layer guide for assembly   Right: Figure 3. Servo layout guide*
* Note: The arrows are pointing in the direction that the horn faces outward radially from the motor. More servos can be added and rearranged if the user desires for more automated key capabilities

Once the key switches, top and bottom plate, and main housing are all relatively together, the servo motors can be fitted into the servo mount layer and screwed in with the M2s. Fit the servo horns on the respective motors and screw them on tight before combining all layers together with the 6-32 screws and nuts. Be careful to keep the strings together and threaded through the servo horns!
Finally, tape and clip those strings down so that they are taut, but not noticably pulling down any keys.

Note: please see the title picture for an example of a finished result.

Keyboard Flashing

For LINUX, the flashing portion of the keyboard can be done through the following steps:

Set up a QMK environment on your computer by following the steps listed here.

Clone the yampad repository in a new workspace using the command git clone https://github.com/mattdibi/qmk_firmware.

Change your directory to the qmk_firmware directory with the command cd qmk_firmware. When inside, checkout the yampad branch with git checkout yampad.

Copy the ./keyboards/yampad directory into the ~/qmk_firmware/keyboards directory with the command cp ./keyboards/yampad ~/qmk_firmware/keyboards.

Change directory back to the the qmk_firmware directory with the command cd ~/qmk_firmware.

Run the following commands:
qmk compile -kb yampad -km default make yampad:default:avrdude

It will likely ask you to "reset your controller now...". If you were able to properly solder on the reset button, press that. If you're like me and forgot to solder on the button, no worries. It should work as long as you touch the RST to the adjacent GND pin. (But be careful not to touch any other pins! That poses the danger of shorting something.) The output should look like this:

flashoutput

This process can also be done on Windows and Mac. They should all be about the same, as seen in the windows screenshot attached below:

windowsout

Note: to flash the keyboard on windows, you will need to install QMK MSYS, which you use to run the terminal commands.

If you are having trouble finding the port, it could be that you shorted something when trying to reset the controller. If you can find the port, but are having trouble using the above mentioned commands (qmk compile -kb yampad -km default and make yampad:default:avrdude), consider running:
(qmk compile -kb yampad -km default
) (qmk flash
) cd qmk_firmware
qmk flash -kb yampad -km default

altflash

Automation

The python scripts provided require the maestro.py file to be in the same directory as the file being run. The easiest way to run the program is likely through a text editor such as VS Code. A few additional installations are required. The commands and outputs are shown in the image below.

maestroinstall
keyboardinstall

To run the text reading script (reads in a .txt all numbers from 0 to 9), use the maepy_read.py script and enter the filename to include the path (as seen in the demo)
To run the key input reading script, follow the same steps as with maepy_read.py, but substitute maepy_type.py.
You can recalibrate the servos if they get too twitchy with any of the init files. (If they are too twitchy, try increasing the voltage input to the maestro. I typically use 6V).

About

Yeah, it's an Automated Mechanical numPad πŸ˜›


Languages

Language:Python 100.0%