Thursday, March 23, 2017

Gherkin in the wild

First real Gherkin I've seen

The Gherkin Pi by /u/willbill642.

I have seen a few boards built with the Gherkin PCBs, this is the first one that did something really different.

With this I consider releasing the gerber files as opensource a success. The PCB's are simple and cheap enough to try out new ideas.

I am looking forward to seeing what else the PCBs are made into. The cost to have your own PCBs made are relative low ($16 per set of plates shipped to just about anywhere) and you can sell the ones you don't use.

Thursday, March 16, 2017

Analog matrix keyboard

Keyboard using voltage dividers and analog inputs

This is a custom keyboard PCB that uses 12 analog channels on a Teensy LC. 4 switches are attached to each channel. Each switch when pressed connects to ground through a resistor. Each of the 4 switches has a different value resistor. Through parallel resistance the voltage divider produces a different voltage for each of the 16 possible combinations of the 4 keys being pressed. This voltage is sampled by the Teensy LC input pin and converted to a decimal value. These values are compared to an array and translated into keypresses.

The schematic shows the 12 channels and the resistors in the parallel resistor/voltage dividers. A Pro Micro was used to control the LEDs in the same way that the GNAP does.

An Arduino sketch was used to sample the analog inputs and output to serial monitor. The data was compiled and the values corresponding to the 16 different switch combinations identified. In the chart you can see the distribution of the 16 values. As more keys are pressed there is less separation of the values.

These are the 16 different analogread ranges for each of the 16 switch combinations. Resistor values must be selected so that the ranges never overlap.

The resistor values used were 1k, 2k, 3.9k, 8.1k. The pullup resistor is also 3.9k. Mathematically they should produce distinct voltages when combined in parallel in any combination in a voltage divider.

The matrix works, and my prototype can detect all 48 switches being pressed in any pattern. Currently there is no keyboard code, it is just a large board of switches that light up the corresponding LED when pressed.

There is a problem in that resistors are temperature sensitive, their resistance changes with temperature. The ones I used are metal film 1% tolerance with a 50ppm/C temperature coefficient. These were relatively inexpensive at 5 cents a piece. The problem is that there is sufficient drift with temperature that the readings on the lower end start to drift with temperature extremes. There are better resistors, 0.1% 15ppm/C, but they cost 7 times as much. Instead of $3 of resistors it would be $21.

Other possible solutions are to use a temperature sensor, switch to a Teensy 3.2, or add a better power supply. With a temperature sensor the readings can be adjusted to compensate for thermal drift. The Teensy 3.2 has an ADC with 1 more bit of resolution, which may or may not help. A better more stable power supply may remove some of the jitter in the readings. It is currently using the 3v regulator built into the Teensy LC.

I probably won't pursue this any further. Since I can't get 100% accurate output without modifications which may not help and it is cheaper and more reliable to use a conventional matrix. This uses 12 pins at 4 switches per pin for a total of 48 switches. A conventional matrix for the same number of switches can be made of a 8x6 grid, only 2 more pins.

Some pictures of the assembled prototype:

Keycaps are the X-Keys relegendable ones. I glued them shut since the tops pop off with the slightest pressure from the side. Probably fine when used with the X-Keys boards since they have very high bezels.

A second PCB was used as the bottom.

 You can see the Teensy LC and the Pro Micro between the two PCBs.

Wednesday, March 8, 2017

Ordering a PCB

How to order a PCB from from a gerber file

  • Download the zip file with the gerber files
The zip file contains multiple files each for a different layer of the PCB front/back. Do not edit these files. They have been tested as they are.
  • Go to and click "PCB Order"
  • Create an account or login
  • Upload the Zip file
  • Edit the length and width
  • Set the quantity, 5 piece minimum per board.
  • Set the color (anything other than green cost more, it's a flat fee regardless of quantity)
  • PCB should be 1.6mm. With only soldermask (no copper/silkscreen) the PCB will be 1.52mm thick.This matters if you are making a PCB switch plate for MX style switches.
  • Leave everything else at default
  • Add to cart
  • Repeat for additional boards
  • Checkout 
  • Select airmail or express (usually DHL). Airmail is only an option for lighter orders.
  • They take PayPal or credit card
  • The video below goes through all these steps.
The price of each individual board goes down dramatically with quantity. The cost of shipping also goes up dramatically, PCB's are heavy. Play with the quantities, you may be able to get many more boards for a few dollars more.

EasyEDA ships to most countries.
For an order of 5 sets of Gherkin PCB's it is $20 to most places via airmail. A total of $75.80 shipped ($55.80 for the 5 top/bottom/main PCBs)
5 mf68 PCB's are $28.60 plus $17.40 shipping, $46 total to most places.

Order PCB from gerber files from di0ib on Vimeo.

Gerber files I have released:
Gerber files released under
You do not have to contact me for permission, the license is comprehensive. You can link back to the github page as an attribution.

Tuesday, February 28, 2017

Aqua Planck

Planck with Fosen Aquamarine switches

  • OLKB Planck Rev 2 PCB
  • Fosen Aquamarine clicky switches
  • PCB plate and bottom
  • DSA doubleshot ABS keycaps 
  • 2x3x4mm blue LEDs
  • M2 brass spacers (9mm)
Another Planck keyboard made with the PCB plates from The PCB was one of the $10 closeout ones from (there are no more.)

(Not a pool toy.)

Blue LEDs on lowest brightness.

Side view. 9mm is the shortest spacers you can use, the USB port just barely clears.

DSA keycaps. Black and Blue.

LEDs on.

Wednesday, February 22, 2017

PCB Plate Planck

Planck with PCB Plates

  • OLKB Planck PCB Rev 2
  • 1.6mm top and bottom PCB plate
  • M2 10mm spacers
  • Gateron clear switches
  • White 3mm LEDs
  • PMK Grab Bag DSA keycaps
  • Gerber files
OLKB uses 19mm switch spacing which is different from just about everyone else. PCB's produced at Since these have no copper layers they emailed me to confirm that this is what I wanted.

PCB cost from was $22.60 for 5 top and $22.60 for 5 bottom pieces $45.20 total for 5 sets, plus shipping. Standoffs you can find on eBay, just search for "M2 brass 10mm". There are also nylon ones.

The standoffs interfere with the PCB. Small notches need to be ground into the PCB for it to fit. This has to be done with care, if you grind off too much you will eventually start cutting into traces. If you slip you might break off a diode or resistor. The top and bottom copper layers are the ground and power planes. So don't short across them with a metal standoff.

The plate could be used for hand wiring. They flex about as much as 3mm acrylic, but are much stronger, nearly impossible to crack. You can also sand off the solder mask and dye the PCB.

I sanded down the PCB to take off the shine. The green solder mask is also a bit uneven and had some gloppy areas.

I also sanded the edges smooth. The raw edge was rough in some spots.

The raw PCB's before sanding. You can see some of the imperfections in the green coating.

The PCB is recycled from the Plight. It's had 3 sets of LEDs replaced. Lots of flux residue.

The standoffs are too close to the PCB. Notches need to be ground into the PCB for 6 of the standoffs.
I used a Dremel with a small grinder bit.

A close up view of one of the notches. You can see that if I grind further I will cut into the trace for the LED.
If you use the thinner standoffs you would not need to grind as much.

DSA keycaps from random PMK grab bags. The yellow space bar is a 2u POS cap covering 2 switches.

Side view of the 10mm spacers.

Close up of the USB port. There's enough space to go down to 9mm spacers.

LEDs on.

Tuesday, February 21, 2017

Gherkin Wood

Wood case for the gherkin keyboard

  • Bamboo plywood
  • M2 spacers
  • P2 size EPS file for
This is a simple sandwich style case cut out of 2.7mm bamboo plywood. I had two sheets cut, one from the blonde color and one from the darker colored wood. You can see two layers of the darker wood from the side. This would work with 3mm acrylic as well.

Overall it came out ok, but If I did it again I would pick a different material. The bamboo frays and splinters very easily. Ponoko only has veneer and plywoods. has some nicer solid woods.

You can see the 2 darker layers of wood. There are a total of 6 layers.
I had to sand the edges down to remove the laser scorch marks and to gets all the layers to line up as a single smooth surface.

The cutout for the USB connector. I glued the middle layers together to add strength and to keep them aligned.

The bottom. You can see the frayed edges of the wood where the bamboo veneer splintered.

The edge of the bamboo looks more interesting than the top and bottom surface. It is all bamboo plywood, no fillers.

White LED back lighting. Cheap PBT doubleshot keycaps from eBay.

Bottom removed. Here you can see the PCB fits snugly inside the wood layers. The M2 spacers sit in the holes.
You can see, on the inside, how dark the scorched edges of the wood were.

Friday, February 3, 2017

Sea Cucumber

Gherkin with Fosen Aquamarine and Nantucket Selectric

Tuesday, January 31, 2017

Monday, January 30, 2017

Purple Gherkin

All Purple Gherkin

  • Purple dyed PCB plates
  • Purple dyed cheap blank PBT keycaps
  • Purple dyed Gateron clear tops
  • Purple dyed Aristotle sliders
  • UV/violet 2x3x4mm LEDs
  • Purple dyed nylon spacers and screws
  • Purple USB cable
  • Genuine Sparkfun Pro Micro (0.8mm PCB)
  • 0.8mm white Gherkin PCB
iDye Poly for 15 minutes. Everything was dyed at the same time. The UV LEDs are not very bright in daylight. A dim glow at night.

Tuesday, January 24, 2017

Gherkin Lite

Light weight Gherkin keyboard

  • 0.8mm thick PCB with white soldermask (1.6mm is standard thickness)
  • Nylon spacers and screws
  • G20 keycaps
  • Gateron yellow switches