Professional Documents
Culture Documents
+- K. L. E. SOCIETY’S
K. L. E. INSTITUTE OF TECHNOLOGY,
Submitted By USN
1. Bhagyashree A 2KE22CS030
2. Aparna N H 2KE22CS024
3. Chandrika K 2KE22CS036
4. Deepa G T 2KE22CS043
1
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
K. L. E. INSTITUTE OF TECHNOLOGY,
CERTIFICATE
This is to certified that the mini-project work entitled “Simple Piano using Arduino”
is a bonafide work carried out by Ms. Bhagyashree A bearing USN:2KE22CS030,
Ms. Aparna N H bearing USN:2KE22CS024, MS. Chandrika K bearing
USN:2KE22CS036, Ms. Deepa G T bearing USN:2KE22CS043, in a partial
fulfilment for the award of degree of Bachelor of Engineering in II Semester,
Computer Science and Engineering of Visvesvaraya Technological University,
Belagavi, during the year, 2022-23. It is certified that all corrections / suggestions
indicated for internal assessment have been incorporated in the report deposited in the
department library. The mini project has been approved as it satisfies the academic
requirements in respect of mini project work prescribed for the said degree.
2
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
ACKNOWLEDGEMENT
To our beloved Principal Dr. Sharad Joshi, for providing an ideal atmosphere to
pursue our objectives under his administration.
We would like to express our heartfelt thanks to our project Co-ordinator and all
the
teaching faculty and staff members of the department of Electrical and Electronics
Engineering for constructive suggestion and constant encouragement.
We also thank our parents and all our friends whole heartedly who have rendered
their help, motivation and support to accomplish this project.
BHAGYASHREE A
3
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
APARNA N H
CHANDRIKA K
DEEPA G T
INDEX
1. Abstract…………………………………………………………………………..5
2. Introduction…………………………………..………………………………….6
3. Problem Definition……………………………………………………………....7
5. Methodology……………………………………………………………………..13
7. Conclusion ………………………………………………………………………16
4
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
ABSTRACT
This project presents the design and implementation of a simple piano using Arduino, aimed
at creating an interactive musical instrument for educational and recreational purposes. The
project leverages Arduino's hardware capabilities and programming environment to integrate
physical sensors as keys and generate musical notes through sound output components. By
mapping sensor activations to MIDI messages, the piano allows users to produce audible
notes in response to their interactions. The project serves as a practical introduction to
electronics, programming, and MIDI communication while offering opportunities for
customization and creative expression. The piano's cost-effectiveness, accessibility, and
educational value make it a valuable tool for beginners, educators, and hobbyists seeking to
explore the convergence of technology and music.
5
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
INTRODUCTION
Building a simple piano using Arduino is a fun and educational project that combines
electronics and music. This project allows you to create a basic musical instrument with the
Arduino platform. To start, you'll need an Arduino board (such as Arduino Uno), buttons or
touch sensors, and a piezo buzzer. The buttons or touch sensors will act as your piano keys,
and when pressed, they will trigger the piezo buzzer to produce musical notes. The notes can
be generated by sending specific frequency values to the buzzer. By programming the
Arduino using the Arduino IDE, you can map each button or touch sensor to a specific note
and control the duration of the note's sound.
The key steps involve setting up the hardware by connecting the buttons or touch sensors and
the piezo buzzer to the appropriate pins on the Arduino board. You'll then write the Arduino
code, which includes defining the pins for the sensors and the buzzer, creating an array of
note frequencies, and using conditional statements to play the corresponding notes when a
button is pressed or a touch sensor is activated. By iterating through the array and controlling
the buzzer's output, you can generate melodies and play simple tunes.
This project provides an excellent opportunity to learn about digital input and output, arrays,
conditional statements, and the basics of generating sound using a piezo buzzer. It's a great
way to combine creativity and technology, and you can even expand upon it by adding more
keys, experimenting with different melodies, or incorporating additional features. Whether
you're a beginner looking to delve into electronics or an enthusiast interested in combining
music and technology, building a simple piano using Arduino is a rewarding endeavor that
showcases the intersection of art and science.
6
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
PROBLEM DEFITNITION
The result of creating a simple piano using Arduino is an interactive musical instrument that
allows users to play notes and create melodies by interacting with physical sensors. When a
user presses a key (sensor), the Arduino generates MIDI messages that trigger corresponding
musical notes to be played through a sound output component, such as a piezo buzzer or a
speaker.
Key features and outcomes of the project:
1. *User Interaction: * Users can play musical notes by pressing the keys (sensors) of the
piano. Each key corresponds to a specific note, and the system responds in real-time to user
input.
2. *Sound Generation: * The Arduino generates MIDI messages that control the sound output
component. As a result, the sound output produces audible musical notes, creating a simple
but enjoyable musical experience.
3. *Note Mapping: * Each key's activation triggers a specific MIDI note or frequency,
allowing users to play different musical tones based on their interactions.
4. *Polyphony: * Depending on your project's design, the piano might support polyphony,
enabling users to play multiple notes simultaneously and create harmonies.
5. *Customization: * You can customize the project by adjusting note mappings, adding
octave shifts, implementing velocity-sensitive keys, or introducing modulation controls.
6. *Learning Experience: * Creating the piano provides hands-on experience in hardware
integration, software development, MIDI communication, and basic electronics. It's a great
way to learn about how musical instruments work.
7. *Creative Exploration: * Users can experiment with melodies, chords, and musical
patterns, fostering creativity and musical exploration.
8. *Educational Value: * The project can serve as an educational tool for teaching basic
concepts of electronics, programming, and sound generation to beginners.
9. *Showcase and Sharing: * Once completed, you can showcase your Arduino-based piano
to friends, family, or online communities. Sharing your project documentation can inspire
others and contribute to the maker culture.
Remember that the simplicity of the piano design allows for a foundational understanding of
these concepts. As you become more experienced, you can further enhance and expand the
project with additional features and complexities.
7
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
*Hardware Requirements: *
1. *Arduino Board: * Choose a suitable Arduino board, such as Arduino Uno, Arduino Nano,
or Arduino Mega, depending on the number of sensors and features you want to incorporate.
FIG:1
Arduino Nano
2. *Sensors: *
Select appropriate
sensors for the keys.
Options include push
buttons, capacitive touch sensors, pressure sensors, or even light sensors for continuous
control.
8
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
3. *Sound Output Component: * Use a piezo buzzer, small speaker, or external MIDI
synthesizer module to generate sound based on the MIDI messages sent by the Arduino.
4. *Wiring and Connectors: * Gather jumper wires, breadboard (if necessary), and connectors
to establish connections between sensors, sound output, and the Arduino.
9
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
5. *Power Supply: * Ensure a stable power supply for the Arduino and any additional
components. This could involve batteries, USB power sources, or external power adapters.
FIG:5 BATTERIES
10
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
*Software Requirements: *
#define T_C 262
#define T_D 294
#define T_E 330
#define T_F 349
#define T_G 392
#define T_A 440
#define T_B 493
#define T_C5 523
void setup ()
{
PinMode(LED, OUTPUT);
PinMode(C5, INPUT);
digitalWrite(C5,HIGH);
pinMode(LED, OUTPUT);
11
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
pinMode(C, INPUT);
digitalWrite(C,HIGH);
pinMode(D, INPUT);
digitalWrite(D,HIGH);
pinMode(E, INPUT);
digitalWrite(E,HIGH);
pinMode(F, INPUT);
digitalWrite(F,HIGH);
pinMode(G, INPUT);
digitalWrite(G,HIGH);
pinMode(A, INPUT);
digitalWrite(A,HIGH);
pinMode(B, INPUT);
digitalWrite(B,HIGH);
digitalWrite(LED,LOW);
}
void loop()
{ while(digitalRead(C5) == LOW)
{
tone(Buzz,T_C5);
digitalWrite(LED,HIGH);
}
12
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
while(digitalRead(C) == LOW)
{
tone(Buzz,T_C);
digitalWrite(LED,HIGH);
}
while(digitalRead(D) == LOW)
{
tone(Buzz,T_D);
digitalWrite(LED,HIGH);
}
while(digitalRead(E) == LOW)
{
tone(Buzz,T_E);
digitalWrite(LED,HIGH);
}
while(digitalRead(F) == LOW)
{
tone(Buzz,T_F);
digitalWrite(LED,HIGH);
}
while(digitalRead(G) == LOW)
{
tone(Buzz,T_G);
digitalWrite(LED,HIGH);
}
13
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
while(digitalRead(A) == LOW)
{
tone(Buzz,T_A);
digitalWrite(LED,HIGH);
}
while(digitalRead(B) == LOW)
{
tone(Buzz,T_B);
digitalWrite(LED,HIGH);
}
noTone(Buzz);
digitalWrite(LED,LOW);
14
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
METHODOLOGY
The methodology for creating a simple piano using Arduino involves a step-by-step process
that encompasses both hardware setup and software development. Here's a basic outline of
the methodology:
15
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
*10. Documentation: *
- Document your project, including the hardware setup, circuit diagram, code explanation,
and any troubleshooting steps.
- Share your project online if you'd like to contribute to the maker community.
16
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
17
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
*Advantages: *
1. *Educational Tool: * The project serves as an engaging educational tool for learning about
electronics, programming, and basic sound generation principles. It's an excellent way to
introduce beginners, students, and enthusiasts to the world of STEM.
2. *Hands-On Learning: * Building the piano involves hands-on assembly, wiring, and
coding, fostering practical skills in circuit design, sensor integration, and software
development.
3. *Creativity and Expression: * Users can explore their creativity by composing melodies
and tunes on a simple piano. It encourages artistic expression through music.
5. *Customization: * Builders can customize the piano's design, layout, and sound to suit
their preferences. It's an opportunity to tailor the instrument to specific creative visions.
6. *Introduction to Electronics: * Aspiring electronics enthusiasts can gain insight into sensor
technology, wiring, and the interaction between hardware and software.
*Applications: *
2. *Hobbyist Projects: * Enthusiasts can undertake the project as a hobby, combining their
interests in electronics and music to create a unique musical instrument.
3. *Interactive Art Installations: * Artists and creators can incorporate the simple piano into
interactive art installations that engage audiences in public spaces or galleries.
18
Department of CSE K.L.E.I.T Hubballi
Mini project on Simple Piano using Arduino
6. *Music Education: * While it's a basic instrument, it can be used as a teaching aid in
introductory music classes to help students understand basic musical concepts.
CONCLUSION
In conclusion, the creation of a simple piano using Arduino brings together technology and
music to offer an engaging and educational experience. By integrating physical sensors,
sound output components, and code, individuals can transform their Arduino boards into
interactive musical instruments. This project serves as a stepping stone for beginners to delve
into electronics, programming, and MIDI communication while fostering creativity and
musical exploration.
Through the process of building and experimenting with the simple piano, users gain valuable
insights into hardware integration, software development, and the mechanics of musical
instruments. The ability to generate sound based on user interactions introduces a tactile and
auditory dimension to the learning journey, making concepts more tangible and
understandable.
19
Department of CSE K.L.E.I.T Hubballi