Pico, Nano, Micro Keyboard Matrix PCB

A number of my projects have involved using a microcontroller (usually an Arduino Nano or a Raspberry Pi Pico) to decode a music keyboard matrix and take some action.  This is the basis of all of my “toy keyboard” MIDI controllers for example.

This board is a “helper” PCB that makes the job a little easier. It supports either an Arduino Nano, Pro Micro, or Raspberry Pi Pico footprint microcontroller and breaks all the respective IO out to two sets of pins for the matrix “rows” and “columns”.

NanoPicoKeyboardMatrix-3d

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

The build guide is now available here: Pico, Nano, Micro Keyboard Matrix PCB – Part 2.

These are the key Arduino tutorials for the main concepts used in this project:

If you are new to Arduino, see the Getting Started pages.

The Circuit

NanoPicoKeyboardMatrix-sch

The circuit itself is relatively straight forward – two sets of headers, linked up to the various footprints of the three microcontrollers supported.

PCB Design

NanoPicoKeyboardMatrix.pcb

Only one microcontroller can be used at any one time – but the board itself is meant to be usable by all.  There are two additional sets of pin headers in addition to the rows/columns:

  • Power: 5V, 3V3, GND.
  • Serial: TX, RX, GND.

For the Pico and Nano, 5V and 3V3 do what you’d expect.

For the Pro Micro, the 3V3 header pin is connected to VCC, which is naturally accurate for the 3V Pro Micro, but not for the 5V variant.  In both cases the 5V header pin is connected to RAW which is the USB bus voltage (5V) if USB powered.

Just to repeat for the 5V Pro Micro both 3V3 and 5V will be sitting at 5V!  I do not recommend using this pcb with a 5V Pro Micro. It could get very confusing if you plan to use the POWER header.

The serial header is connected to the standard hardware UART RX/TX pins for the Nano and Pro Micro, and to GPIO 0 and 1 for the Pico (UART 0).

The following IO pins are mapped onto the rows and columns:

NanoPicoKeyboardMatrix

NOTE: The Pro Micro only decodes up to 8 “rows” alongside the 8 “columns”.  This is simply due to the lower number of IO pins available.

ERRATA: Nano – there is a problem with the above.  I’d forgotten that A6 and A7 cannot be used as digital pins on the ATMega328!  That means COLs 7 and 8 actually can’t be used on the Nano after all… Whoops!

NanoPicoKeyboardMatrix.ger

Closing Thoughts

I’m annoyed that I forgot about A6/A7 on the Nano – oh well.  If I do another version, then I’ll have to switch to a 10×8 matrix for the Nano rather than try for the 12×8.

I have a number of “helper” boards like this that I will start to put together.  They will hopefully make some of the projects I’m doing less prone to having dodgy solderless breadboard connections and less wires falling out of their sockets!

This board is being manufactured using the Seeed Fusion PCB service, which I am happy to continue to recommend. It has been supported with discount vouchers that I’ve been sent by Seeed for my previous projects.

Kevin

Leave a comment