Beruflich Dokumente
Kultur Dokumente
I, FARID SYAZWAN BIN SHARIZAN, agree to allow this Undergraduate Project Report to be
kept at the Library under the following terms:
1. This Undergraduate Project Report is the property of the Universiti Tun Hussein Onn Malaysia.
2. The library has the right to make copies for educational purposes only.
3. The library is allowed to make copies of this report for educational exchange between higher
educational institutions.
4. ** Please Mark (√)
FREE ACCESS
√
Approved by,
Permanent Address:
NO 17, JALAN KOOP 5,
TAMAN KOPERASI BENA,
BATU 8 IJOK,
45620 BESTARI JAYA,
SELANGOR
Date: Date:
NOTE:
** If this Undergraduate Project Report is classified as CONFIDENTIAL or
RESTRICTED, please attach the letter from the relevant
authority/organization stating reasons and duration for such classifications.
ELECTRONIC DRUM FOR TRAINING PURPOSE
A project report submitted in fulfillment of the requirement for the award of the
Bachelor of Electronic Engineering Technology (Communication and Computer)
with Honours
JANUARY 2019
II
I hereby declare that the work in this thesis is my own except for quotations and
summaries which have been duly acknowledged.
Date : ……………………………………….
Supervisor : ………………………………………
ABDUL SUKOR
III
ACKNOWLEDGEMENT
First and foremost, I offer my sincerest gratitude to my supervisor Prof. Madya Dr. Jumadi
bin Abdul Sukor who has a lot to give guidance, advice and ideas in the process of
implementation of this project. Besides that, he has also helped us to complete the project
from beginning to end until the project is successfully. Moreover, he taught how to write
the final draft with correct and accurate. However, not left to the other lecture which has
help I weathered many problem and obstacles in carrying out the project to successful. I
also offer my regards and blessings to my colleagues and all of those who supported me
in any respect during the completing of the project. Last but not least, my profound
gratitude goes to my parents, who inspired me to study in UTHM and to pursue the degree.
Their encouragements have made it possible for me to complete this portion of my
education in life.
V
ABSTRACT
Musical instruments are now an attraction to the public especially young people. Due to
the very high demand on the market, the price of musical instruments is too expensive and
can hit thousands of dollars. This project is very helpful for those who want to have an
electronic drum with low cost. Both hardware and software are required to develop this
project. This project targets on a simple microcontroller, Arduino UNO R3 connected to
five number of pads and each of the pads equipped with a piezoelectric sensor. This sensor
will detect drum beats from user and the received signals will be operated by the Arduino
and then sent to Hairless MIDI Converter for detecting the MIDI Signal. User can control
the sound effects of each pads in Addictive Drums, the Digital Audio Workstation. This
electronic drum also comes with metronome that help user to maintaining the tempo when
playing the drum.
VI
ABSTRAK
Alat muzik kini menjadi daya tarikan kepada orang ramai terutamanya golongan muda.
Oleh kerana permintaan yang sangat tinggi di pasaran, harga alat muzik terlalu mahal dan
boleh mencecah ribuan ringgit. Projek ini sangat membantu bagi mereka yang ingin
mempunyai drum elektronik dengan kos yang rendah. Kedua-dua perkakasan dan perisian
diperlukan untuk membangunkan projek ini. Projek ini menyasarkan pada mikrokontroler
mudah, Arduino UNO R3 disambungkan kepada lima pad dan setiap pad dilengkapi
dengan sensor piezoelektrik. Sensor ini akan mengesan pukulan drum dari pengguna dan
isyarat yang diterima akan dikendalikan oleh Arduino dan kemudian dihantar ke Penukar
Hairless MIDI untuk mengesan Isyarat MIDI. Pengguna boleh mengawal kesan bunyi
pada setiap pad di Addictive Drums, Workstation Audio Digital. Drum elektronik ini juga
dilengkapi dengan metronom yang membantu pengguna mengekalkan tempo ketika
bermain drum.
VII
TABLE OF CONTENTS
TITLE I
DECLARATION II
DEDICATION III
ACKNOWLEDGEMENT IV
ABSTRACT V
ABSTRAK VI
TABLE OF CONTENTS VII
LIST OF TABLES X
LIST OF FIGURES XI
LIST OF SYMBOLS AND ABBREVIATIONS XIII
LIST OF APPENDIX XIV
CHAPTER 1 INTRODUCTION 1
1.1 Background of Study 1
1.2 Problem Statement 3
1.3 Project Objective 3
1.4 Project scope 3
CHAPTER 3 METHODOLOGY 10
3.1 Introduction 10
3.2 Project Methodology 11
3.3 Planning 12
3.3.1 Literature Review 12
3.3.2 List of Hardware in Project 13
3.4 Design 13
3.4.1 Block Diagram 13
3.4.2 Flow Chart 15
3.4.3 Hardware Development 17
3.4.3.1 Arduino UNO 17
3.4.3.2 Piezoelectric Sensors 19
3.4.4 Software Development 20
3.4.4.1 Hairless MIDI Converter 20
3.4.4.2 XLN Addictive Drums 22
3.4.5 The Schematic Diagram 23
REFERENCES 39
APPENDICES 41
X
LIST OF TABLES
LIST OF FIGURES
LIST OF APPENDIX
INTRODUCTION
Everyone loves music. It is because music can produce beauty of form, harmony and
expression of emotion. There are many ways to appreciate music such as listening to the
songs or playing musical instrument. Nowadays, more and more people are keen to play
musical instrument. But the problem is the price of musical instruments in the market are
very expensive which can hit thousands of dollars. This project is aimed at producing
electronic drum pad with lower costs and affordable.
Electronic drum pads are portable, flexible percussion devices that can play
various drum sounds and samples. It has a variety of interactive controls to develop the
drumming experience and has the shape and sound like the real drum set. In this project,
the electronic drum pad has five numbers of pads with different types of sounds which are
the snare sound, opened high-hat cymbal sound, closed high-hat cymbal sound, kick-pedal
sound and crash cymbal sound. This project use drum stick to hit the pads and then
2
produce a sound except the kick-pedal pad as it is necessary to use the foot. Besides, this
electronic drum also comes with metronome. The metronome will produces ticking
sounds and acts as a tempo references to the user when playing the electronic drum [10].
User also can controlling the tempo of the metronome by rotating the potentiometer.
Figure 1.1 shows the overview of the project.
The most common problem with the drummer is that the real drum sets are difficult to
carry everywhere because of size and weight of the drum set. Besides, people who want
to play the drum at home needs to spend a lot of money to make soundproof space because
the real drum set produces very loud noise and disturbing others. Other than that, the price
of drum set in the market is very expensive which can reach a thousand dollars. Lastly,
the beginner drummer also have problem to follow and maintain the tempo when playing
drum.
The works undertaken in this project are aiming on the following objectives:
a) Using Arduino software to control the operation of the electronic drum pad.
b) Using piezoelectric sensors to detect beats stimulated by user from drum pads.
c) Specification types of sounds for each pad using Digital Audio Workstation.
d) Using potentiometer to control the tempo of the metronome.
CHAPTER 2
LITERATURE REVIEW
2.1 Introduction
Nowadays, technology plays an important role in life. Many people had used technology
to improve their daily routines. Thus, technology was used to build up this project to
makes human life easy. Electronic drum pad was built and has the same concept. Drummer
does not have to worry about the problem of transporting their drum because the project
has produced a portable drum and easy to carry anywhere. There is a different that has
been improved from the previous version which the drum pad is able to record audio files
by using Digital Audio Workstation.
This chapter gathers information that allow us to gain knowledge about technologies that
have been used relative to this project. From the previous research, most of the project
5
was used Arduino technology to control the program. In order to gain knowledge, several
projects are reviewed.
Basically, most of the researches have the same concept with this project. All of
the previous researches are using piezoelectric sensor to measure changes in pressure,
acceleration or force produced by the user. The main difference that have been noticed
from all the previous projects is the shape of the drum. There is a drum with a small size
and also a drum that has a same size to the real drum. From one of the previous projects,
it uses 3D printing technology to create replications of existing instruments or instrument
parts. This technology able to make three dimensionals solid object from a digital file.
In addition, the main problem that have been studied from the previous projects is
the drum produces sound twice for one tap on the drum pad. The reference of the previous
projects has been collected and shown in Table 2.1. In addition, besides using the resource
references from previous projects, other references such as books and the internet also
used in order to complete this project. The main used of this project is still the same with
the previous projects which is to play electronic drum.
2. MIDI Drum Kit with 3D This project is designed by Ryo Kosaka. This drum kit is roughly
Printer divided into two productions: pad made with a 3D printer and thick
paper and trigger Midi converter with Arduino UNO. It’s 3D-
printed out of several individual pieces, which are glued together
using thick paper to help hold everything intact. This project only
need a 120mm x 120mm print area to produce this 8-inch drum
pad. In this project, the Rockband controller is used to interface
with digital audio workstations. The signal sent from the pad is
processed by Arduino and converted into MIDI signal. Then, the
MIDI signal is transmitted from Arduino to laptop and the sound
comes out. This drum kit is very difficult to design as it uses a
variety of materials and the cost is too high [2].
3. The Arduino Air Drum This project was discovered by Maayan Mignal. This project used
a MIDI device and an Arduino board to build a full-on set of air
drums. This project need to constructed a 3 pieces drum kit with
four sounds using a MIDI interface, 3 accelerometer sensors, a
photo cell, some USB ports, two garden rakes and couple of
slippers (as the bass drum). This drum kit only uses drum stick and
slippers to produce sound. The accelerometer sensors are placed
on both drum sticks and under the slipper to detect the user's
movement. Its able people to play drum at anywhere and anytime.
The cost to create this project is very high as the price of the
accelerometer sensors are very expensive [1].
2.3 Microcontrollers
Microcontroller differs from a microprocessor in many ways. First and the most important
is its functionality. In order for a microprocessor to be used, other components such as
memory, or components for receiving and sending data must be added to it. In short that
means that microprocessor is the heart of the computer. On the other hand, microcontroller
is designed to be all of that in one. No other external components are needed for its
application because all necessary peripherals are already built onto it. Table 2.2 shows the
differences between microcontroller and microprocessor.
Microcontroller Microprocessor
Contain RAM, ROM on a single chip Do not have RAM, ROM on a single chip
Contain I/O port and do not need additional circuit Do not have I/O port on single chip
to interface to outside world
Have special function pin such as ADC, voltage Do not have additional function port that can be
comparator and other programmed as ADC, voltage comparator and
Others
Combines all of that in one Need additional circuit to connect memory and
interfacing chip through bus
2.3.2 Arduino
Arduino is one of the most important hardware used to make electronics projects. It
consists of both a microcontroller and a part of the software or Integrated Development
Environment (IDE) that runs on your PC, used to write and upload C++ coding program
8
to the physical board. By using the USB cable, it simply easy to program a new code onto
the Arduino board. Figure 2.3 shows the different types of Arduino.
There are five types of Arduino that available in market which are Arduino Uno, LilyPad
Arduino, Red Board, Arduino Mega and Arduino Leonardo but the most popular are
Arduino Uno and Arduino Mega [7]. Table 2.4 shows the features of both Arduino board.
Arduino always be the main choice for creating a project as it has many advantages. The
biggest advantage of Arduino is its ready to use structure. It comes with 5V regulator, an
oscillator, a microcontroller, LED and serial communication interface. It also easy to use
by just plug it into USB port of the computer. Besides, Arduino also has a capability of
automatic unit conversion. User do not need to worry about the unit conversion during
9
debugging. User also easy to find help about Arduino as most forums on the internet
talking about the Arduino and the website of Arduino also explain more detail about it.
To control a process using Arduino Uno, it is required to program the Arduino according
to the desired coding. One of the reasons for Arduino gaining so much popularity is that,
it is easy to use and simple to program. User just needs to plug and play to operate the
Arduino board. The USB cable is used to transfer the coding from the Arduino IDE to the
board. In addition, the language of the Arduino IDE is user friendly, which means user
can easily understand the language because it used simplified version of C++. Figure 2.5
shows the software that being use which is Arduino IDE.
METHODOLOGY
3.1 Introduction
This chapter provides the explanation of methodology used for developing electronic
drum pad. The purpose of the methodology is to provide the working principle,
development and methods for the whole project to works. This methodology leads to
achieving the project objective. There are a few major steps need to followed as shown in
Figure 3.1.
11
As shown in Figure 3.2, this project consists of four main phases, which are planning,
design, experiment work, result and analysis. The most crucial part to start the project is
to plan the project well and ensure the process is able to progress smoothly. The project
from planning, designing, experiment work and result analysis. The detail of the steps is
explained on the following sub-chapter.
12
3.3 Planning
Planning the whole process for the development of this project by gathering information
about the hardware and software used is needed. In this planning phase, the major element
that need to discuss is the study of the existing Arduino-based drum kit system to know
the concept of the system.
Study the previous work that was done is an important task to be done because of the
studies it can explain and understand the advantages and disadvantages using the
component that will be used. Therefore, before starting any new project it will be a benefit
to study project that is completed.
13
Below is the list of hardware required in order to complete the project and make the
electronic drum pad works fine. Some of them hardware is readily available so they are
not listed such as laptop. Table 3.3 and 3.4 shows the hardware required in order to
complete this project.
3.4 Design
The design of the system can be divided into several parts. It will divide into two main
parts which is development of hardware and software.
The implemented system consists of an Arduino Uno as a main processing unit for the
entire system and the piezoelectric sensors are connected to the Arduino Uno. The signal
14
from the sensors will be operated by the Arduino and then sent to Hairless MIDI Converter
for detecting the MIDI Signal. Then, user can control the sound effects of drum pad in the
Digital Audio Workstation. In the Figure 3.5 shows the block diagram of the main
elements for the electronic drum.
Piezoelectric
Arduino Uno USB Port
Sensors
Hairless
Digital Audio Workstation MIDI
Converter
For the metronome, the signal from the push button will be sent into the potentiometer to
specify the tempo in bit per minute (BPM). Beats per minute is the unit of measuring
tempo so that the user can play rhythm accurately [9]. Then, the signal will be operated
by the Arduino and ticking sound will be produced through the buzzer following the tempo
that has been set at the potentiometer. The tempo in bit per minute (BPM) will be displayed
at the serial monitor of Arduino IDE software. In the Figure 3.6 shows the block diagram
of the main elements for the metronome.
15
Arduino
Push Button Potentiometer Buzzer
Uno
The flowchart in Figure 3.7 shows the flow of the electronic drum from the start till the
end. Initially, all the sensors will detect the drum beat from the user and send to Hairless
MIDI Converter to receive MIDI signal. Then, the signal will send to the Digital Audio
Workstation, the place where the user can control the sound effects of the drum pad. In
Figure 3.8 shows the flowchart of metronome. The signal from the push button will be
sent into the potentiometer. User need to adjust the potentiometer for specifying the tempo
in bit per minute (BPM). Rotate to the left for decreasing the tempo and rotate to the right
for increasing the tempo. Then, the buzzer will produced ticking sound and the tempo will
be displayed at the serial monitor.
16
Start
If pad5 is
struck
End
The main components used in developing the hardware for this project are Arduino UNO
and piezoelectric sensor.
As we can see from the Table 3.10, the operating voltage of the Arduino Uno is 5V but
the input voltage recommended can be within 7V to 12V. The high voltage supply to the
Arduino Uno might causes it failed to function due to the chip burnt. The size and weight
of the Arduino Uno is considerably big than ESP8266. It is also need extra shield to
connect with the WiFi access. Arduino UNO allowing more complex project can be made
by a small size controller especially those robots which required turning large number
sensor input into a complex output action such as movement of the multi axes robotic arm.
19
Piezoelectric sensors are devices that generate electric charge when a force or pressure is
imposed on it. The sensors are used for process control, quality assurance, and for research
and development. Piezoelectric effect was discovered by Pierre Curie in 1880, but the
manufacturing process begin in the 1950 as the piezoelectric effect is started to be used in
industrial sensing applications [4].
Table 3.12: The comparison of characteristics of piezo sensor materials vs other types
In developing the project, there are some software used such as Hairless MIDI Converter
and XLN Addictive Drums.
Hairless MIDI Converter is the simplest way to attach serial devices (like Arduinos) to
send and receive MIDI signals. This software helps to detect MIDI signal from the
Arduino. Besides, it has no dependencies and can be run out of the box on nearly any
computer. It also improves FTDI latency on Linux & Windows. This software is
compatible with the Arduino MIDI Library [5]. Below show the steps of using this
software:
2. Select Preferences from the menu and check that the serial settings look correct
(defaults are 115200bps, no flow control.)
3. Choose the serial port that wanted to use from the “Serial port” box as shown in Figure
3.13.
21
4. Launch the music app that will be sending and/or receiving MIDI data.
5. Select the MIDI port from the MIDI dropdown (on Windows, set both sides to connect
to the same loop MIDI virtual MIDI port) as shown in Figure 3.14.
6. After that, the software will show lights flashing in the UI when MIDI and/or serial
messages come through.
22
XLN Addictive Drums is a software that able user to create their own drum sounds,
rhythms and tracks applying professional effects. This software is a virtual instrument
plugin, and this means user will have to load it on a host like Cubase, Pro Tools or Logic
to be able to use it. Addictive Drums has been designed to have full control over the
thousands of real drum sounds and create a drum track in just a few minutes. Besides,
users are able to load a whole drum-kit with some changes from the mixer and insert
effects with simply a click [6].
Addictive Drums kits can contain twelve instruments in total and each of the twelve slots
is providing a variety of sounds for every parts of drum and cymbal such as one kick and
one snare per kit, one hi-hat, one ride cymbal, a cowbell, four toms and three crash, splash
or China cymbal.
23
Schematic diagram is used to represent the elements that involved in the Electronic Drum
Pad system by using abstract and graphic symbols. In Figure 3.16 below shows the
schematic diagram of the electronic drum which is the connection between the Arduino
and all the components such as zener diodes, resistors and piezoelectric sensors.
In Figure 3.17 below shows the schematic diagram of the metronome which is the
connection between the Arduino and all the components such as potentiometer, resistors,
buzzer and push button.
4.1 Introduction
In this chapter, the result and analysis of the project are discussed in detail. All the
hardware equipment is being assembly and several kinds of data are analyses to ensure
that the performance of the system is in stable and desired condition. The result of this
project is observed and recorded in the table form and snapshot figure for easier data
analysis. Based on the result and data analysis of the system, it helps user to analyze the
performance of the system and check the function of the system.
In this part, we will see the final form of this system. In Figure 4.1 shows the prototype
of the system. This project uses a book file as the project box.
26
In Figure 4.2 shows the circuit in the prototype from the top view. There are two circuits
are involved which are electronic drum circuit and metronome circuit.
In Figure 4.3 and 4.4 show the prototype of the project from the front view and the side
view. All the components have been placed in the project box and four drum pads are
neatly arranged for the convenience of the user.
In figure 4.5 shows the kick pedal view. This kick pedal will be placed on the floor and
the user are necessary to use foot for pushing the kick pedal.
This test is conducted in order to ensure the sensitivity of sensor by using the Hairless
MIDI Converter software. This test to determine the accuracy and the sensitivity of sensor
to detect the hit from user on the drum pad. When the user hit the drum pad, the green
light will turn on in the Hairless MIDI Converter software as shown in figure 4.6 below.
29
Figure 4.6: The green light turn on in the Hairless MIDI Converter software when user
hits the drum pad
The piezoelectric sensor is velocity receiver. It can detect the velocity when the pad is
struck. The signal from the sensor will received by an analog input of the Arduino (pins
A0 ~A5) and it will generate voltage. The voltage and velocity are analyzed when user hit
the drum pad in table below with different level of hitting on the pad (gentle, moderate
and hard). Table 4.7, 4.8, 4.9, 4.10 and 4.11 show the result sensitivity of sensor on each
pads.
Sensitivity of sensor
No. Level of hitting Velocity Voltage
1 Gentle 35 0.12V
2 Moderate 93 0.45V
3 Hard 125 0.92V
30
Sensitivity of sensor
No. Level of hitting Velocity Voltage
1 Gentle 32 0.11V
2 Moderate 104 0.53V
3 Hard 125 0.95V
Sensitivity of sensor
No. Level of hitting Velocity Voltage
1 Gentle 30 0.09V
2 Moderate 101 0.50V
3 Hard 125 0.97V
Sensitivity of sensor
No. Level of hitting Velocity Voltage
1 Gentle 38 0.17V
2 Moderate 101 0.59V
3 Hard 125 1.02V
31
Sensitivity of sensor
No. Level of hitting Velocity Voltage
1 Gentle 0 0V
2 Moderate 121 0.91V
3 Hard 125 0.96V
In this project, rotating potentiometer is use to control the tempo of the metronome in bit
per minute (BPM). The lowest tempo is 20 BPM (rotate to the left) and the highest tempo
is 240 BPM (rotate to the right). Figure 4.12 and figure 4.13 show the highest and lowest
tempo that display on the serial monitor of Arduino software. Besides, the result of the
tempo from highest to lowest (rotate from right to left) have shown in Figure 4.14.
Figure 4.12: The highest tempo that display on the serial monitor
32
Figure 4.13: The lowest tempo that display on the serial monitor
This system able to record and playback the drum beats of the user by using the Addictive
Drum software. The red button is for recording the drum beats and the green button is for
playback as shown in figure 4.15. User also able to save the drum beats in a file for
reviewing purposes.
In this part will explain on cost of the project. It will the divide into 4 main parts which is
electronic drum cost, metronome cost, other cost and total cost.
Table 4.16 shows the cost of electronic drum. The total cost for electronic drum is
RM61.20.
Table 4.17 shows the cost of metronome. The total cost of metronome is RM 37.20.
Table 4.18 shows the other cost that involved in this project. The total of other cost is RM
36.50.
Table 4.19 shows the total cost for this project which is RM134.90.
4.7 Troubleshoot
Troubleshoot is form of solving errors that occur during conducting the project. There are
two types of error that happen during conducting the project which is:
1. Sensitivity of sensor to detects the hit from user on the drum pad
The error that always happen during the project is the drum pad sounded twice. To solve
this error is by checking the quality of soldering and connection of wires between
components in the circuit.
2. Connection between the hardware part and the Addictive Drum software
At the first time, no sound produced because the hardware and software do not
synchronized. To solve this problem is by using Hairless MIDI converter which changing
the signals into MIDI signals so that the software can read the received signals.
36
4.8 Discussion
To develop this project ‘Electronic Drum for Training Purpose’, it is divided by two
sections which is software and hardware development. For the software development, it
has a lots of researches were done, the synchronization between the hardware and the
Addictive Drum software is the most complicated part of this project. At the first time, no
sound produced because the hardware and software do not synchronized. To solve this
problem is by using Hairless MIDI converter which changing the signals into MIDI signals
so that the software can read the received signals
Before constructing and developing the project, a lot of literature reviews have
been done. The attempt and how to take the input from the sensor circuit is studied. After
researching all of the literature reviews, it is clear that this project have been achieving its
objectives. It has been proved that when the user hit the drum pads, it will produced drum
sounds. For the metronome, it produced ticking sounds that helps the user to maintain the
tempo while playing the drum.
For the hardware development, there are lots of problems too. Sometimes the piezo
sensors produce the drum sound twice. This problem happens when the connection of the
wire are not fully connected or loose. Before running the project, it needs to check all the
wires are tight and see if any of the wires are not connected. Finally, the important thing
that has been learned in this Final Year Project is the time management to complete the
project and thesis. The period given to the students is quite short to complete the project,
so students need to learn how to arrange their time properly.
CHAPTER 5
5.1 Conclusion
As the conclusion, this project entitled “Electronic Drum for Training Purpose” achieved
the objectives where to analyze and observe the concept and principle of electronic drum.
Based on the research, there are some projects that are similar to this project. Most of the
previous projects are using Arduino as the microcontroller. This project also achieved the
objectives where to develop a low-cost system that mimics the actual drum using drum
pads and to build an electronic drum that capable to record and playback for reviewing
purposes. Besides, this project also managed to develop a metronome that can help user
to maintain the tempo while playing the electronic drum. This project only uses cheap
materials to develop the electronic drum except the Arduino Uno as the price of
microcontroller is quite expensive.
38
5.2 Recommendations
For the future work, there are several improvements that can be made significant to this
project:
1. Increase the number of pads so that more sounds can be generated and complete
like a real drum.
2. Produce a more detailed form of hardware by using 3D printers to be as real as the
real drum.
3. Produce a metronome that has LCD screen so it is easy for the user to see the
tempo without the need to open the serial monitor.
4. Produce an electronic drum that not depend on the software to produce sounds by
using memory card to store the drum sounds.
39
REFERENCE
1. Maayan Migdal. (2012). “Arduino Air Drum” Bezalel Academy of Art and
Design.
2. Ryo Kosaka (2016). “Minimal MIDI Drum Kit with 3D Printer” Kyoto, Japan.
4. Piezoelectric Sensor.
Retrieved from: https://en.wikipedia.org/wiki/Piezoelectric_sensor [21 April
2018]
APPENDIX A
FINAL YEAR PROJECT 1 GANTT CHART
42
WEEKS
ACTIVITIES 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Confirmation
of supervisor
Research on
suitable topic
Finalization
on topic and
proposal
Discussion
with
supervisor
Research
study on
thesis
Methodology
and analysis
Final report
submission
Proposal
presentation
43
APPENDIX B
FINAL YEAR PROJECT 2 GANTT CHART
44
WEEKS
ACTIVITIES 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Analyze the
project
Get the
components
from the shop
Program the
Arduino
coding
Hardware
development
Test the
hardware
Implement
hardware and
software
Preparation
for technical
paper
Presentation
PSM 2
45
APPENDIX C
DATASHEET FOR ARDUINO
46
Overview
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has
14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset
button. It contains everything needed to support the microcontroller; simply connect it to
a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2)
programmed as a USB to-serial converter. Revision 2 of the Uno board has a resistor
pulling the 8U2 HWB line to ground, making it easier to put into DFU mode. Revision 3
of the board has the following new features:
pinout: added SDA and SCL pins that are near to the AREF pin and two other new
pins placed near to the RESET pin, the IOREF that allow the shields to adapt to
the voltage provided from the board. In future, shields will be compatible both with
the board that use the AVR, which operate with 5V and with the Arduino Due that
operate with 3.3V. The second one is a not connected pin that is reserved for future
purposes.
Stronger RESET circuit.
Atmega 16U2 replace the 8U2.
Summary
Microcontroller ATmega328, Operating Voltage 5V, Input Voltage (recommended) 7-
12V, Input Voltage (limits) 6-20V, Digital I/O Pins 14 (of which 6 provide PWM
output), Analog Input Pins 6, DC Current per I/O Pin 40 mA, DC Current for 3.3V Pin
50 mA, Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader,
SRAM 2 KB (ATmega328), EEPROM 1 KB (ATmega328), Clock Speed 16 MHz
Schematic & Reference Design
EAGLE files: arduino-uno-Rev3-reference-design.zip (NOTE: works with Eagle
6.0 and newer)
Schematic: arduino-uno-Rev3-schematic.pdf
Note: The Arduino reference design can use an Atmega8, 168, or 328, Current
models use an ATmega328, but an Atmega8 is shown in the schematic for
reference. The pin configuration is identical on all three processors.
Power
The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically. External (non-USB) power can come
either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by
plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery
can be inserted in the Gnd and Vin pin headers of the POWER connector. The board can
operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the
47
5V pin may supply less than five volts and the board may be unstable. If using more than
12V, the voltage regulator may overheat and damage the board. The recommended range
is 7 to 12 volts. The power pins are as follows:
VIN. The input voltage to the Arduino board when it's using an external power
source (as opposed to 5 volts from the USB connection or other regulated power
source). You can supply voltage through this pin, or, if supplying voltage via the
power jack, access it through this pin.
5V.This pin outputs a regulated 5V from the regulator on the board. The board can
be supplied with power either from the DC power jack (7 - 12V), the USB
connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the
5V or 3.3V pins bypasses the regulator, and can damage your board. We don't
advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.
GND. Ground pins.
Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).
Input and Output
Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide
or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by
default) of 20-50 kOhms. In addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of the ATmega8U2 USB-
to-TTL Serial chip.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt
on a low value, a rising or falling edge, or a change in value. See the
attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e.1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and the
analogReference() function. Additionally, some pins have specialized functionality:
48
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the
Wire library.
There are a couple of other pins on the board.
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board.
Communication
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2
on the board channels this serial communication over USB and appears as a virtual com
port to software on the computer. The '16U2 firmware uses the standard USB COM
drivers, and no external driver is needed. However, on Windows, a .inf file is required.
The Arduino software includes a serial monitor which allows simple textual data to be
sent to and from the Arduino board. The RX and TX LEDs on the board will flash when
data is being transmitted via the USB-to-serial chip and USB connection to the computer
(but not for serial communication on pins 0 and 1). A SoftwareSerial library allows for
serial communication on any of the Uno's digital pins. The ATmega328 also supports I2C
(TWI) and SPI communication. The Arduino software includes a Wire library to simplify
use of the I2C bus; see the documentation for details. For SPI communication use the SPI
library.
Programming
The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno from the Tools > Board menu (according to the microcontroller on your
board). For details, see the reference and tutorials. The ATmega328 on the Arduino Uno
comes preburned with a bootloader that allows you to upload new code to it without the
use of an external hardware programmer. It communicates using the original STK500
protocol (reference, C header files). You can also bypass the bootloader and program the
microcontroller through the ICSP (In-Circuit Serial Programming) header; see these
instructions for details. The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware
source code is available. The ATmega16U2/8U2 is loaded with a DFU bootloader, which
can be activated by:
On Rev1 boards: connecting the solder jumper on the back of the board (near the
map of Italy) and then resetting the 8U2.
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line
to ground, making it easier to put into DFU mode.
Automatic (Software) Reset
Rather than requiring a physical press of the reset button before an upload, the Arduino
Uno is designed in a way that allows it to be reset by software running on a connected
49
computer. One of the hardware flow control lines (DTR) of the ATmega8U2/16U2 is
connected to the reset line of the ATmega328 via a 100 nanofarad capacitor. When this
line is asserted (taken low), the reset line drops long enough to reset the chip. The Arduino
software uses this capability to allow you to upload code by simply pressing the upload
button in the Arduino environment. This means that the bootloader can have a shorter
timeout, as the lowering of DTR can be well-coordinated with the start of the upload. This
setup has other implications. When the Uno is connected to either a computer running
Mac OS X or Linux, it resets each time a connection is made to it from software (via
USB). For the following halfsecond or so, the bootloader is running on the Uno. While it
is programmed to ignore malformed data (i.e. anything besides an upload of new code), it
will intercept the first few bytes of data sent to the board after a connection is opened. If
a sketch running on the board receives one-time configuration or other data when it first
starts, make sure that the software with which it communicates waits a second after
opening the connection and before sending this data. The Uno contains a trace that can be
cut to disable the auto-reset. The pads on either side of the trace can be soldered together
to re-enable it. It's labeled "RESET-EN". You may also be able to disable the auto-reset
by connecting a 110 ohm resistor from 5V to the reset line; see this forum thread for
details.
USB Overcurrent Protection
The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from
shorts and overcurrent. Although most computers provide their own internal protection,
the fuse provides an extra layer of protection. If more than 500 mA is applied to the USB
port, the fuse will automatically break the connection until the short or overload is
removed.
Physical Characteristics
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with
the USB connector and power jack extending beyond the former dimension. Four screw
holes allow the board to be attached to a surface or case. Note that the distance between
digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the
other pins.
50
APPENDIX D
DATASHEET FOR PIEZOELECTRIC SENSOR
51
Pin Configuration
Impedance:≤500Ω;
Voltage:≤30Vp-p;
Operating temperature:-20°C~+60°C
Storage temperature:-30°C~+70°C
Low Soldering temperature
Strain sensitivity: 5V/µƐ
Material: Quartz (mostly used)
Piezoelectric Effect
The ability of a piezoelectric material to convert a mechanical stress into electrical
charge is called a Piezoelectric Effect. The word Piezoelectric derived from the Greek
word ‘piezein’ which means to push, press and squeeze. Piezoelectric effect is reversible
effect means when we applied mechanical stress to the piezoelectric material we get
some electrical charge at output. Same as when we feed electrical charge to the sensor it
gets stretch or compresses.
Piezoelectric Material
Applications
APPENDIX E
CODING FOR ELECTRONIC DRUM
54
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
int Drum1_val = 0;
int Drum2_val = 0;
int Drum3_val = 0;
int Drum4_val = 0;
int Drum5_val = 0;
int signalTest2 = 0;
int signalTest1 = 0;
int signalTest3 = 0;
int signalTest4 = 0;
int signalTest5 = 0;
void setup()
{
MIDI.begin(4);
erial.begin(115200);
}
void loop()
{
/*1st pad*/
if(analogRead(Pad1) >= volumeThreshold)
{
signalTest1 = 1;
}
if(signalTest1 == 1 && analogRead(Pad1) <= (volumeThreshold-100))
{
Drum1_val= analogRead(Pad1);
int velocity = Drum1_val/3 + 78;
if(velocity >= 120)
velocity = 125;
else if(velocity < 0)
velocity = 0;
/*2nd pad*/
if(analogRead(Pad2) >= volumeThreshold)
{
signalTest2 = 1;
56
}
Drum2_val = analogRead(Pad2);
if(signalTest2 == 1 && analogRead(Pad2) <= (volumeThreshold-95))
{
Drum2_val= analogRead(Pad2);
int velocity = Drum2_val/3 + 35;
/*3rd pad*/
if(analogRead(Pad3) >= volumeThreshold)
{
signalTest3 = 1;
}
Drum3_val = analogRead(Pad3);
if(signalTest3 == 1 && analogRead(Pad3) <= (volumeThreshold-95))
{
Drum3_val= analogRead(Pad3);
int velocity = Drum3_val/2 + 77;
57
/*4th pad*/
if(analogRead(Pad4) >= volumeThreshold)
{
signalTest4 = 1;
}
if(signalTest4 == 1 && analogRead(Pad4) <= (volumeThreshold-95))
{
Drum4_val= analogRead(Pad4);
int velocity = Drum4_val/3 + 75;
/*5th pad*/
if(analogRead(Pad5) >= volumeThreshold)
{
signalTest5 = 1;
Drum5_val = analogRead(Pad5);
}
if(signalTest5 == 1 && analogRead(Pad5) <= (volumeThreshold-95))
{
int velocity = Drum5_val;
if(velocity >= 12)
velocity = 125;
else if(velocity < 0)
velocity = 0;
APPENDIX F
CODING FOR METRONOME
60
#define BUZZER 10
#define MIN_BPM 20
#define MAX_BPM 240
#define POT A0
bool but_status = 0;
int bpm;
void setup() {
Serial.begin(9600);
pinMode(BUZZER, OUTPUT);
attachInterrupt(0, Button, FALLING);
}
void loop() {
if(but_status == 1)
{
bpm = map(analogRead(POT), 0, 1023, MIN_BPM, MAX_BPM);
Serial.print(bpm);
Serial.println(" BPM");
tone(BUZZER, 2000);
delay(6000 / bpm);
noTone(BUZZER);
delay(54000 / bpm);
}
}
void Button()
{
but_status = !but_status;
delay(30);
61
if(but_status == 0)
{
Serial.println("Stop");
noTone(BUZZER);
}
else
Serial.println("Started at:");
}