Monday, October 26, 2020

Pogo Pin Lobot

Lobot with Pogo Pins

For programming boards that don't have the ICSP header pins installed.

Same Lobot PCB as before. Pogo pins installed in the ICSP header instead of the Pro Micro footprint. Cheap Tiny AVR ISP programmer board installed.

Spring pressure makes contact with the unpopulated (no pin header installed) ICSP pads on the PCB.

The pins are delicate. I store this in an Altoids tin. More info on the pogo pins can be found in the Lobot post.

The pogo pins are soldered to the top PCB (bottom in this picture). This has to be done with the two PCBs assembled. I used a piece of kapton tape to keep the pins from falling out while soldering. Solder the back row first without the front row in place, there isn't a lot of room to work.

The pins are not soldered at all to the bottom PCB (top in this picture).


Credit card sized 60%

Using the same 3.5x6mm tactile switches as the Wee Gherkin. V-USB powered ATmega328, with blue LEDs for voltage regulation.

The ATmega328 is running at 12MHz. V-USB will run at 12, 16 and 20MHz (and a few others). The code runs most efficiently at 16 or 20MHz. There are a lot of timing adjustments running at 12MHz and the resulting code is much larger for 12MHz.

I built 2 of these. One with the switches from black switches from Digikey and another with the terrible low quality switches I bought on Amazon. I also used a 5mm blue LED on one of them, just for the hell of it.

The back of the PCB. The ICSP header is on the back, under the ATmega328. I built a pogo pin version of the Lobot to be able to connect to the ICSP pads without installing header pins.

60 percent 09.

Next to a Wee Gherkin.

Monday, October 19, 2020


Tiny 40%

A 4x12 matrix the same size as the Gherkin Express TH and using the same 6x6mm tactile switches.

The switches are rotated so that the through hole pins are staggered allowing the switches to be placed closer together.

The power and activity LEDs from the Gherkin Express TH are removed. Instead the blue LEDs for V-USB voltage regulation are used as a power indicator, and a flickering activity indicator. 

The miniature 16MHz crystal is also used as on the second version of the Gherkin Express TH.

There is only one decoupling capacitor instead of the usual 2.

The 1mm thick top PCB has legends in the copper layer.

The two blue LEDs on the corner, D- on the left and D+ to the right. D+ is always on while connected to USB. D- flickers when data is being transmitted.

The two red switches are the RESET and USBASP switches for entering the V-USB bootloader.

Everything fits with 4mm M2 spacers. Construction is the same as with the Gherkin Express TH.

Same credit card size as the Gherkin Express TH. It shares the same bottom PCB. Screw holes are in the same positions.

Thursday, October 15, 2020

Wee Gherkin

No'-as-big-as-medium-sized-Gherkin-but-bigger-than-wee-Gherkin Gherkin

Another Gherkin in a different form factor. This shares the same circuit and firmware as the Gherkin32. It is also powered by an ATmega32a. The main difference is the form factor and the use of 3.5x6mm tactile switches. It also uses blue LEDs instead of zener diodes in the V-USB circuit.

3.5x6mm tactile switches only come in 2 heights, 4.5 and 5mm. This is too short to make a usable top plate. The rectangular plunger also wobbles on the short axis more than the long axis. These black switch are from Digikey. There were very few options, and only black available.

These were cheap switches bought from a third party seller on Amazon. They are horrible. About a quarter of them do not click. They do work, just no click when pressed. Most sellers refer to these at 3x6mm but they are really 3.5x6mm.

Wednesday, October 7, 2020

Gherkin Express 3

Third SMT assembly order from JLCPCB

This version uses the same circuit as the Gherkin Express 2, but with blue LEDs instead of the zener diodes. It also uses the PCB as a USB A connector.

All parts used were available in the JLCPCB inventory. Only the fuse and the tactile switches had the setup surcharge.

The board will plug directly into a USB A port, or an extension cable. The 1.6mm PCB is on the thin side. Ideally it should be 2.2mm thick to fit properly. JLCPCB has 2mm PCB as an option, but not with assembly. I'm considering haveing a 0.6mm thick blank PCB with the same outline made and laminate the two PCBs together.

Monday, October 5, 2020

Copper legends

Sanded the soldermask off to expose the copper

I used 220 wet/dry sandpaper to carefully sand the soldermask off the copper. I also used a Scotchbrite pad to dull the surface of the remaining soldermask.

The copper is starting to oxidize and turn darker. I could spray some clear acrylic to seal it.

I also sanded the bottom of the PCB. This looks neat, but is probably a bad idea. The soldermask not only protects where solder can be applied, it is an electrical insulator. They make conformal coatings specifically designed to protect PCBs, but they have highly flammable solvents and I can't find any locally. Shipping for a small bottle is very expensive. If you are using leaded solder this is a very bad idea, creating lead dust.

Friday, October 2, 2020

Gherkin Express TH 2

Second version of the through hole Gherkin Express

Main changes from the original Gherkin Express TH are the miniature 16MHz crystal and the mini USB connector is moved inwards to be flush with the edge of the PCB. The zener diode footprint is overlapped with one for a blue LED.

The switch positions and LED cut outs are the same as the first version.

I made a new top piece with the legend in the top copper layer instead of the silkscreen layer. The resolution of the copper layer is much higher than the silkscreen. Green, blue, red and yellow soldermask is translucent and the legends can be read through them.

M2 spacers with M3 unthreaded spacers. With the shorter crystal and a smaller 3mm diameter power capacitor laid down on it's side, everything fits with 4mm spacers.

The two zener diodes were replaced with rectangular 2x3x4 (4mm tall) blue LEDs. The power capacitor on this one is a 4mm diameter solid polymer capacitor.

Blue PCB top piece. This one is 1mm thick, the green one was 0.8mm thick. It is a bit stiffer but does not make that much of a difference.

4mm spacers and a 1mm thick nylon washer between the bottom PCB. The top screws are 3mm and the bottom 6mm.

Wednesday, September 30, 2020

Yin and Yang

Two very different Gherkins

Two different Gherkin PCBs, one built for the Seeedstudio Xiao and the other for the ATmega32A using V-USB.

Both have the same shape and mounting hole positions as the regular Gherkin PCB. The Gherkin32 has a Mini USB connector sticking out where the Pro Micro would have been.

The GherkinX has a 5x6 diode matrix like the original Gherkin. It uses all 11 available pins on the Xiao.

The Gherkin32 has no matrix diodes. Each individual switch is connected to it's own pin on the  ATmega32A. 30 pins for the switches and the remaining 2 for the V-USB connection.

Possible to fit everything with 6mm spacers. Low profile Peel-A-Way sockets.

Monday, September 28, 2020


Cheap ATmega32A alternative at Digikey

The ATmega324PA-PN is the industrial temperature rated version which usually cost more. It is a non-stock item at Digikey and they seem to be trying to get rid of them. At $2.04 each they are much cheaper than the ATmega32A. It is a newer (though still fairly old) generation chip than the ATmega32A. It shares the same pinout. It can also run at up to 20MHz while the ATmega32A runs at 16MHz. 

It is not a drop in replacement. A compiled hex file for the ATmega32 will not run on the ATmega324PA. It will need to be recompiled with the ATmega324PA as the target.

The only modifications I had to make to the 108 code was to change the MCU from atmega32a to atmega324pa and comment out the line that defines the timer register on the ATmega32.

I also compiled a version of the USBaspLoader for the ATmega324PA, same as for the ATmega32, just changing the MCU. The fuses are the same as for the ATmega164.

Wednesday, September 23, 2020


16 rotary encoders on a Teensy LC

Using the Arduino CommonBusEncoders library it is possible to connect multiple encoders in a keyboard like matrix.

There is a single common data pin for the Encoder A and Encoder B signals. If there is a switch built in then one pin of the switch is also connect to a single bus data pin. The ground pin of each encoder is connected to it's own data pin. The tutorial PDF explains the topology.

16 encoders and 10 APA106 LEDs connected to a Teensy LC. 

There is a second pin 17 on the Teensy LC that has a level converter for the 5v output that the APA106 requires. The rest of the pins run at 3.3v logic. I have a tiny solder bridge jumper that connects either the regular 3.3v pin 17 or the level converted pin 17 to the APA106. When connected to the 3.3v output pin the LEDs flickered randomly. On the Seeeduino Xiao the 3.3v output works fine driving the APA106 without level conversion.

16 encoders with 3 diodes each to prevent ghosting.

I made a simple plate to hold everything in place. Much sturdier than without.

The encoders are spaced the same as MX switches. Small tapered knobs work best.

Side view. M2 spacers and screws holding a second PCB as the base.

A second built with different encoders. These have the split spline shaft instead of the D shaped shaft. The purple Teensy LC is from OSH Park.