SparkFun MIDI Shield

The SparkFun MIDI Shield board gives your Arduino access to the antiquated, but still widely used and well supported MIDI communication protocol, so you can control synthesizers, sequencers, and other musical devices. The MIDI protocol shares many similarities with standard asynchronous serial interfaces, so you can use the UART pins of your Arduino to send and receive MIDI's event messages.

The MIDI Shield provides an opto-isolated MIDI-IN port as well as a MIDI-OUT port. The MIDI Shield can be mounted directly on top of an Arduino, connecting the MIDI-IN to the Arduino's hardware RX pin and the MIDI-OUT to TX. Potentiometers are connected to analog pins 1 and 2, and can be used to control volume, pitch, tone or anything else you'd like. Also connected on the shield are three momentary push buttons (connected to D2-4), a reset button, and green and red stat LEDs. The RUN/PROG switch allows you to program the Arduino over serial without having to remove the shield.

Note: The MIDI Shield does not come with the through-hole MIDI connectors or trimpots soldered on. All of these components (2 MIDI connectors and 2 trimpots) are included with the product, however

Note: When using this shield with the Arduino Pro you will have to bypass the TX/RX resistors on the Pro to get enough current to the shield.

SparkFun MIDI Shield Product Help and Resources

MIDI Shield Hookup Guide

October 8, 2015

How to assemble the SparkFun MIDI Shield, plus several example projects.

Core Skill: Soldering

This skill defines how difficult the soldering is on a particular product. It might be a couple simple solder joints, or require special reflow tools.

2 Soldering

Skill Level: Rookie - The number of pins increases, and you will have to determine polarity of components and some of the components might be a bit trickier or close together. You might need solder wick or flux.
See all skill levels


Core Skill: Programming

If a board needs code or communicates somehow, you're going to need to know how to program or interface with it. The programming skill is all about communication and code.

2 Programming

Skill Level: Rookie - You will need a better fundamental understand of what code is, and how it works. You will be using beginner-level software and development tools like Arduino. You will be dealing directly with code, but numerous examples and libraries are available. Sensors or shields will communicate with serial or TTL.
See all skill levels


Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

2 Electrical Prototyping

Skill Level: Rookie - You may be required to know a bit more about the component, such as orientation, or how to hook it up, in addition to power requirements. You will need to understand polarized components.
See all skill levels


Comments

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • 1mpar / about 8 years ago / 1

    if I'm not using it as a shield over arduino using headers, what are the pins that I have to connect between arduino and the board? I won't use the buttons nor the potentiometers, just the midi in.

  • bluedervish / about 12 years ago / 3

    hi folks, might I be able to add this to a makey makey so I can use the makey as a midi controller ? thanks, bd

  • J.D. / about 11 years ago / 2

    There's a typo in this. Where it says "antiquated, but" - that should say "brilliant, and" k thnx

  • dexter2@frontiernet.net / about 13 years ago / 2

    Any chance of an update to the example sketch that runs under arduino_1.0?

    • yan_g / about 12 years ago / 1

      replace

      void Midi_Send(byte cmd, byte data1, byte data2) { Serial.print(cmd, BYTE); Serial.print(data1, BYTE); Serial.print(data2, BYTE); }

      with:

      void Midi_Send(byte cmd, byte data1, byte data2) { Serial.write(cmd); Serial.write(data1); Serial.write(data2); }

  • WhiteHamster / about 15 years ago / 2

    Does this come with the headers for the Arduino board or no?

    • Metalx1000 / about 15 years ago / 2

      Just got this kit. Apparently it doesn't come with header pins. This would have been really nice to know so I could have ordered some with it.

      • yan_g / about 12 years ago / 2

        I ordered the shield with headers for a breakout board, apparently I was lucky to get enough headers for both the shield and the breakout board, which is a couple more than charged, thanks Sparkfun! The desctiption should specify that headers are not included though. Seems like we humans tend to think headers are included :)

  • Trrl / about 9 years ago / 1

    Any chance this can be used with the Spark Fun Motor Shield?

  • Member #338711 / about 10 years ago / 1

    Hi! I'd like to use the MIDI shield with RPi using at the same time MIDI communication and USB/Serial communication. Unfortunately the two ports share the same TX/RX pins. Could be possible to use Software Serial Port in place of HW Serial Port for MIDI, or should I use they as USB communication?

    Thanks !

  • PixMo / about 10 years ago / 1

    Is there any reason why I would not be able to use this in conjunction with an Ethernet Shield? From what I am reading, it sounds like the MIDI Shield uses the TX and RX pins typically used for Serial com (hence the prig/run switch). So other than the conflict with serial communication, it doesn't appear that it would conflict with the Ethernet Shield and they can both live happily together on an arduino board. Am I missing anything?

  • Terrag42 / about 10 years ago / 1

    At first I thought there was a problem using this shield with the Leonardo, but I learned that since the default serial port on the Leonardo is virtual, if you want the serial.write command to use Pins 0 and 1, then you need to use the Serial1 class, not the Serial class. I found this info on the Leonardo Hardware Page.

  • Arie_g / about 11 years ago / 1

    I have problem, when I try to upload to Arduino I get this error: avrdude: stk500_getsync(): not in sync: resp=0x00 but without the shield the code works.

    what is wrong?

    • M-Short / about 11 years ago / 3

      When you upload code to an Arduino you do so over the hardware serial lines. These are the lines labeled TX/RX on the board. The Midi shield also uses these pins, meaning when you try to upload code there is interference from the shield on those lines preventing the code from uploading. This is why we put a switch on the board, with the switch in the Prog position the shield is disconnected and you can upload code. Withe the switch in the Run position the shield is connected and you can do Midi stuff with your shield. Long story short, flip the switch.

  • Member #555156 / about 11 years ago / 1

    Hello, to me it seems the gnd connection of the midi out connector is missing in the schematic. I do hope the hardware does have this connection?

  • Member #521065 / about 11 years ago / 1

    Can we add something like a button array to it ??

  • UnfortunateBystander / about 11 years ago / 1

    Pin 2 on the MIDI Out connector should be connected to ground per the MIDI Hardware Specification.

  • chipaudette / about 11 years ago * / 1

    Gah! No plans to make any more?!?! Sad!

    This was a cool unit. I bought one a couple years ago and have used it in several projects. I finally wrote up a description of one of my projects (a MIDI Clock to Trigger converter, see: http://synthhacker.blogspot.com/2014/02/arpeggiator-fun-my-midi-to-trigger.html) and came back to this page so that I put a link from my page to Sparkfun's product. That's when i see that you don't make it any more.

    Say it ain't so! Make a comeback Sparkfun MIDI Shield!

  • alxxx / about 12 years ago / 1

    Whats the maximum current output from these ? About 60mA?

    We want to use these to drive relays

  • Karl Bielefeldt / about 12 years ago / 1

    Just curious, why no isolation on the MIDI-OUT port?

    • MrAureliusR / about 11 years ago / 2

      because all midi-ins have isolation. so the other end would

  • Eggman / about 12 years ago / 1

    Just as a warning to others who might make the same mistake I did: for whatever reason, the Arduino designers decided to use a different spacing between the different groups of .1" headers other than .1". This means you can't take a shield and plug it into a breadboard in order to use it with a non-Arduino micro-controller. Very unfortunate design choice (deliberate or otherwise).

    • MikeGrusin / about 12 years ago / 2

      Legend has it that when the first Arduino was made, those headers were supposed to be on 0.1" centers; but there was a layout mistake that went unnoticed until the first boards arrived, and now it's the "standard" so it can't be fixed.

      Because of this situation, we do have this handy part that might help you in your quest.

  • yan_g / about 12 years ago * / 1

    I stupidily soldered it with male headers... What should I do?

    • Kevin_S / about 12 years ago / 1

      If you are trying to remove the headers, just use a desoldering iron. Not expensive. Seems to work better than a solder sucker for unsoldering repeatedly.

  • yan_g / about 12 years ago * / 1

    Would be fine to have a "delete post" button btw.

  • naught101 / about 12 years ago * / 1

    Just posted some basic code on bitbucket to pipe MIDI from this shield straight to the Music Instrument Shield, using a Leonardo and a little pin re-wiring (moving the buttons to 8,9,10, to avoid conflict). Makes a cheap (~$75), no-frills, hackable midi sound module.

  • naught101 / about 12 years ago / 1

    What's the license on the example sketch?

  • N8ter / about 12 years ago * / 1

    Trying to get MIDI input to work with this shield on an UNO V3 board. I'm kind of new to this, so guessing it could be something really simple. MIDI output is working fine. MIDI input just seems to be dead. Assuming it could be a bad solder joint, but everything looks good.

    What I need to know is:

    • Is there a simple sketch I can use to test MIDI input on this shield?

    • What pins should I test with my meter to validate my connections? I get a positive reading if I test Pin4 on my MIDI Out against the TX line from the shield - should I get the same on Pin4 of my MIDI In against the RX line (I don't)?

    • What does the RUN/PROG switch do? My MIDI Out tests work in either mode.

    • N8ter / about 12 years ago / 1

      Quick update: I used the code found in the link below to test MIDI input: * http://www.instructables.com/id/Send-and-Receive-MIDI-with-Arduino/step9/Receive-MIDI-Messages-with-Arduino/

      though I added a simple led 13 blink routine to the 'if (Serial.available())' loop, as well as one in the startup. When I upload the code in PRG mode, I see the initial startup blink routine (5 slow blinks), but nothing when I try MIDI input (still in PRG mode). Of course, when I switch to RUN mode, the LED blinks continuously and rapidly.

      I've uploaded other simple non-MIDI routines (simple LED blinks) that appear to work fine in both PRG or RUN modes.

      • Is there a potential problem with the shield?
      • Should I see any activity on the MIDI shield LEDs? How do I even access/program the MIDI shield LEDs?

  • xulioc / about 12 years ago / 1

    We've developed a compatible USB Shield. Take a look at http://wp.me/s2xMqH-703.

  • Member #224396 / about 12 years ago / 1

    I'm not familiar with processing code, and I'm finding it very hard to figure out what's going wrong with the provided "example sketch". Can anyone provide an example sketch that is 1.0.2 compliant?

  • Coyote123 / about 12 years ago / 1

    I have the same problem with mayhem9 {Example Sketch does not seem to be 1.0 compliant: Midi_Shield.cpp: In function ‘void Midi_Send(byte, byte, byte)’: Midi_Shield.pde:-1: error: ‘BYTE’ was not declared in this scope As of Arduino 1.0, the ‘BYTE’ keyword is no longer supported. Please use Serial.write() instead.} There is no way I can work with this shield. Anyone any thoughts?

    • brendanclarke / about 12 years ago / 1

      It's pretty much a direct substitution. IE Change 'Serial.print(cmd, BYTE);' to 'Serial.write(cmd);' etc. For example, 'Serial.write(0x90); Serial.write(0x24); Serial.write(0x7F);' sends note-on for a low 'C' at max velocity.

  • Member #338604 / about 12 years ago / 1

    Hi. When I mount the shield onto the Arduino board, the power cuts out, and I lose my com port to connect. When I remove the shield, power comes back on and I can connect to the board (but not using shield). Help!

    • Andy2No / about 12 years ago / 1

      Have you checked for solder bridges? A multimeter with a continuity beeper is my favourite way, but just a multimeter set to the lowest resistance scale works.

  • chipaudette / about 13 years ago / 1

    Would this hardware be compatible with a 3.3V device like a LeafLabs Maple or one of the 3.3V Arduinos?

    • chipaudette / about 13 years ago / 1

      To partly answer my own question, the schematic is mostly free of active components (meaning it would work at 3V) except for the optoisolator. Looking up that part number, it looks like it should work fine at 3V. Great. I would love to get some confirmation, though.

      • chipaudette / about 13 years ago / 1

        I tried the MIDI shield with my Maple. After a bit of fiddling, it seems to work fine. Good. note that I've only used it to receive MIDI messages from my keyboard. That worked fine. I have not tried to send MIDI messages.

  • redzy / about 13 years ago / 1

    Can someone please change the description above? MIDI is not a powerfull protocol. At all. In fact, it is realy crappy and pretty stupid/simple. It has been around since the '70s because all the synth manufacturers could/can not decide on a common standard(!! boohoo) For the last 20 years or so there have been many attempts to bring synth communication to modern levels but all have failed because of propietryness. And that is why MIDI is still relevant. It is a sad story realy.

  • mayhem9 / about 13 years ago / 1

    Example Sketch does not seem to be 1.0 compliant:

    Midi_Shield.cpp: In function 'void Midi_Send(byte, byte, byte)': Midi_Shield.pde:-1: error: 'BYTE' was not declared in this scope

    As of Arduino 1.0, the 'BYTE' keyword is no longer supported. Please use Serial.write() instead.

  • bder / about 13 years ago / 1

    I bought the Midi Shield I use with the new Uno. It works fine when connected to my keyboard. I encounter some problems using the push button, probably because of their 'no state' when not pushed (no resistor to the Vcc).

  • These colorful buttons fit perfectly on this kit.

    http://www.sparkfun.com/products/10302

  • andyb / about 13 years ago / 1

    Sparkfun, I'm concerned about safety of this shield. The ground pour extends on BOTH sides of the optoisolator to within a few tens of mils of pins. To maintain isolation between the MIDI device and the Arduino, there should be a few 100 mills separation. Ouch guys.

  • PDR / about 13 years ago / 1

    Hello. I'm hoping somebody can answer my questions. So far I've gotten the shield to send midi note on/off with the buttons anc control note number and velocity with the pots. I'd like to implement more midi features, but the sample sketch has no explanations for the midi functions it uses nor is there any info on the applet the sketch comes with. I'd like to use the Arduino MIDI Library v3.1 (http://www.arduino.cc/playground/Main/MIDILibrary) since it has an extensive Reference (http://arduinomidilib.sourceforge.net/a00001.html). Questions: Will I need to always include the applet from the sample sketch on new sketches? Does the applet folder contain data that is required for the basic function of the shield? I'm new to all of this (except for having to use midi devices for years), so I could really use some advice. Thanks.

  • ELHeath / about 13 years ago / 1

    I'm trying to build a foot pedal that will allow me to send MIDI "note on" information to a sampler at fixed velocity (127, if 127 is maximum). The information would be sent when a momentary switch is pressed and will stop sending when it is released. I also want this pedal to be able to send the same information if a different MIDI note is needed, so I would be able to move up, say from note 1, to note 20, without changing the velocity. This would enable me to trigger different loops with my sampler with my foot throughout my set.
    With this MIDI shield would this be possible? Also, whenever I look, throughout the open source projects that people are making which use Arduino boards, no one ever mentions the board model they have used and there are quite a few!
    Basically I am trying to build a similar design to the Midi Mouse, of a similar size, but allows me to send MIDI note information, as the Midi Mouse doesn't seem to (and anyway, is rather over-priced).
    Thanks!

  • cjenkins / about 14 years ago / 1

    The schematics shows MIDI out connector pin 4 wired to the TX pin on the Arduino, pin 5 wired to Vcc and pin 2 was left unconnected. While in the Arduino MIDI tutorial pin 5 is connected to TX, pin 4 to Vcc and pin 2 to ground. Someone knows why?

    • There are two things going on here. Sparkfun's parts library is usually excellent, but the person who did the MIDI connector (Din 5) really messed it up this time. Most pins are mislabeled - what they call 4 is actually 5 and what they call 5 is 4. Also pins 1, 2, and 3 are switched around. As for pin 2 - I think they just forgot to connect it to ground (they tried to fix this with the MIDI Breakout, where pin 2 is connected to ground, but because of the part mislabeling they actually grounded the wrong pin!)

      • playinmyblues / about 10 years ago / 1

        After looking into the Cypress PSoC 4 I have started to look at this shield. I also use Arduinos so it interests me for them as well. When I look at the MIDI Electrical Spec I also see that it appears SparkFun has the MIDI IN pins 4 and 5 reversed. However, most of the comments here say it works.

        SparkFun, or anybody else, am I correct in thinking the the diode (MBRA140 or 1N914 - see MIDI.org spec) allows for the signal for the MIDI_IN signal of the SparkFun product to also function as the MIDI_OUT pin would for the MIDI Electrical Specification?

      • yan_g / about 12 years ago / 1

        So, is the schematic wrong, or the actual circuit? I seem to be sending accurate data.

      • Nephiel / about 13 years ago / 1

        Maybe the pinout of the male plug is being used for the female socket?

  • PalmTreesandPICs / about 14 years ago / 1

    midi works at a non standard baud rate.. how do you set things up to get that baud rate?
    change crystal on the arduino?

    • You do not have to make any hardware changes. Just initialize the serial port with the correct baud rate:
      Serial.begin(31250);
      Make sure that you turn the on-board switch to "PROG" when you upload your code and to "RUN" when you are done uploading.

  • Niels / about 14 years ago / 1

    Real easy to use, works flawlessly! Soldering on the MIDI connectors is a snap. As noted, headers are not included, need to order those separately. The board includes some extra LEDs (the blinking lights in my application surprised me.. :) ). There's 2 pots and 3 push buttons which are all optional, works fine without those soldered in.
    One note: You might want to disconnect the MIDI cable when programming the device, it looks like there's some bytes sent out to the MIDI OUT (even with the little switch set in PROG) that arrive at connected MIDI gear. My patch bay gets in a weird state whenever I upload a new sketch.
    (Not related to the product, but The MIDI example in the Arduino software (0021) has a space missing in the for statement in line 32, after int there should be a space.)

  • FutureLights / about 14 years ago / 1

    I have this board. But I was hoping I could decode the midi and send the information via the TX pin or any of the D2-D13 pins. Looking at the Arduino Sketch provided, how could I use the Midi In and sending information via these pins.
    Any help or tips is appreciated
    Thanks

    • naught101 / about 12 years ago / 0

      (whoops, reading comments on the wrong shield, sorry)

  • AdamTolley / about 15 years ago / 1

    So then is there a way to program the arduino to act as a class compliant midi interface over USB? This could then pull double duty talking to MIDI, and carrying it back to the pc.

    • Bret Mattingly / about 15 years ago / 1

      Unfortunately, no. It'd require some sketchy driver hacking, which has to be done on every system that you want to use the device with. The problem lies in the fact that the FTDI chip on the Arduino uses the USB port as a pseudo-Serial port, not a USB port. I hear the Teensy works well for USB-MIDI, though.

      • naught101 / about 12 years ago / 1

        So it should be possible with the Leonardo then, right?

  • SK Pang Electronics / about 15 years ago / 1
  • David_K / about 15 years ago / 1

    Nice. Any chance we could get a DMX version of this?

    • haldean / about 15 years ago / 1

      Oh man - YES PLEASE. I would kill for some easy Arduino/DMX interfacing.

      • David_K / about 15 years ago / 1

        Me too. I have been hoping for a simple Arduino to DMX and DMX to Arduino interface for ages. There are so many things you could do with it.

Customer Reviews

3 out of 5

Based on 2 ratings:

Currently viewing all customer reviews.

1 of 1 found this helpful:

Midi Sheild

Works just as described

1 of 1 found this helpful:

I think I got a dud...

I believe the onboard switch that changes modes from "Program" to "Run" is bad. The unit will only operate if pressure is exerted on the teenie switch. This is a component pre-installed, not a part that I had to solder to the board, or I would blame myself. But it appears to just be a "bad one." Pretty disappointing as I had big plans for this unit and was going to get some more for other projects. I guess Ill keep searching for a better one.

Hi, I'll drop you a line in your personal inbox. We'll get you taken care of. :)