OpenPipe Breakout connected to Arduino

So far the highlight of our work is the OpenPipe Breakout Board.

This board is a capacitive sensors prototype board with bagpipe chanter or flute layout. Its I2C interface allows you to connect the board to any microcontroller, particularly with the Arduino familiy, for which we provide several examples. The board basically reads whether the finger is placed or not placed over the electrode, and can also measure “how much of the finger” is placed over the electrode.

The OpenPipe Breakout layout allows you to integrate it into several custom DIY mechanics, but we also provide a DIY KIT containing all the mechanics required to build a simple chanter interface with a PVC pipe.

Electronics schematics, source code and related information are all open sourced, and could also be the basis for further developments.

Description

 

The OpenPipe Breakout Board is a breakout board for Freescale’s MPR121.

The MPR121 is a capacitive touch sensor controller driven by an I2C interface. This chip can control up to twelve individual electrodes.

The peculiarity of the OpenPipe Breakout Board is that the electrodes are placed longitudinally, like fingers in a flute or bagpipe chanter, in order to build an electronic flute or bagpipe with it.


Hardware

 

The Breakout Board is based on the MPR121 Capacitive Touch Sensor Breakout Board from SparkFun. In their page you can also find useful information, schematics and sample code.

The schematic is quite simple: the MPR121, with I2C and IRQ signals available; the 3V3 regulator, for connecting with 5V devices; and pull-ups in I2C and IRQ lines, that could be disabled by desoldering the solder jumper.

 

Two voltage inputs are available: VCC connects directly with the MPR121, so you must keep VCC input range (1.71 V to 3.6 V) as defined in the MPR121 datasheet. VIN connects through the 3V3 regulator, so you can use up to 12 V input, but the I2C signals will remain at 3V3 levels.

The 12 electrode holes are intended for use with M3 HEX SPACERS, so the hole is 3mm diameter. We usually insert the board into a 13mm inside diameter PVP pipe and use DIN912 screws for fixing the board to the pipe, but you could integrate the OpenPipe Breakout Board in custom mechanics, at your choice.

 

Software

We provide several Arduino examples using OpenPipe Breakout Board. You can find the related code in github.

In order to read the electrodes using Arduino Wire library for I2C communications you should use something similar to this code (also used in the examples provided):

 
void OP_read_fingers(void){
 
  int i;
  char buffer[32];
 
  // READ MPR121
  Wire.beginTransmission(0x5A);
  //Wire.write(0x00);
  Wire.requestFrom(0x5A, 18);
  while(Wire.available())
  { 
    buffer[i] = Wire.read();
    i++;
  }
  Wire.endTransmission();
 
  // SORT MPR121 ELECTRODES
  fingers=   ((buffer[0]&(1<<0))>>0) | 
             ((buffer[0]&(1<<1))>>0) |
             ((buffer[0]&(1<<2))>>0) |
             ((buffer[0]&(1<<4))>>1) |
             ((buffer[0]&(1<<7))>>3) |
             ((buffer[0]&(1<<6))>>1) |
             ((buffer[1]&(1<<2))<<4) |
             ((buffer[1]&(1<<1))<<6);
 
  control=0;
  //RIGHT THUMB
  if ( buffer[0]&(1<<5) ) control |= OP_CONTROL_ENABLED_FLAG;
 
}

Examples

Here are some examples using the OpenPipe Breakout Board with Arduino.

Arduino generating PWM sound

We connected the OpenPipe Breakout Board to an Arduino Mega and used PWM output for sound generation. The note to play is found in a table based in fingers position, then the note is played. You can find more information in this post. Code here.

 

Arduino connected to Music Instrument Shield

In this example we connected the OpenPipe Breakout Board to an Arduino with a Music Intrument Shield from SparkFun. This shield acts as a MIDI synthsizer. From the Arduino sketch you can select/change the MIDI intrument used, as long as send MIDI NOTE ON and NOTE OFF events. More information about this example is available in this post. Code here.

 

Arduino acting as USB MIDI controller

In this example, we made a trick in order to let the Arduino act as an USB MIDI controller, and used GarageBand for MAC OS for soud generation. More information available in this post. Code here.

 

More Links

I want one!!!

  • Paul St. Denis

    I figured out it does have thumb buttons based on the fingerings python code. None of the fingerings have half holes however and I recall reading you saying that the breakout will detect partial fingerings?

  • Paul St. Denis

    I can’t tell, does the openpipe have a thumb “hole”? Is there a fingering chart online? BTW the wiki has been hacked, I tried to revert but it doesn’t seem to be editable

  • Trazman025

    open pipe not working for my fluxamasynth what color of wire do i put where?

  • trazman025

    sorry for multi-posting. Can I upload diffrent code for the midi sheild and use instument code for the fluxamasynth and stack them and use the openpipe with it?

  • trazman025

    I have a fluxamasynth and a uno and a dfrobot midi shield with non usb. the midi shield uses standerd midi in midi out jacks.

  • trazman025

    what about using the fluxamasynth with a midi shield non-usb as well?

  • trazman025

    will the music instrument code work for fluxamasynth?

    • http://twitter.com/openpipe OpenPipe

      Both shields use MIDI input from Arduino TX pins so it should work.