XIAO MIDI Synth Board PCB – Part 2

Here are the build notes for the XIAO MIDI Synth Board PCB.

IMG_7123

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

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

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

Bill of Materials

IMG_7115

  • XIAO MIDI Synth Board PCB (GitHub link below).
  • 1x H11L1 optoisolator.
  • 1x 1N914 or 1N4148 diode or similar.
  • Resistors: 1 each of 10Ω, 33Ω, 220Ω, 470Ω.
  • 8x 10kΩ linear PCM mount potentiometers (see photos for footprint).
  • 1x 100nF ceramic capacitor.
  • 4x 7-way header sockets.  Ideally “short profile” with plastic height of 5mm, see photo below.
  • 1x 2×2 “spring loaded pogo-pin” header.  Ideally the “A height” (i.e. from the bottom of plastic base to the top of spring-loaded contact) is 10mm.  See photo below.
  • 1x 2-pin tactile switch, see photo below.
  • 2x 180 degree DIN sockets OR 2x TRS stereo PCB mount sockets (see photos for footprints).
  • 3x 3-way pin header.
  • 2x jumpers
  • Optional: 1x 2-way pin header.
  • Optional: 6-way DIP socket.

IMG_7112

Note that if normal profile 7-way headers are used then longer pogo-pins will be required in order to connect with the XIAO. I would imagine that common-sized headers may require 13 or 14mm pogo pins, but some experimentation may be required.

IMG_7116

Build Steps

  • All resistors and diode.
  • DIP socket (if used).
  • TRS socket(s).
  • Ceramic capacitors.
  • Tactile switch.
  • 7-way headers.
  • Pogo-pin and normal pin headers.
  • Electrolytic capacitor – note the polarity as indicated on the PCB is wrong.  Negative should be on the TRS socket side.
  • Potentiometers.
  • DIN sockets.

If “normal” 7-way header sockets are used then it may be necessary to leave the longer pogo-pin headers until after the normal pin headers, but before the DIN sockets.

The pin headers for the SWD and power links are optional.

If using external power via the 5V pin header, then this should be a stable, “as would be delivered via USB” 5V power input as it connects directly to the XIAO’s 5V power pin.

Here are some build photos.

IMG_7122

Configuration Options

Only the XIAO SAMD21 has enough analog inputs for all eight potentiometers.  Consequently the last four pots on the board can be cut off if required, leaving a four-pot controller.

There are two sets of jumpers to control the connection to the audio output and which IO pin runs to one of the pots.

XIAO-MIDI-SynthBoard-Cfg

If using a XIAO SAMD21, then A0 can be used as the DAC output and A4 can be used as one of the potentiometers (as shown on the left).  For other XIAO series boards that don’t include a DAC, but might have more limited ADC capability, A0 can be used as a pot, as shown on the right.

For boards with no DAC then PWM audio is possible from one of the other IO pins.  In this case a jumper wire can optionally be added to connect the required pin to the audio output circuit as shown below.

XIAO-MIDI-SynthBoard-Cfg-Audio

Testing

I recommend performing the general tests described here: PCBs.

The MIDI circuits can be verified using a XIAO SAMD21 and the Simple MIDI Monitor.  With MIDI IN connected to a source of MIDI note data and MIDI OUT connected to a sound source, any notes will be echoed across from IN to OUT and the onboard LED will flash (off) for each note played.

The potentiometers are arranged in the following order.

XIAO-MIDI-SynthBoard-Pots

The potentiometers can be checked by running the following code

void setup() {
  Serial.begin(9600);
}

void loop() {
  for (int i=0; i<11; i++) {
    int aval = analogRead(A0+i);
    Serial.print(aval);
    Serial.print("\t");
  }
  Serial.print("\n");
  delay(100);
}

This will output a string of values for every analog input from A0 to A10.  In the default configuration for the XIAO SAMD21, A0, A6, A7 will just show floating values.  When the jumpers are changed for A0/A4 then A0 should now change in response to a potentiometer and A4 will be floating.

The audio output can be (crudely) tested with the following.

void setup() {
}

void loop() {
  tone (0, 440);
  delay(500);
  noTone(0);
  delay(500);
}

PCB Errata

There are the following issues with this PCB:

  • The polarity of the electrolytic capacitor is reversed on the silkscreen.
  • The silkscreen labels for pots A0/A4-A3 are missing.

Enhancements:

  • Consider a MIDI activity LED.

Find it on GitHub here.

Sample Applications

Here are some applications to get started with:

Other XIAO Series Boards

The board should work with all versions of the XIAO series apart from the new ESP32S3 Sense (as it doesn’t have the same arrangement of pads underneath).  If the pogo-pin headers are left out (so no reset switch or SWD header either) then it should also work with the Adafruit QT-Py boards too.

The following have been tested and known to work:

  • XIAO SAMD21
    • This is the board this was designed for.  MIDI is on GPIO 6/7.
    • Jumpers are set for the DAC and A4.
  • XIAO RP2040
    • MIDI is on GP0/1 in Circuit/Micropython, mapped on to the same pins 6/7 of the XIAO formfactor.
    • Jumpers are set for A0 and audio out via a suitable PWM capable IO pin.
    • Only four pots available to be used (A0 to A3).
  • XIAO ESP32C3
    • There is no LED_BUILTIN defined.
    • MIDI is on GP20/21 mapped onto pins 6/7.
    • Jumpers are set for A0 and audio out via a suitable PWM capable IO pin.
    • Only four pots available to be used (A0 to A3).
    • MIDI will be on Serial or Serial0 depending on the setting of “USB CDC On Boot” – if enabled, then Serial0 is used and MIDI must be initialised using:
MIDI_CREATE_INSTANCE(HardwareSerial, Serial0, MIDI);
#define LED_BUILTIN D10  // Attach an LED+Resistor to D10+GND
  • Adafruit QT Py ESP32C3 – semi-working!
    • This has the same provisos as the XIAO ESP32C3.
    • BUT care must be taken that the pogo-pins don’t short anything on the underside of the board.
    • Jumpers are set for A0 and audio out via a suitable PWM capable IO pin.
    • Only four pots available to be used (A0 to A3).
    • I could not get MIDI TX working successfully.  I can see a signal on the TX pin/MIDI DIN but it wasn’t registering as a MIDI message at the receiving end. MIDI RX seems to work fine.

Please Note: Other XIAO series or Adafruit QT Py (or similar XIAO form factor boards) have NOT been tested, but some may work…  Feel free to let me know if you try them out!

Closing Thoughts

I’m really pleased with how this has turned out (not withstanding the two minor mistakes!).  It is mostly for my XIAO SAMD21 at present, but I’d like to explore the use of Mozzi on both the ESP32 and RP2040 versions too.

But as a MIDI CC controller this is already pretty usable as is.

These boards have been manufactured using the Seeed Fusion PCB service, which I am happy to continue to recommend. They have been supported with discount vouchers that I’ve been sent by Seeed for my previous projects.

Kevin

3 thoughts on “XIAO MIDI Synth Board PCB – Part 2

  1. Hi, Kevin,

    I’d really like to build this board, but I haven’t been able to find the right pogo pins so far. Can you suggest a source or a manufacturer’s model number?

    Thanks,

    Peter

    Like

Leave a comment