The video

Google Drive:

The idea

Our idea for Nature’s Piano was to create a piano that modified the mood and tone of music depending on the environmental factors around the user. It does this by emitting higher notes when light is sensed and deeper notes in its absence (darkness). Furthermore, the chip provides temperature feedback the Blynk app so that the user can get a better idea of how environmental factors affect their playing. We wanted to pursue this project to add greater depth to the musical experience. As the environment often influences the mood of the musician, and, subsequently, his/her playing style and taste, we wanted to facilitate this process by creating a piano that makes these changes automatically while also providing useful information the musician can apply to the future.

Build process

We began the process with the concept of having two separate boards, one board inside and one board outside. The outside board was meant to detect the weather and modify the notes and lighting of the inside piano board accordingly. However, we realized that leaving such sensitive equipment outside in the elements could possibly result in damage. In addition, the mood of the musician is likely more affected by the environment directly around them such that the warmth of a nearby fireplace has a greater effect on a person’s mood than the wind and snow outside. Taking this modification into account, we decided to use the wifi capabilities previously used to allow the boards to communicate with one another to provide environmental data instead. This way, musicians using this piano could observe the environments they have been playing in and correlate this information with their musical performance and taste. Thus, it would give musicians a better understanding of their style and what influences it and allowing them to take this into account in the future whether it be for practice or performance.

Hardware explanation

For the hardware, there are three push buttons, three resistors, one light sensor, one speaker, one MKR1000 board, one Arduino board, and a number of wires. For each of the three push buttons, a wire from the power leads to a push button. From there, there are two wires: one which leads to an input port and another which leads to a resistor, which leads to ground. Furthermore, there is a light sensor. For the light sensor, a wire leads from the power to the light sensor. From there, there are two wires, one that leads to an input port and another which leads to a resistor, which leads to ground. The speaker is connected directly into the input and ground ports. Both the Arduino board and the MKR1000 board are connected to computers.

Software explanation

The code for the project is relatively simple. The loop takes in the readings from the four buttons and the light sensors. Depending on which buttons are currently being pressed, it uses tone to play a specific note through the speaker. The code uses an array that contains four notes (the frequency for notes is determined by the arduino file ‘pitches.h’), where the first button will play the first note in the array, the second button plays the second entry in the array, etc. The notes contained in the array are dependent on the light sensor: depending on how bright the current light sensor is reading. If the brightness of the light sensor is below a certain threshold, then it takes an array of four notes and uses those four notes as the notes for the buttons. If the brightness is above that threshold, then a different array of four notes is used for the buttons.

The code to retrieve temperature from the MKR1000 board uses a function gettemp() which reads a temperature value from analog pin 5 and converts that value to a value in degrees Fahrenheit. The temperature value is written to virtual pin V5 using myTimerEvent, and the function is called every second. Lastly, the values are sent to the Blynk app using an authorization code sent from the app that is set as the string “char auth.”

Creating a real product?

This product could be used for both student and professional musicians alike. For students, this product would allow them to explore different tones of music and have a dynamic experience. With differing sounds, this product could break up some of the monotony of long hours of practice as the tone would shift with the day and seasons. The data feedback would also be useful for students. As they practice, they will be able to gather information that can be used to inform future performances. For example, a student may notice that their worst performances tend to occur when it is cold, and he/she could infer that the cold is affecting their focus and hand movement, allowing him/her to avoid this potential pitfall in the future. For professionals, similar benefits are garnered. The notable difference being in the function of the variable tone. Professionals would use this tool to automatically apply an environmentally-influenced mood to the product. This would allow them to focus more on the notes of the piece and the actual performance.


The improvements we would want to make to this product would be to add additional keys, improve the sound quality, apply a more conventional piano format (as opposed to push buttons), perhaps give the heat sensing an additional function, like controlling a light, and potentially add weatherproofing in order to allow the user to take it outside and in the elements. We feel these changes would increase user experience and make this a more enjoyable, easy-to-use product.

Built With

Share this project: