Introduction: Make a Wind-controlled MIDI Instrument

This project was submitted to 'Creative Electronics', a BEng Electronics Engineering 4th year module at the University of Málaga, School of Telecommunications.

The original idea was born long ago, because my mate, Alejandro, has spent more than a half of his life playing the flute. Thus, he found appealing the idea of an electronic wind instrument. So this is the product of our cooperation; the main focus of this approach was to obtain an aesthetically sober construction, similar to that of a bass clarinet.

Demo :)


  • An Arduino board (we used the SAV MAKER I, based on Arduino Leonardo).
  • An air pressure sensor, the MP3V5010.
  • A strain gauge, the FSR07.
  • Resistors: 11 of 4K7, 1 of 3K9, 1 of 470K, 1 of 2M2, 1 of 100K.
  • One potentiometer of 200K.
  • One ceramic capacitor of 33pF.
  • Two electrolic capacitors of 10uF and 22uF.
  • One LM2940.
  • One LP2950.
  • One LM324.
  • One MCP23016.
  • One perforated board of 30x20 holes.
  • 30 pin headers, both female and male (one gender for the Arduino, the other one for the cape).
  • One pair of HD15 connectors, both male and female (with solder cups).
  • Borrow a friend's heat-shrink tube and isolating tape. Black preferred.
  • Two 18650 Li-ion batteries and their battery holder.
  • A switch.
  • An Arduino USB cable.
  • At least, 11 buttons, if you want a quality feel, do not use ours.
  • Some kind of enclosure or case. A wooden plank of about one square metre would suffice.
  • Half a metre of PVC tubing, 32mm external.
  • 67 degrees PVC joint for the previous tube.
  • One PVC reduction from 40mm to 32mm (external).
  • One PVC reduction from 25mm to 20mm (external).
  • An empty bottle of Betadine.
  • An alto saxophone mouthpiece.
  • An alto saxophone reed.
  • An alto saxophone ligature.
  • Some foam.
  • Lots of wire (audio wire recommended, as it goes in pair red-black).
  • Some screws.
  • Matte black spray paint.
  • Matte spray lacquer.

Step 1: Body

First off, a PVC pipe was chosen to be part of the body. You can select another diameter, although we recommend an external diameter of 32mm, and a length of 40cm, as we were comfortable with these dimensions.

Once you get the pipe in your hands, place a mark layout for the buttons. This depends on the length of your fingers. Now, with the markings done, drill the corresponding hole for each button. We recommend to start with a skinny bit, and engrow the hole incrementing the diameter used for the drill. Also, using a burin before the drill may improve stability.

You should introduce four unconnected wires in order to connect later the pressure gauge and the air pressure sensor; this piece (the body) and the neck are stuck together with a 67 degrees joining pipe. This pipe was sandpapered and painted black.

In order to join this piece with the foot, we used a PVC reduction joint from 40mm to 32mm (external diameter). Four wood screws were added for strengthening the junction. Between the reduction joint and the body, we made a drill and introduced a wider screw to gain stability. We recommend to drill the tubes before the wiring; otherwise, ruin is assured.

The next step is to solder wires to the buttons’ terminals, measuring length to bottom, and reserving an additional length for avoiding the connection to be tight. Once the pipe has been sandpapered and painted black (we used matte black spray paint; give as many layers as you want, until it looks nice under sunlight), introduce the buttons top to bottom, labelling each one of them. We recommend to use two different colours for the cables (e.g. black and red); as they are all connected to ground on one their pins, we left the black cable free, and labelled only the red cables. The buttons were covered using black isolating tape for them to match the look and fit nicely without falling down.

Solder HD15 female connector (solder cups help a lot), using the layout proposed in the diagram of step 4 (or your own one), and join the grounds together. Keep in mind that heat-shrink tubing will provide a strong reliability against short circuits.

Step 2: Foot Design

The circuit used for this design is, in its root, very simple. Two lithium batteries in series feed an LDO (low-dropout) voltage regulator, that supplies 5V from its output to the rest of the circuit. The LM324’s operational amplifiers serve the purpose of both adapting the dynamic range of the air pressure sensor (MP3V5010, 0.2 to 3.3 volts) and the behavior of the pressure gauge (negative slope variable resistor) to the analog inputs of the Arduino board (0 to 5 volts). Thus, a non-inverter of adjustable gain (1 < G < 3) is used for the first one, and a voltage divider plus a follower for the second one. These provide the adequate voltage swing. For further details about these devices, click here and there. Also, the LP2950 provides a reference for the 3.3 volts that need to be sourced to the MP3V5010.

Any model of the FSR (Force Sensing Resistor) series will suffice, and though the 04 is the prettiest, we used the 07 because of stock issues. These sensors change their electrical resistance depending on the bending force applied, and we tested experimentally that they do not when pressed alongside their entire surface. This was a mistake initially because of the place we were going to lay down the piece, but the adopted solution did a good work and will be explained in the fourth step.

One of the fundamental pieces of the board is the MCP23016. This is a 16-bit I2C I/O Expander that we thought useful for lowering the complexity of the code (and, perhaps, the wiring). The module is used as a read-only 2-byte register; it produces an interrupt (forces a logic ‘0’, and so a pull-up resistor is needed to set a logic ‘1’) on its sixth pin when any of its register values change. The Arduino is programmed to be triggered by this signal’s slope; after this happens, he requests the data and decodes it to know whether the note is valid or not, and if it is he stores it and uses it to build the next MIDI packet. Each of the buttons has two terminals, connected to ground and to a pull-up resistor (4.7K) to 5 volts, respectively. Thus, when it is pressed a logic ‘0’ is read by the I2C device, and a logic ‘1’ means released. The RC pair (3.9K and 33p) configures its internal clock; pins 14 and 15 are SCL and SDA signals, respectively. The I2C address for this device is the 0x20. Check the datasheet for further details.

The connection layout we used for wiring the HD15 connector is, of course, not unique. We did it this way because it was easier to route on the PCB we made, and the important point lies in keeping a clear list of the nodes and its respective buttons. Needless to say, but I will; buttons have two terminals. One of them (indistinctively) is connected to its respective node on the HD15 connector, while the other one is wired to ground. Thus, all the buttons share the same ground, and are connected to just one pin of the HD15 connector. The image we provide is the back view of the male connector, that is, the front view of the female pair. Solder the wires carefully, you don’t want to misconnect it, trust us.

Just so it stands clear, we designed the circuit for the Arduino to be connected onto it. There should be space enough for the circuit to fit below him, and so the box can be smaller than ours. The proposed building layout is offered in the picture below. We used silicone to stick the batteries’ holder piece to the interior of the box, drilled the cape on its edges and used screws to fix it this way.

In order to join this piece with the body,we used a PVC reduction joint from 40mm to 32mm (external diameter). Four wood screws were added for strengthening the junction. Between the reduction joint and the body, we made a drill and introduced a wider screw to gain stability. Be careful not to damage the wires.

Step 3: Mouthpiece Assembly

This is probably the most important part of the assembly. It is purely based on the diagram shown in the first image. The oversized part is big enough to fit into the 32 mm (external) PVC tube.

When designing this piece (the neck), we decided to use a PCB for mounting the MP3V5010, though you can ignore it. According to the PDF, the used terminals are 2 (3.3 volts supply), 3 (ground) and 4 (the air pressure electrical signal). Thus, in order to avoid ordering a PCB for this matter, we suggest you cut off the unused pins, and glue the component to the PVC tube once the wiring has finished. This is the easiest way we could think about. Also, this pressure sensor has two sensing knobs; you want to cover one of them. This improves its response. We did it by introducing a tiny metal piece into a heat-shrinking tube, this covering the knob, and heating the tube up.

The first thing you want to do is to find a piece with a conical shape that could fit in the air pressure sensor tube, as shown in the second image. This is the yellow piece in the previous diagram. With the help of a tiny drill, or a slim solder iron tip, carve a narrow hole at the peak of the cone. Test if it fits tightly; if not, keep growing the diameter of the hole until it does. When this is finished, you want to find a piece that fits around the previous one, covering it as to impede airflow outwards. In fact, you want to test at every step you take that air is not escaping the enclosure; if it does, try adding silicone at the joints. This should result in the next image. Just so it helps, we used a Betadine bottle for this purpose: the yellow piece is the internal dispenser, while the piece that covers it is the cap with a cut on its head to transform it into a tube shape. The cut was made with a hot knife.

The next piece was a PVC reduction from 25 (external) to 20 (internal). This piece fitted nicely into the already arranged tubing, although we needed to sandpaper it and glue its walls for impeding the mentioned airflow. For now, we want this to be a closed cavity. In the diagram, this piece we talk about is the dark grey one that directly follows the yellow one. Once this piece has been added, the neck of the instrument is almost finished. Next step is to cut a piece out of the 32 mm (external) diameter PVC tube and drill a hole in its center, letting the wires of the pressure gauge to go out. Solder the four wires we mentioned earlier in step 1 as shown in the next diagram, and glue the neck to the angled junction (after painting it black, for aesthetic purposes).

The last step is to seal the mouthpiece conveniently. For this task to be accomplished, we used an alto sax reed, black insulating tape and a ligature. The pressure gauge was situated under the reed, before applying the tape; the electrical connections to the gauge were reinforced with black heat-shrinking tubes. This piece is designed to be extracted, so that the cavity can be cleaned up after playing for some time. All this can be seen in the last two pictures.

Step 4: Software

Please download and install Virtual MIDI Piano Keyboard, here is the link.

The logical way to perform this step is the following: first, download the Arduino sketch provided in this Instructables and load it onto your Arduino board. Now, launch VMPK and kindly check your settings. As shown in the first image, 'Input MIDI connection' should be your Arduino board (in our case Arduino Leonardo). If you are using Linux, there is no need to install anything, just make sure your VPMK file has the properties shown in the second figure.

Step 5: Troubleshooting

Case 1. The system does not appear to be working. If Arduino’s LED is not lit up or it is slightly darker than usual, please check that the system is properly powered (refer to case 6).

Case 2. There seems to be smoke because something smells like burnt. Probably, there is a short circuit somewhere (check power and wire harnesses). Maybe you should touch (with caution) each component to check its temperature; if it is hotter than usual, don't panic, just replace it.

Case 3. Arduino is not being recognized (in the Arduino IDE). Upload again the provided sketchs, if the problem persists, make sure the Arduino is properly attached to the computer and Arduino IDE settings are set to default. If nothing works, consider replacing the Arduino. In some cases, pressing down the reset button while "compiling", and then releasing it while "uploading", can help uploading the sketch.

Case 4. Some keys appear to be malfunctioning. Please isolate which key is not working. A continuity test may be useful, or you can use the provided sketch for testing the buttons; the pull-up resistor may not be soldered correctly or the button is faulty. If the keys are okay, please contact us exposing your trouble.

Case 5. I can’t receive any note on VMPK. Please check that the Arduino is properly attached to the computer. Then, on VMPK, follow the steps shown in step 3. If the problem continues, perform a button reset or contact us.

Case 6. Electrical power-on test. Perform the next measurements: after removing the Arduino from the cape, turn the switch on. Place the black probe on the ground pin (anyone will suffice) and use the red probe to check the power nodes. At the positive plate of the battery there should be at least a voltage drop of 7.4 volts, otherwise, charge the batteries. There should exist the same voltage drop at the input of the LM2940, as seen in the schematic. At its output, there must be a 5 volts drop; the same value is expected from the LM324 (pin 4), the MCP23016 (pin 20) and the LP2950 (pin 3). The output of the last one should show a value of 3.3 volts.