# Mini VOTE Keyboard

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/093/578/medium800/projects_finished-grey-angled-cropped.jpg?1595927107)

This guide will show you how to build a **mechanical keyboard** designed for typing one thing only - “VOTE”! Perfect for responding to heated political debates on social media, or simply reminding friends & strangers of the most important action they can take as citizens of a democratic society. Bonus – anyone named Veto or Tove can use it to type their name as well.

## What you’ll need
### Parts
### Part: 1N4148 Diodes
quantity: 6
Small Signal Diodes for switch matrix
[1N4148 Diodes](https://www.adafruit.com/product/1641)

### Part: Trinket M0
quantity: 1
Microcontroller Board for running CircuitPython code
[Trinket M0](https://www.adafruit.com/product/3500)

### Part: Black Nylon Screw and Stand-off Set
quantity: 1
For raising PCB
[Black Nylon Screw and Stand-off Set](https://www.adafruit.com/product/3299)

1 x Printed Circuit Board

8 x Mechanical Keyswitches, Cherry MX compatible, PCB mount type

5 x 1u Keycaps, Cherry MX compatible (see notes below)

1 x 3u Spacebar Keycap, Cherry MX compatible (see notes below)

### Tools
### Part: Flush Cutters
quantity: 1
For clipping excess leads
[Flush Cutters](https://www.adafruit.com/product/152)

### Part: Soldering Iron
quantity: 1
For making connections
[Soldering Iron](https://www.adafruit.com/product/180)

### Part: Solder Spool
quantity: 1
Solder Wire - 60/40 Rosin Core
[Solder Spool](https://www.adafruit.com/product/1886)

### Part: Panavise Jr. - PV-201
quantity: 1
PCB vise for soldering
[Panavise Jr. - PV-201](https://www.adafruit.com/product/151)

### Part: Micro USB Cable
quantity: 1
For programming Trinket M0
[Micro USB Cable](https://www.adafruit.com/product/2185)

## Key switches
![](https://cdn-learn.adafruit.com/assets/assets/000/093/528/medium800/projects_keyswitches.jpg?1595845943 two PCB mount keyswitches (left) and one plate mount keyswitch (right))

The PCB is designed to be used with Cherry MX compatible [PCB mount keyswitches](https://novelkeys.xyz/search?q=PCB+mount+switches&type=product) – as opposed to **plate mount** keyswitches. PCB mount switches have two extra **plastic posts** on the bottom that keep the switch from twisting horizontally during installation & while in use. Plate mount style switches can be used instead, but they will exhibit the aforementioned twisting behavior.

## Keycaps
Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/093/525/medium800/projects_keycaps.jpg?1595845671)

Due to the unusual layout, finding proper keycaps for this project can be a challenge – particularly the 1u Return & 3u spacebar caps.

The **V, O, T,&nbsp; E** , & **Return** caps I used are from a limited-run set called [XDA Oblique](https://dixiemech.store/products/xda-oblique)&nbsp;and the 3u **spacebar** is from an add-on kit for [this set](https://kprepublic.com/products/kprepublic-139-cherry-profile-dye-sub-keycap-set-thick-pbt-plastic-keyboard-gh60-xd60-xd84-cospad-tada68-rs96-zz96-87-104-fc660?_pos=14&_sid=a8479469e&_ss=r&variant=8595495977004).

To create something similar without scouring [r/mechmarket](https://www.reddit.com/r/mechmarket/), you can pick up the **English Spacebar** & **Base** kits from [this set](https://kprepublic.com/products/kprepublic-139-cherry-profile-dye-sub-keycap-set-thick-pbt-plastic-keyboard-gh60-xd60-xd84-cospad-tada68-rs96-zz96-87-104-fc660?_pos=14&_sid=a8479469e&_ss=r&variant=8595495977004). Alternatively, you could use caps from [this complete set](https://www.amazon.com/YMDK-Profile-Minila-Subimation-Keyset/dp/B082D21GRP/) which costs a bit more. Whichever keycaps you end up using, just make sure they're **Cherry MX compatible** – which is the most common type.

# Mini VOTE Keyboard

## PCB

![](https://cdn-learn.adafruit.com/assets/assets/000/093/445/medium800/projects_pcb1-cropped.jpg?1595563819)

The PCB for this project was designed in [Kicad](https://kicad.org/) with drill sizes and trace widths optimized for a **1/32" flat end mill**. The board you see in the photos was created with an **Othermill,** ancestor of the [Bantam Tools PCB Milling Machine](https://www.bantamtools.com/machines/basic-desktop-pcb-milling-machine).

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/093/314/medium800/projects_Screen_Shot_2020-07-18_at_4.01.29_AM.png?1595059601)

![](https://cdn-learn.adafruit.com/assets/assets/000/093/427/medium800/projects_VOTE-keyboard-PCB.png?1595402733)

## Kicad project

Click the button below to download the Kicad source project with schematic, board, & library files

[VOTE_Keyboard-Kicad.zip](https://cdn-learn.adafruit.com/assets/assets/000/093/428/original/VOTE_Keyboard-Kicad.zip?1595403007)
## Gerber files

Click the button below to download the milling/fabrication files in Gerber format

[VOTE_Keyboard-gbr.zip](https://cdn-learn.adafruit.com/assets/assets/000/093/429/original/VOTE_Keyboard-gbr.zip?1595403012)
## Optional color
![](https://cdn-learn.adafruit.com/assets/assets/000/093/579/medium800/projects_finished-grey-cropped.jpg?1595927634)

Since the PCB will play a major role in this keyboard's aesthetic, you may want to dress it up a bit. You could use paint to cover the top side in a custom color, but it's far easier to use **adhesive vinyl**.

I used [Oracal 631](https://www.orafol.com/en/americas/products/oracal-631-exhibition-cal) adhesive vinyl, which is **repositionable** and somewhat forgiving during application – similar to drawer liner or contact paper. Consider using [Oracal 651 type](https://www.orafol.com/en/americas/products/oracal-651-intermediate-cal) if you want something more **durable & permanent**. Whichever type you choose, the following process should apply:

Cut a piece of vinyl **significantly larger** than the PCB – ~13cm x 8cm

Remove the adhesive backing and apply vinyl to topside of PCB

Turn the covered PCB over and use a sharp knife along the board edges to remove excess vinyl

Slice holes through the vinyl for each component lead & use cross-cuts for the larger openings (switch posts, standoffs, etc)

![projects_color-cut-sheet-cropped.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/573/medium640/projects_color-cut-sheet-cropped.jpg?1595924979)

![projects_color-cut-border-cropped.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/574/medium640/projects_color-cut-border-cropped.jpg?1595925020)

![projects_color-poke-holes.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/575/medium640/projects_color-poke-holes.jpg?1595925038)

![projects_color-components-uncropped.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/576/medium640/projects_color-components-uncropped.jpg?1595925585)

# Mini VOTE Keyboard

## Assembly

## A note about spacebar switches
![](https://cdn-learn.adafruit.com/assets/assets/000/093/449/medium800/projects_spacebar.jpg?1595569044)

Normally, keycaps with a length of 2u or greater require [stabilizers](https://novelkeys.xyz/products/cherry-stabilizers) which would complicate this relatively simple build. The **3u spacebar** we’re using can be mounted directly on 3 **individual keyswitches**. This means we get to skip the stabilizers, but it also means the spacebar will be harder to press than the other keys.

![](https://cdn-learn.adafruit.com/assets/assets/000/093/448/medium800/projects_spacebar_switches.jpg?1595568882 the two black/clear keyswitches have had their springs removed)

If a harder-to-press spacebar bothers you, you can use a small flathead screwdriver to [open the keyswitches](https://www.youtube.com/watch?v=hZb2xBn62ig) on **either end** of the spacebar and remove their springs before soldering. Doing so will leave only the force of the center switch's spring required for actuation.

## Diodes
![](https://cdn-learn.adafruit.com/assets/assets/000/093/450/medium800/projects_diodes1.jpg?1595570486)

Mount the diodes on the PCB with each diode’s **stripe** &nbsp;pointing toward the **upper edge** of the board as seen in the photo above.

Once you’ve double-checked each diode’s orientation, **bend** their leads outward to hold them in place.

**Solder** each diode in place.

**Clip** the excess leads off the back of the board.

Save one of the clipped leads to use as a jumper in the next step.

![projects_diodes2-a.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/452/medium640/projects_diodes2-a.jpg?1595571472)

![projects_diodes2-c.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/454/medium640/projects_diodes2-c.jpg?1595571515)

## Jumper
![](https://cdn-learn.adafruit.com/assets/assets/000/093/459/medium800/projects_jumper1.jpg?1595573431)

If you're working with a single-sided PCB, you'll need to install a **single jumper wire** in the location shown above in blue.

Bend a **clipped diode lead** &nbsp;from the previous step into a ~5mm **U shape**.

Mount the jumper in the center of the top side of the PCB.

Bend the jumper leads outward, solder, and clip any excess from the board.

![projects_jumper2-a.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/455/medium640/projects_jumper2-a.jpg?1595572696)

![projects_jumper2-b.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/456/medium640/projects_jumper2-b.jpg?1595572715)

![projects_jumper2-c.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/457/medium640/projects_jumper2-c.jpg?1595572747)

![projects_jumper2-d.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/458/medium640/projects_jumper2-d.jpg?1595572782)

## Trinket M0
Use flush cutters to cut a strip of male **header pins** into two **&nbsp;5-pin** length pieces.

Mount the header pins on the PCB with the **longer pin ends** protruding out the **bottom copper side** of the board.

Mount the Trinket M0 using the pins on the top side of the board as seen in the photo.

Carefully **solder**  **each pin** to the Trinket M0.

Turn the board over and solder the pins to the bottom side of the board.

Clip the excess pin lengths on the bottom side of the board.

![projects_trinket1-a.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/473/medium640/projects_trinket1-a.jpg?1595580525)

![projects_trinket1-b.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/474/medium640/projects_trinket1-b.jpg?1595580545)

![projects_trinket1-c.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/475/medium640/projects_trinket1-c.jpg?1595580565)

![projects_trinket1-d.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/476/medium640/projects_trinket1-d.jpg?1595580577)

## Keyswitches
![](https://cdn-learn.adafruit.com/assets/assets/000/093/471/medium800/projects_switches1.jpg?1595578647)

 **Mount a keyswitch** on the PCB, ensuring that all of its pins & plastic posts are poking out the bottom side of the board.

![](https://cdn-learn.adafruit.com/assets/assets/000/093/472/medium800/projects_switches2.jpg?1595579138)

 **Solder** both of the switch's **pins** to the bottom side of the PCB.

Repeat this process for each of the remaining switches.

## Finishing up
![](https://cdn-learn.adafruit.com/assets/assets/000/093/468/medium800/projects_keycaps_install1.jpg?1595574505)

Once soldering is complete, go ahead and install the **keycaps** by pressing each one firmly onto the switch stems.

![](https://cdn-learn.adafruit.com/assets/assets/000/093/470/medium800/projects_standoffs1.jpg?1595576279)

Finally, install the **standoffs** at each corner of the PCB using a small Phillips head screwdriver

![](https://cdn-learn.adafruit.com/assets/assets/000/093/477/medium800/projects_finished.jpg?1595580912)

# Mini VOTE Keyboard

## Software

Trinket M0 comes **preloaded with CircuitPython**. If you've since used it to run Arduino code, or you'd like to upgrade to the latest version, follow the [instructions here to install the latest CircuitPython](https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/circuitpython).

Connect Trinket M0 to your computer using a micro USB Cable. A drive named **CIRCUITPY** should appear on your computer.

Open the **CIRCUITPY** drive and create a folder named **lib** inside (if it doesn't already exist).

## Libraries

The project code requires two code libraries. **Click the link below** to download the CircuitPython library **bundle&nbsp;** which matches the version of CircuitPython you are running. You can check the **boot\_out.txt** file on the **CIRCUITPY** drive to determine the major version of CircuitPython you are using.

[Library Bundle](https://circuitpython.org/libraries)
 **Unzip** the library bundle, and open the **lib** folder inside.

You'll need to copy two libraries from this folder to the **CIRCUITPY** drive's **lib** folder:

- Locate the folder named **adafruit\_hid&nbsp;** and copy it to the **CIRCUITPY** drive's **lib** folder.&nbsp;
- Locate the file named **adafruit\_dotstar.mpy** &nbsp;and copy it to the **CIRCUITPY** drive's **lib** folder **.**

Your CIRCUITPY drive's file structure should now look like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/093/524/medium800/projects_CIRCUITPY.png?1595838283)

## Project code

CircuitPython code for this project was adapted from the rather excellent [MiniKbd](https://github.com/andyclymer/minikbd) by Andy Clymer.

**Copy** the code below and paste it into a **new text file**.

Save the text file as **code.py** to the root of the **CIRCUITPY** drive, overwriting any preexisting file.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/VOTE_Keyboard/code.py

## Usage & customization

Once you've saved **code.py** to your Trinket M0 the code will start running and the board will be seen by your computer as any other **USB keyboard** – no reboots or special tricks required.

Want to make your keyboard say something other than "vote"? No sweat. You can easily change what keycodes are sent to your computer by editing the code.

Edit **lines 37-42** of **code.py** by swapping the current keycodes with the new ones you want. You can see a list of all possible keycodes using this[reference in the CircuitPython documentation](https://circuitpython.readthedocs.io/projects/hid/en/latest/api.html#adafruit-hid-keycode-keycode).

For example, if you wanted to be able to type "cool" and exchange the return key for a shift key, it would look like this:

```python
buttonIDtoKeycode = {
    1: Keycode.C,
    2: Keycode.O,
    3: Keycode.O,
    4: Keycode.L,
    5: Keycode.SPACE,
    6: Keycode.SHIFT}
```


## Featured Products

### 1N4148 Signal Diode - 10 pack

[1N4148 Signal Diode - 10 pack](https://www.adafruit.com/product/1641)
You have some electrons over here, and you want them over there but you don't want the electrons from over there to be able to come over here? That's what a diode is for, these are directional current valves and have the benefit of being waaay smaller than vacuum tubes.  
<br...></br...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/1641)
[Related Guides to the Product](https://learn.adafruit.com/products/1641/guides)
### Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE

[Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE](https://www.adafruit.com/product/3500)
The&nbsp;Adafruit Trinket M0 may be small, but do not be fooled by its size! It's a tiny microcontroller board, built around the Atmel ATSAMD21, a little chip with _a lot_ of power. We wanted to design a microcontroller board that was small enough to fit into any project, and low...

In Stock
[Buy Now](https://www.adafruit.com/product/3500)
[Related Guides to the Product](https://learn.adafruit.com/products/3500/guides)
### Black Nylon Machine Screw and Stand-off Set – M2.5 Thread

[Black Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3299)
Totaling 380 pieces, this **M2.5 Screw Set** &nbsp;is a must-have for your workstation.&nbsp;You'll have enough screws, nuts, and hex standoffs to fuel your maker tendencies&nbsp;for days on end! M2.5 size screws fit almost all of the Adafruit breakout/dev board mounting holes...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3299)
[Related Guides to the Product](https://learn.adafruit.com/products/3299/guides)
### USB A/Micro Cable - 2m

[USB A/Micro Cable - 2m](https://www.adafruit.com/product/2185)
This is your standard USB A-Plug&nbsp;to Micro-USB cable. It's 2 meters long so you'll have plenty of cord to work with for those longer extensions.

In Stock
[Buy Now](https://www.adafruit.com/product/2185)
[Related Guides to the Product](https://learn.adafruit.com/products/2185/guides)
### Adjustable 30W 110V soldering iron

[Adjustable 30W 110V soldering iron](https://www.adafruit.com/product/180)
This 'pen-style' soldering iron is just about the best entry-level tool I've seen. It's not as powerful as a Weller WES51 but it _is_ self-contained and easy to use. With proper care, it will last for many years. Turn it off when not in use, clean the plated tip with a...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/180)
[Related Guides to the Product](https://learn.adafruit.com/products/180/guides)
### Mini Solder spool - 60/40 lead rosin-core solder 0.3mm diameter

[Mini Solder spool - 60/40 lead rosin-core solder 0.3mm diameter](https://www.adafruit.com/product/145)
If you want to make a kit you'll need some solder. This 100g (about 1/4 lb) spool is just the right amount, not too much (like 1 lb spools) and not too little (like those little 'pocket clip' vials). 0.3mm diameter, 60/40 'no clean' rosin core. Good for all through-hole...

In Stock
[Buy Now](https://www.adafruit.com/product/145)
[Related Guides to the Product](https://learn.adafruit.com/products/145/guides)
### Panavise Jr.

[Panavise Jr.](https://www.adafruit.com/product/151)
The best mini-vise for working on smaller PCBs (2.875" or less in one dimension)! The jaws are strong plastic that wont damage the PCB and doesn't mind if you hit it with the soldering iron by accident. Made in the USA.

- The easy-to-use single knob controls head movement...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/151)
[Related Guides to the Product](https://learn.adafruit.com/products/151/guides)
### Solid-Core Wire Spool - 25ft - 22AWG - Yellow

[Solid-Core Wire Spool - 25ft - 22AWG - Yellow](https://www.adafruit.com/product/289)
Perfect for bread-boarding, free wiring, etc. This spool of solid-core wire is easy to solder to. When bent it keeps its shape pretty well. We like to have a few spools of this stuff around. We suggest picking up wire strippers to match. Wire gauge is 22 AWG which we've found is the best...

In Stock
[Buy Now](https://www.adafruit.com/product/289)
[Related Guides to the Product](https://learn.adafruit.com/products/289/guides)

## Related Guides

- [Adafruit Trinket M0](https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino.md)
- [Fruit Jam Video Music](https://learn.adafruit.com/fruit-jam-video-music.md)
- [No-Code Indoor Grow Monitor with PPFD and VPD Measurements](https://learn.adafruit.com/no-code-indoor-grow-monitor.md)
- [16x16 NeoPixel Matrix Square Pixel Display](https://learn.adafruit.com/16x16-neopixel-matrix-square-pixel-display.md)
- [Lemon Mechanical Keypad](https://learn.adafruit.com/qtpy-lemon-mechanical-keypad-macropad.md)
- [RGB & HSV NeoPixel Dialer](https://learn.adafruit.com/rgb-hsv-neopixel-dialer.md)
- [CircuitPython OLED Watch Clock](https://learn.adafruit.com/circuitpython-oled-watch.md)
- [Raspberry Pi HQ Camera Case](https://learn.adafruit.com/raspberry-pi-hq-camera-case.md)
- [Nunchuck Controlled Laser Cat Toy](https://learn.adafruit.com/nunchuck-controlled-laser-cat-toy.md)
- [QT Py Snap Fit Case](https://learn.adafruit.com/qt-py-snap-fit-case.md)
- [CRICKIT WobblyBot](https://learn.adafruit.com/crickit-wobblybot.md)
- [CircuitPython with Jupyter Notebooks](https://learn.adafruit.com/circuitpython-with-jupyter-notebooks.md)
- [Trinket / Gemma Mini-Theremin](https://learn.adafruit.com/trinket-gemma-mini-theramin-music-maker.md)
- [Compost Friend!](https://learn.adafruit.com/compost-optimization-machine.md)
- [Solderless Robot Toy Xylophone](https://learn.adafruit.com/solderless-robot-toy-xylophone.md)
- [Watchmen's Sister Night NeoPixel Goggles](https://learn.adafruit.com/watchmen-sister-night-circuitpython-neopixel-goggles.md)
