P19363: Player Piano

Preliminary Detailed Design

Table of Contents

Team Vision for Preliminary Detailed Design Phase

This phase our team focused on testing the sensor options we developed previously and designing new control circuits for the solenoids. We also assessed the code written by the previous team to see what changes we need to make in the future. Several sensors such as microphones, piezoelectric, vibration, and accelerometers were tested to verify functionality. A new board schematic with passive components and an IC that generates PWM signals was also designed to control the power and speed of the solenoids. We interfaced with the IC and generated PWM signals that will eventually allow us to dynamically change the volume of the keys being played. The microphone sensor had initially good results, but real-time analysis revealed poor sampling at high frequencies. The piezoelectric sensor revealed itself to work well in our conditions and is a likely candidate for feedback analysis moving forward.

Feasibility: Prototyping, Analysis, Simulation


Vibration Sensors (Piezo)
*Prototyping: Mounting piezo strips onto the piano keys by attaching sensors to wooden mounting at a slight angle.
*Simulation: Interfaced sensor to Arduino Uno to plot and read sensor outputs while pressing a sensor mounted key and keys surrounding sensor mounted key.
*Analysis: A lot of debouncing required, could be able to determine the volume by relating rise time of the signal to a volume. Definitely can determine order of keys played and what key was played.
Snap Action Switches
*Prototyping: Attached switch to wooden mounting at slight angle to level is resting on piano key. Supposed to allow voltage to pass when the level is torqued and presses the button.
*Simulation: Need to detect whether the switch allows voltage to pass, hooked leads up to a voltmeter to determine continuity when lever was torqued
*Analysis: Simple debouncing, would determine what key was pressed and is extremely easy to mount at connect to GPIOs
*Prototyping: Attempted to hook up to the Arduino Uno and read response when object passed through
*Analysis: Extremely invasive and tough to attach to piano, the size required to allow for the shaft of the hammer to fly back into it is too big to have 100% certainty a key (hammer) was pressed (passed through).
*Prototyping: Would attach sensor to piano key
*Analysis: No reliable way to attach the sensor to the piano key without modifying the piano permanently.
*Prototyping: Attached microphone to mounting brackets and analyzed output through Arduino ADC.
*Simulation: Modelled noise using C coding, and looked at the direct output of the microphone over an oscilloscope.
*Analysis: Complex output that is easily affected by noise, difficult to analyze under average conditions.

Sensor Design

After our feasibility analysis it was found that the Microphone and Piezoelectric Vibration Sensors would be the most viable options.

Piezo Electric Sensor

The Piezoelectric Vibration Sensors would be implemented such that there would be one sensor which rests on the back portion of each key. This sensor will read a key press this data is then transferred to a microcontroller which packages it and sends it serially to the Raspberry PI.


The microphone sensor would be implemented such that a small number of microphones <12 would be used. Each would cover a range of keys. These microphones would then be used to transfer the analog sound data to a microcontroller where a FFT would be used to determine the frequency of the notes being played and thus the notes. This system is also able to determine the intensity at which the notes are being played thus determining their volume.

Mounting hardware was also designed for the sensors. The different types simulated are shown below.

public/Photo Gallery/Pipesensors.PNG
Initial idea for sensor holder. Sits above the hammers. Sensors mounted by each hole.
public/Photo Gallery/flatsensors.PNG
Second iteration, flat surfaces easier to work with. Use a thin piece to mount securely above hammers on the four secure structures in piano. Thin enough to fit between pinheads and strings. Could glue sensors to the side to sense hammer movement.

Actuation Design

Control Circuit

The existing design for controlling the Solenoids is insufficient due to its known and unknown issues; burnouts, delays, etc. The solution to this issue is to redesign the control circuit. The solenoids will now be controlled by several PWM ICs and MOSFET amplifier circuits. The PWM IC is controlled by the Raspberry PI via SPI communication. Each IC has 24 individual channels which can be set to a different PWM duty cycle. This signal controls a MOSFET. The fet acts as a switch on the power line of the solenoid. By turning the fet on and off at the specific frequency dictated by the PWM signal the solenoid effectively receives a different DC voltage. Varying this voltage level allows the solenoid to be fired at various speeds. The diagrams below show a high level overview of this.
Flowchart of Soleniod Controll

Physical Instalation

The existing design for the instalation and positioning of the solenoids is adequate for the expansion to all 88 keys. The main issue with the current installation of soleniods is the sound they make apon actuation. The Proposed remidy to this issue is to Epoxy Rubber O-rings to the bottom of a solenoid.

Software Design

Current UI

public/Photo Gallery/UI_pic.png
public/Photo Gallery/UI_page2.png

The current UI is very barebones in terms of appearance: plain back text on white background & only the necessary information on each page. While it does function properly, it could be made more visually appealing with a lightly colored background and slightly more stylized text/font.

UML Diagram of Current Server Code

Revised UML Diagram

Most parts of the flowchart will remain the same from the last group’s iteration. The main changes for our iteration are:

  1. Have the piano play at variable tempo based on the value selected on the tempo slider
  2. Have the piano play notes at variable volumes based on the values obtained from the MIDI files
  3. Take in player input & adjust piano playback based on the tempo & volume that the player is playing at



A feasability simulation was connducted for the microphone.
public/Photo Gallery/micscopecap.png

This clear waveform was produced by applying a 1.35 KHz tone to the microphone in a relatively noise free environment. This test shows a consistent waveform across the device and consistent frequency response. This test shows that in an isolated environment the microphone performs quite well considering its size and cost.

A feasability simulation was conducted for the Piezoelectric Sensor as well

This clear waveform was produced by tapping on a table next to the Peizoelectric Sensor. This test shows that a clear response to vibration can be seen by the sensor. It also shows that the sensor can respond well to rapid pulses.


The MOSFET circuit used to control the solenoids was also tested. The diagram below shows the voltage across the solenoid when a PWM signal is applied. The voltage varied when the duty cycle of the PWM was changed. The soleniod moved to its limit when the voltage was applied.
Vout Curve of the Solenoid

Test Plans

Several tests were condcted during this phase and more tests are planned for the future.


The microphone sensor was tested on the actual piano. The microphone was placed optimally near the cords of the piano. The sound of a keypress was then recorded.
Matlab Plot of Sampled Microphone Signal

The above plot shows the captured data from the microphone sampled at 4KHz through an Arduino Uno. The data was then plotted in Matlab. Two C Notes were played on the piano nearby the microphone, noted at the two large spikes in the waveform. Fourier analysis on this result however leaves much to be desired, the C3 frequency of 130Hz was not found. More analysis and testing is required to rule out the sensor, but the potential looks limited from here.

The vibration sensor was also tested. The sensor was placed on the backside of the key and the key was pressed. The key press registered on the sensor. Keys near the sensor were also pressed. These keys did not register large disturbances on the vibration sensor. This means that the sensor can practically be used to measure a keypress.


The solenoids were also tested. The voltage to sound ratio of the solenoids was found. This ratio proves that the solenoids can be actuated at different voltages to get a full range of sounds from the piano. The test below was conducted with the current solenoids in their current rack. This allows us an exact model of the system to see if the solenoids can be controlled practically.

Planned Tests

More tests are planned for the next phase.

Bill of Material (BOM)

public/Photo Gallery/BOM.PNG

Risk Assessment

Vout Curve of the Solenoid

Plans for next phase

Zachary Blough

Ava Enoch

Curtis Geiger

Mac Lee

Ryan Malley

Rodney Sanchez

Darrien Satterthwaite

Home | Planning & Execution | Imagine RIT

Problem Definition | Systems Design | Preliminary Detailed Design | Detailed Design

Build & Test Prep | Subsystem Build & Test | Integrated System Build & Test | Customer Handoff & Final Project Documentation