Arduino Nano MIDI IN “Shield”

This is “yet another” Arduino MIDI Interface, after all I don’t think I’ve built one for a few months now…

Actually I need this for another project, but thought it worth of writing up on its own first.  A Nano “shield” type MIDI In might be useful elsewhere too!

IMG_6136

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 Arduino tutorials for the main concepts used in this project:

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

Parts list

  • Arduino Nano
  • 6N138 optoisolator
  • 2×220Ω resistors
  • 1x 4K7Ω resistor
  • 1x 1N914 diode
  • SPST switch
  • 5 pin DIN socket
  • 10×7 protoboard
  • Header pins

The Circuit

NanoMIDIIN2_bb

There are two “designs” here, but they are both essentially the same as I used in my Simple MIDI Serial Monitor, just with the addition of a smoothing capacitor for the 6N138.  Here is the circuit once again.  Recall that this circuit is designed for 5V logic levels only (for 3.3V systems, see here).

DIY MIDI Receive_schem

The one on the left is meant to go “back to back” with the Nano, underneath it – hence showing it alongside two Nanos – I’m showing the header pins next to the row of Nano pins it relates to – but you have to mentally “flip it over” and slide it underneath one of them to “fit”.

The one on the right could go on top of a Nano (or underneath if you still keep the component side “top”, but I expect there might not be room to do this).

Neither board has space for the MIDI DIN socket.  The idea is that there will be jumper wires to the actual socket.  Note that one circuit includes a switch to disable the RX link to allow the Nano to be programmed – the other doesn’t.  But it would probably need one to be useful.  I’ve not added one as I’m not using that version in the end.

Here are a couple of photos of the built unit.

IMG_6132IMG_6133IMG_6134

It’s not easy to see but I’ve added additional spacers between the two boards as I’m going to soldering them together.  You may wish to use headers rather than pins.

When it came to soldering on the Nano, I only soldered the three pins actually being used: 5V, GND, and RX, which means it should be relatively straight forward to take apart in the future should anything go wrong.

Actually in my case I also cut off the two pin headers for VIN and the GND pin next to VIN (which isn’t used by this board) but that is only because in my eventual use for this module I’ll want to be powering everything via VIN separately.  This leaves both those connections free on the Nano for use later on.

Before soldering on the Nano, I just checked it was working.

IMG_6135

The final unit I’m going to be using can be seen in the photo at the start of this post.

The Code

Any of my MIDI projects could be used to test this, but as a quick check, I just used the code from the Simple MIDI Serial Monitor which flashes the onboard LED in response to NoteOn events.

It is also possible to see the RX LED flashing when the interface receives any data (my UM-ONE’s Active Sensing was quite useful here for once) and at the same time the TX LED flashes too as the MIDI library is doing its “software THRU” function by default.

Closing Thoughts

These might be quite useful modules to have lying around.

When I need a quick MIDI OUT, then grabbing two resistors and a socket is fairly trivial, but wiring up a MIDI IN is a bit more fiddly.  It might be quite useful to have a few of these modules with header pins attached ready to be used for quick experiments in the future.

Kevin

Leave a comment