Skip to content

Latest commit

 

History

History

MIDI_IO

MIDI I/O board

Assembled:

MIDI IO ports

MIDI IO back

3D render:

MIDI IO board

PCB photos

Current state

I have five physical boards and each of those is working. Moreover, long-term tests are done. I'm still concerned about the device speed and I want to perform 24 hour long tests on 5V and 3.3V devices, as well.

Specifications

This board has two DIN-5 ports for input and output and 6N138 to isolate input signal. 6N138 optoisolators were bought here and were tested by me well. I've bought my DIN-5 sockets here on AliExpress, which seems cheap enough.

It is inspired by the fact AliExpress boards for MIDI are not that good and I had to solder a resistor straight onto the optocouple leads to make one work.

It uses 1k 100 mHz ferrite beads for EMI protection, currently ILBB-0603ER102V by Vishay.

This board is designed in KiCad 5.1.6. Issues and advices are welcome!

Testing

I was concerned about the components overheating over a long-term use, so I decided to "spam" a hardware synthesizer with MIDI messages to check how it behaves.

First test was relatively simple: random notes were sent to Casio Privia synthesizer on low volume for three hours when input voltage was 5v. I did not notice any glitches in the process (no randomly changing instruments or velocity). To perform the test, I have used Arduino Uno and Arduino Mega boards.

Then I did a similar test for ~15 minutes on STM32 board (Blue Pill) and ESP32-WROOM board, both sent 3.3 V input to the board.

I also monitored how the signal is received by checking available bytes on UART. I should do more extensive tests later. I am mostly interested in sending lots of MIDI data from E-MU 0404 to a 3.3V device to understand how well it behaves.

Components

5V mode

This board is initially intended for use with devices, which have 5V logic level like Arduino and 3.3 V board should be different component-wise, not layout-wise.

Schematic contains correct and tested resistor values for 5V, according to MIDI DIN electrical specification.

This specification doesn't clearly state a resistor value for 6n138 optoisolator, currently it is 220 Ω, which works for hours in practice, but should be optimized later. The resistor I'm speaking of is called R4 on KiCad schematic. In MIDI DIN spec it's called Rd. It influences speed of bit switching on the optoisolator side connected to RX pin and the power consumption.

3.3 V mode

I have sent and received data on both STM32 and ESP32 using the current design. R4 value was the same as in 5V version, i.e. 220 Ω, which might be too low for the task. While it gives a high switching speed (apparently, I don't have an oscilloscope to check right now), it is different from the recommended value range, too.

Further tests should adress that and I should test the board with more appropriate resistors.

There are many possible changes to make for 3.3V. Some require changing the layout, some don't.

  • PJRC - physics of the process, fixes, 6n137 recommendation
  • EE StackExchange - more on physics, TLP2361 and H11L1 recommendation, possible layout alteration
  • Samplerbox - recommendations about Raspberry Pi usage, a combination of R4 = 1k and R5 = 10k. Comment tells it doesn't work, though.
  • EE StackExchange topic about power consumption recommends another topology, clamping the output transistor with Schottky diode like SD101, BAS70, RB751
  • EE StackExchange also has a topic on exact calculation for a pull-up resistor

The simplest would be to pick R4 = 1k, R5 = 10k and perform the tests between two boards. "MIDI in many circuits" topic explains that R5 range should be between 4.7 kΩ and 10 kΩ.

To-Do

  • Check contacts on physical DIN-5 sockets: both pins and sizes
    • UPD: sockets have arrived, testing soon
    • UPD-2: ordered the board, optocouples and diodes arrived, waiting for passive components
  • Finish compatibility with current MIDI DIN electrical specification
  • Clean components up
  • Order a PCB
  • Assemble a PCB
  • Test 3V3 mode on STM32 with available resistors
  • Test 3V3 mode on ESP32-WROOM with available resistors
  • Run a high-speed byte transfer through an optocouple and compare sent and received byte for a day
  • Test connection reliability between two 3V3 devices both usin MIDI I/O board
  • Test 3V3 mode for Raspberry Pi, add a level shifter if it will be required. Look at this article if things start to break.

Credits