The Air Piano is a portable musical instrument that encompasses the functionality of a grand piano. When folded, the Air Piano is small enough to fit in a pocket. When unfolded, it extends to 5 feet. The body consists of lasers and sensors running along a frame that has been segmented for folding. Wiring throughout the body connects the sensors to the speakers on the outside of the frame. The Air Piano also has Bluetooth capabilities to connect to external speakers. Sound is emitted when the path from laser to sensor is interrupted.

Share this project:


posted an update

Group 1738 Vibhav Jagwani and Sebastian Peralta December 13, 2016

Project name: HarmoniBoard

Abstract: The HarmoniBoard is a portable piano. This piano only has twelve keys, but it is possible to change octaves so that multiple keys can be played. The piano frame was 3D printed, and one side was lined with photo resistors while the other side was lined with focused LEDs. When the path from each LED to its respective photo resistor is interrupted, for example, by a finger, a certain frequency is returned. The board then sends the frequency over bluetooth to a laptop, and sound is emitted from the laptop speakers.

Materials: Arduino board x 2 Breadboard x 1 10 kOhm resistor x 12 LED x 12 Photo resistor x 12 Bluetooth board x 2 3D printer or cardboard Many wires

  1. Design We 3D printed a 1x2x10 in. prism. 12 holes were cut out of each 1x10 side, and the 2x10 plane was hollowed, leaving space to place fingers and for light to travel. This was made in SolidWorks and printed in PRL. On one side of the board, we soldered photo resistors into holes, and one the other side of the board, we soldered superbright LEDs into holes. The Arduino and breadboard were glued to the side of the ‘piano’.

  2. Wiring The photo resistors were connected to analog pins while the LEDs had two long wires that connected all the cathodes with positive end of a battery and all the anodes with the negative ends of a battery. Each photo resistor has a 10k resistor. The breadboard has a Bluetooth board connected to it, which is connected to a Bluetooth board on the Arduino connected to laptop.

  3. Arduino Code The piano Arduino code initialized each photo resistor. We set a threshold- if the photo resistor returned a number below this threshold (when it was covered), then it would return a particular frequency in Bluetooth. We created an abstract method which ran 12 times in the loop, for each respective key.

The Arduino on the other laptop reads in the Bluetooth data and displays it in the serial.



include "String.h"

//#include SoftwareSerial BTSerial(2, 4);

// Created and binds the MIDI interface to the default hardware Serial port //MIDI_CREATE_DEFAULT_INSTANCE(); const int pr0=A0; const int pr1=A1; const int pr2=A2; const int pr3=A3; const int pr4=A4; const int pr5=A5; const int pr6=11; const int pr7=10; const int pr8=9; const int pr9=6; const int pr10=5; const int pr11=3;

//button variables const int BUTTON1 = 8; const int BUTTON2 = 12; const int BUTTON3 = 7;

//use buttons to select octave int octave() { int old_state1 = 0; int old_state2 = 0; int old_state3 = 0; int state1 = 0; int state2 = 0; int state3 = 0;

if (state1 == 1 && old_state1 == 0) { state1 = 1 - state1; delay(10); }

if (state1 == 1) { return 31; } if (state2 == 2 && old_state2 == 0) { state1 = 1 - state1; delay(10); }

if (state2 == 2) { return 42; } if (state3 == 1 && old_state3 == 0) { state1 = 1 - state1; delay(10); }

if (state3 == 3) { return 53; } } //****TODO void noteSelect(const int pr, int note) { //TODO - set threshold int threshold = 200; int val = analogRead(pr);

//debugging // Serial.println("pr"); // Serial.println(pr); // Serial.println("val"); // Serial.println(val);

if (val < threshold) { //TODO -make bt serial BTSerial.println(int(note)); Serial.println(int(note)); } }

void setup() { pinMode(pr3,INPUT); pinMode(pr2,INPUT); pinMode(pr1,INPUT); pinMode(pr0,INPUT); pinMode(pr4,INPUT); pinMode(pr5,INPUT); pinMode(pr6,INPUT); pinMode(pr7,INPUT); pinMode(pr8,INPUT); pinMode(pr9,INPUT); pinMode(pr10,INPUT); pinMode(pr11,INPUT);

//MIDI.begin(MIDI_CHANNEL_OMNI); // Listen to all incoming messages Serial.begin(9600); BTSerial.begin(9600); }

void loop() { noteSelect(pr0, 51); noteSelect(pr1, 52); noteSelect(pr2, 53); noteSelect(pr3, 54); noteSelect(pr4, 55); noteSelect(pr5, 56); noteSelect(pr6, 57); noteSelect(pr7, 58); noteSelect(pr8, 59); noteSelect(pr9, 60); noteSelect(pr10, 61); noteSelect(pr11, 62);




include "String.h"

SoftwareSerial BTSerial(2, 3); //TX TX

boolean stringComplete = false; //to indicate when the string is completed String totalString = ""; //The intermediate string to store characters String string_to_use = ""; //String that contains the final data to be parsed void setup() { BTSerial.begin(9600); // initialize serial communications at 9600 bps: Serial.begin(9600);


void loop() {

boolean skip = false; boolean read_data = false;//skips writing motor commands if no bluetooth data is read

while(BTSerial.available()) { //Check if there are any bytes to be read
char inChar = (char); //reads single character at a time
totalString += inChar;
if(inChar =='\n'){ //Read till end of new line
  totalString += '\0';
  BTSerial.flush();  //Clear bluetooth buffer
  read_data = true;

  1. MATLAB Code The Matlab code reads in the serial data and then plays a sound based on the respective key. This function is achieved using wave generation similar to our final ESE lab. This is just the main running section of our code. MATLAB CODE

clc; clear; % %Open serial global s; global note; global time; global previousNote0; global previousNote1; global previousNote2; global previousNote3; s = serial('COM5'); set(s,'BaudRate',9600); fopen(s); %infinte loop for i = 1:1000 note = str2num(fscanf(s)); % note = 50; % disp(note); if (note ~= 0) % disp(note); fs = 8000; T = .5; % 2 seconds duration t = 0:(1/fs):T; a = 0.5; y = a*sin(2*pi*note*t); sound(y, fs); clear playsnd; end end fclose(s); delete(s); clear s;

  1. Reflection on pivots We had several pivots during our exploits. At first we wanted to create three bodies, with keys on all of them, and make it foldable. As our idea evolved, we decided to use just twelve keys, but give the user the option to change the octave. Additionally, we order a Midi shield, learned about the Midi library, but were unable to implement it as our midikeyboard. We used a buzzer for demo day because transferring the serial data to Java and playing sound that way wasn’t working. For the final video, using feedback from a TA, we played sound using Matlab instead.

  2. What’s next? The PC speakers were successful in producing accurate notes but the quality is still less than par. We might want to find a way to send the Bluetooth message to Bluetooth speakers directly. Additionally, a wifi-shield could be used to upload music online, through something like SoundCloud’s API. Our additional plan used lasers to make the piano, which visually would be more aesthetic. If we continued to use LEDs however, we could use RGBs and change the color of an LED from red to another color when the signal is activated.

Log in or sign up for Devpost to join the conversation.