Sie sind auf Seite 1von 76

UNIVERSITI TUN HUSSEIN ONN MALAYSIA

STATUS CONFIRMATION FOR UNDERGRADUATE PROJECT REPORT

ELECTRONIC DRUM FOR TRAINING PURPOSE


ACADEMIC SESSION: 2018/2019

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 (√)

(Contains information of high security or of great


CONFIDENTIAL
importance to Malaysia as STIPULATED under the
OFFICIAL SECRET ACT 1972)
RESTRICTED (Contains restricted information as determined by the
Organization/institution where research was conducted)

FREE ACCESS

Approved by,

(WRITER’S SIGNATURE) (SUPERVISOR’S SIGNATURE)

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

FARID SYAZWAN BIN SHARIZAN

A project report submitted in fulfillment of the requirement for the award of the
Bachelor of Electronic Engineering Technology (Communication and Computer)
with Honours

Faculty of Engineering Technology

University Tun Hussien Onn Malaysia

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.

Student Signature : ………………………………………..

FARID SYAZWAN BIN SHARIZAN

Date : ……………………………………….

Supervisor : ………………………………………

PROF. MADYA Dr. JUMADI BIN

ABDUL SUKOR
III

To my beloved father and mother, Sharizan bin Hanin Hamjah and


Noraidah binti Jantan Amat Mispar, who raised me up and have supported me all the
way since the beginning of my studies.
IV

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 2 LITERATURE REVIEW 4


2.1 Introduction 4
VII
I
2.2 Previous Research 4
2.3 Microcontrollers 6
2.3.1 Microcontroller versus Microprocessor 7
2.3.2 Arduino 7
2.3.3 Advantages of using Arduino 8
2.4 Software Requirement 9

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

CHAPTER 4 RESULT AND DISCUSSION 25


4.1 Introduction 25
4.2 Prototype of the System 25
4.3 Sensitivity of the Piezoelectric Sensor 28
4.3.1 Result Sensitivity of Sensor 29
IX

4.4 Result of Tempo on Metronome 31


4.5 Record and Playback 33
4.6 Analysis on Cost of the Project 33
4.6.1 Electronic Drum Cost 33
4.6.2 Metronome Cost 34
4.6.3 Other Cost 34
4.6.4 Total Cost 35
4.7 Troubleshoot 35
4.8 Discussion 36

CHAPTER 5 CONCLUSION AND RECOMMENDATIONS 37


5.1 Conclusion 37
5.2 Recommendations 38

REFERENCES 39
APPENDICES 41
X

LIST OF TABLES

2.1 Description of the previous projects 5


2.2 Microcontroller versus Microprocessor 7
2.4 Features of Arduino Uno and Arduino Mega 8
3.3 List of hardware for electronic drum 13
3.4 List of hardware for metronome 13
3.10 The specification of the Arduino Uno microcontroller 18
3.12 The comparison of characteristics of piezo sensor 20
materials vs other types
4.7 Result sensitivity of sensor on pad 1 (opened hi-hat) 29
4.8 Result sensitivity of sensor on pad 2 (snare) 30
4.9 Result sensitivity of sensor on pad 3 (closed hi-hat) 30
4.10 Result sensitivity of sensor on pad 4 (crash) 30
4.11 Result sensitivity of sensor on pad 5 (kick pedal) 31
4.16 Cost of electronic drum 33
4.17 Cost of metronome 34
4.18 Other cost 34
4.19 Total cost 35
XI

LIST OF FIGURES

1.1 Overview of the project 2


2.3 Different types of Arduino 8
2.5 Arduino IDE 9
3.1 Project Development Steps 11
3.2 Content of methodology 12
3.5 Block diagram of the electronic drum 14
3.6 Block diagram of the metronome 15
3.7 Flowchart of the electronic drum 16
3.8 Flowchart of metronome 17
3.9 The Arduino Uno 18
3.11 The Piezoelectric Sensors 19
3.13 The serial port box 21
3.14 MIDI dropdown 21
3.15 XLN Addictive Drums 22
3.16 The schematic diagram of electronic drum 23
3.17 The schematic diagram of the metronome 24
4.1 Prototype of the system 26
4.2 Circuit in the prototype from top view 26
4.3 Front view 27
4.4 Side view 27
4.5 Kick pedal view 28
4.6 The green light turn on in the Hairless MIDI Converter 29
software when user hits the drum pad
XII

4.12 The highest tempo that display on the serial monitor 31


4.13 32
The lowest tempo that display on the serial monitor
4.14 32
Result of the tempo from highest to lowest
4.15 33
Record and playback button
XII
I

LIST OF SYMBOLS AND ABBREVIATIONS

DAW - Digital Audio Workstation


USB - Universal Serial Bus
MIDI - Musical Instrument Digital Interface
3D - Three-dimensional
mm - Millimetre
LCD - Liquid Crystal Display
PC - Personal Computer
RAM - Random Access Memory
ROM - Read Only Memory
I/O - Input Output
ADC - Analog Digital Converter
Hz - Hertz
KB - Kilobytes
LED - Light-emitting Diode
V - Velocity
Ω - ohm
BPM - Bit Per Minute
UTHM - University Tun Hussein Onn Malaysia
ICSP - In-circuit Serial Programming
A - Ampere
g - gram
FTDI - Future Technology Devices International
UI - User Interface
R - Resistor
XI
V

LIST OF APPENDIX

APPENDIX TITLE PAGES

A Final Year Project 1 Gantt Chart 41


B Final Year Project 2 Gantt Chart 43
C Datasheet for Arduino 45
D Datasheet for Piezoelectric Sensor 50
E Coding for Electronic Drum 53
F Coding for Metronome 59
CHAPTER 1

INTRODUCTION

1.1 Background of Study

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.

Figure 1.1: Overview of the project


3

1.2 Problem Statement

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.

1.3 Project Objective

The works undertaken in this project are aiming on the following objectives:

a) To analyze and observe the concept and principle of electronic drum.


b) To develop a low-cost system that mimics the actual drum using drum pads.
c) To build an electronic drum that capable to record and playback for reviewing
purposes.
d) To develop a metronome that can help user to maintain the tempo while playing
the electronic drum.

1.4 Project scope

The frameworks of this project are divided into 4 parts:

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.

2.2 Previous Works

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.

Table 2.1: Description of the previous projects.

No. Topic Description


1. Playable Arduino-based The drum set is a part of the standard rhythm section used in many
Drum Set with Coca-Cola music styles. The most usual type includes a bass drum, a floor
Cans tom, two tom-tom drums, also one or two ride cymbal, and a hi-
hat. This project use coca-cola cans to create the shape of drum kit
and every part of the drum are connected to the Multi-Control
using alligator clip cables. This drum kit is very small-sized,
portable and affordable. It is suitable for kid who are interested in
music. This drum kit also has real instrument sound effects and the
shape of the drum kit also seem like a real drum set [8].
6

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

A microcontroller is a self-contained system with peripherals, memory and a processor


that can be used as an embedded system. Most programmable microcontrollers that are
used today are embedded in other consumer products or machinery including phones,
peripherals, automobiles and household appliances for computer systems. Due to that,
another name for a microcontroller is "embedded controller." Some embedded systems
are more sophisticated, while others have minimal requirements for memory and
programming length and a low software complexity. Input and output devices include
solenoids, LCD displays, relays, switches and sensors for data like humidity, temperature
or light level, amongst others. Programmable microcontrollers are designed to be used
7

for embedded applications, unlike microprocessors that can be found in PCs.


Microcontrollers are used in automatically controlled devices including power tools, toys,
implantable medical devices, office machines, engine control systems, appliances, remote
controls and other types of embedded systems.

2.3.1 Microcontroller versus Microprocessor

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.

Table 2.2: Microcontroller versus 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.

Figure 2.3: 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 Board Processor Memory Digital I/O Analogue I/O


Arduino Uno 16Mhz 2KB SRAM, 14 6 input, 0 output
ATmega328 32KB flash
Arduino Mega 16MHz 8KB SRAM, 54 16 input, 0 output
ATmega2560 256KB flash

Table 2.4: Features of Arduino Uno and Arduino Mega

2.3.3 Advantages of using Arduino

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.

2.4 Software Requirement

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.

Figure 2.5: Arduino IDE


CHAPTER 3

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

Literature Design and


Planning Review Study Materials gathering

Testing and Result, Analysis


Build the system troubleshooting and Conclusion

Figure 3.1: Project Development Steps

3.2 Project Methodology

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

Figure 3.2: Content of methodology

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.

3.3.1 Literature Review

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

3.3.2 List of Hardware in Project

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.

Table 3.3: List of hardware for electronic drum

No. Item Quantity


1 Arduino UNO 1
2 1MΩ resistor 5
3 Zener diode 5,1V 5
4 Piezoelectric disk beeper 35 mm (sensor) 5

Table 3.4: List of hardware for metronome

No. Item Quantity


1 Arduino UNO 1
2 10kΩ rotate potentiometer 1
3 Buzzer 1
4 1kΩ resistor 1
5 Push button 4 pin 1

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.

3.4.1 Block Diagram

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

Figure 3.5: Block diagram of the electronic drum

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

Figure 3.6: Block diagram of the metronome

3.4.2 Flow Chart

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

User hit the drum pad

Piezoelectric sensor detect signal from


pad and sent to Hairless MIDI If pad1 is
Converter struck

Hairless MIDI Converter detect If pad2 is


MIDI signal and send to Digital struck
Audio Workstation (DAW)

User control the sound effects of drum If pad3 is


pad in DAW struck

Sound produced through the speaker


If pad4 is
struck

If pad5 is
struck

End

Figure 3.7: Flowchart of the electronic drum


17

Figure 3.8: Flowchart of metronome

3.4.3 Hardware Development

The main components used in developing the hardware for this project are Arduino UNO
and piezoelectric sensor.

3.4.3.1 Arduino UNO

Arduino or Genuino Uno is a microcontroller board based on the ATmega328P. It consists


of 14 digital inputs or outputs pins, 6 analogue input pins, a USB connection, a power
jack, an ICSP header and a reset button. It can easily connect to the computer through an
USB cable for programming purpose. It also can be powered by plugging a 2.1mm centre-
positive plug into the Arduino Uno board power jack.
18

Figure 3.9: The Arduino Uno

Table 3.10: The specification of the Arduino Uno microcontroller

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

3.4.3.2 Piezoelectric Sensors

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].

Figure 3.11: The Piezoelectric Sensors

A set of inherent benefits is incredibly associated with the increase of electricity


technology. The sensing components show virtually zero deflection although the
electricity sensors react to compression. This provides electricity sensors strength, an
especially high natural frequency and a wonderful one-dimensionality over a large
amplitude range. To boot, electricity technology is insensitive to magnetic attraction fields
and radiation, sanctioning measurements below harsh conditions. Some materials used
(especially Ga phosphate or tourmaline) area unit very stable at high temperatures,
sanctioning sensors to possess an operating vary of up to a 1000°C. Transparent gem
shows electrical phenomenon additionally to the electricity effect; this can be the power
to get associate electrical signal once the temperature of the crystal changes. This impact
is additionally common to piezoceramic materials [3].
20

Table 3.12: The comparison of characteristics of piezo sensor materials vs other types

Principle Strain Threshold Span to


Sensitivity [V/µε] [µε] threshold ratio
Piezoelectric 5.0 0.00001 100,000,000
Piezoresistive 0.0001 0.0001 2,500,000
Inductive 0.001 0.0005 2,000,000
Capacitive 0.005 0.0001 750,000
Resistive 0.000005 0.01 50,000

3.4.4 Software Development

In developing the project, there are some software used such as Hairless MIDI Converter
and XLN Addictive Drums.

3.4.4.1 Hairless MIDI Converter

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:

1. Launch the Hairless MIDI Converter.

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

Figure 3.13: The serial port box

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.

Figure 3.14: MIDI dropdown

6. After that, the software will show lights flashing in the UI when MIDI and/or serial
messages come through.
22

3.4.4.2 XLN Addictive Drums

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].

Figure 3.15: XLN Addictive Drums

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

3.4.5 The Schematic Diagram

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.

Figure 3.16: The schematic diagram of electronic drum


24

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.

Figure 3.17: The schematic diagram of the metronome


CHAPTER 4

RESULT AND DISCUSSION

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.

4.2 Prototype 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

Figure 4.1: Prototype of the system

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.

Figure 4.2: Circuit in the prototype from top view


27

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.

Figure 4.3: Front view

Figure 4.4: Side view


28

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.

Figure 4.5: Kick pedal view

4.3 Sensitivity of the Piezoelectric Sensor

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

4.3.1 Result Sensitivity of Sensor

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.

Table 4.7: Result sensitivity of sensor on pad 1 (opened hi-hat)

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

Table 4.8: Result sensitivity of sensor on pad 2 (snare)

Sensitivity of sensor
No. Level of hitting Velocity Voltage
1 Gentle 32 0.11V
2 Moderate 104 0.53V
3 Hard 125 0.95V

Table 4.9: Result sensitivity of sensor on pad 3 (closed hi-hat)

Sensitivity of sensor
No. Level of hitting Velocity Voltage
1 Gentle 30 0.09V
2 Moderate 101 0.50V
3 Hard 125 0.97V

Table 4.10: Result sensitivity of sensor on pad 4 (crash)

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

Table 4.11: Result sensitivity of sensor on pad 5 (kick pedal)

Sensitivity of sensor
No. Level of hitting Velocity Voltage
1 Gentle 0 0V
2 Moderate 121 0.91V
3 Hard 125 0.96V

4.4 Result of Tempo on Metronome

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

Figure 4.14: Result of the tempo from highest to lowest


33

4.5 Record and Playback

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.

Figure 4.15: Record and playback button

4.6 Analysis on Cost of the Project

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.

4.6.1 Electronic Drum Cost

Table 4.16 shows the cost of electronic drum. The total cost for electronic drum is
RM61.20.

Table 4.16: Cost of electronic drum

Item Quantity Price (RM)


Arduino UNO 1 32.00
1MΩ resistor 5 1.00
Zener diode 5.1V 5 3.20
Piezoelectric disk beeper 35 mm 5 25.00
Total 61.20
34

4.6.2 Metronome Cost

Table 4.17 shows the cost of metronome. The total cost of metronome is RM 37.20.

Table 4.17: Cost of metronome

Item Quantity Price (RM)


Arduino UNO 1 32.00
1kΩ resistor 1 0.20
Buzzer 1 2.50
Push button 4 pin 1 1.00
10kΩ rotate potentiometer 1 1.50
Total 37.20

4.6.3 Other Cost

Table 4.18 shows the other cost that involved in this project. The total of other cost is RM
36.50.

Table 4.18: Other cost

Item Quantity Price (RM)


Briefcase 1 4.50
Sponge 5 8.00
Connection wire 15 5.00
Aluminium plate 5 4.00
Strip board 2 5.00
Spray (for casing) 1 10.00
Total 36.50
35

4.6.4 Total Cost

Table 4.19 shows the total cost for this project which is RM134.90.

Table 4.19: Total cost

Description Price (RM)


Electronic drum cost 61.20
Metronome cost 37.20
Other cost 36.50
Total cost 134.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

CONCLUSION AND RECOMMENDATIONS

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.

3. John, V., Reghu, A. (2011). “Introduction to Sensors” Broken Sound Parkway,


NW:Taylor and Francis Group.

4. Piezoelectric Sensor.
Retrieved from: https://en.wikipedia.org/wiki/Piezoelectric_sensor [21 April
2018]

5. The Hairless MIDI to Serial Bridge.


Retrieved from: http://projectgus.github.io/hairless-midiserial/ [21 April 2018]

6. XLN Addictive Drums.


Retrieved from: https://www.soundonsound.com/reviews/xln-addictive-drums
[15 May 2018]

7. Types of Arduino Boards.


Retrieved from: https://www.elprocus.com/different-types-of-arduino-boards/
[18 May 2018]

8. Playable Arduino-based Drum Set with Coca-Cola Cans.


Retrieved from: https://www.sunfounder.com/blog/drumset/ [19 April 2018]
40

9. Beats Per Minute Definition


Retrieved from:
http://backtracks.fm/resources/podcast-dictionary/beats+per+minute
[10 November 2018]

10. How to Use a Metronome


Retrieved from: http://www.metronomeonline.com/how-to-use-a-metronome/

[12 November 2018]


41

APPENDIX A
FINAL YEAR PROJECT 1 GANTT CHART
42

Final Year Project 1 Gantt Chart

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

Final Year Project 2 Gantt Chart

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

Pin Name Description

Outer Circle This gives Negative output voltage

Inner Circle This gives positive output voltage

Features and Specifications

 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

Natural Piezoelectric Material Synthetic Piezoelectric Material

Quartz (most used) Lead zirconate titanate (PZT)

Rochelle Salt Zinc Oxide (ZnO)

Topaz Barium Titanate (BaTiO3)


52

TB-1 Piezoelectric ceramics Barium titanate

TBK-3 Calcium barium titanate

Sucrose Gallium orthophosohate (GaPO4)

Tendon Potassium niobate (KNbO3)

Silk Lead titanate (PbTiO3)

Enamel Lithium tantalite (LiTaO3)

Dentin Langasite (La3Ga5SiO14)

DNA Sodium tungstate (Na2WO3)

Applications

 Production and detection of sound


 Generation of high voltage
 Electronic Frequency generation
 Microbalances
 Ultra-fine focusing of optical assemblies
 Everyday applications like cigarette lighters
53

APPENDIX E
CODING FOR ELECTRONIC DRUM
54

#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();

const int Pad1 = A0;


const int Pad2 = A1;
const int Pad3 = A2;
const int Pad4 = A3;
const int Pad5 = A4;

const int volumeThreshold = 380;

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;

byte snareDrum = 38;


byte kick = 36;
byte hihatClosed = 53;
byte crash = 77;
byte hihatOpened = 56;
55

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;

MIDI.sendNoteOn(hihatOpened, velocity, 1);


MIDI.sendNoteOff(hihatOpened, 0, 1);
signalTest1 = 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;

if(velocity >= 120)


velocity = 125;
else if(velocity < 0)
velocity = 0;

MIDI.sendNoteOn(snareDrum, velocity, 1);


MIDI.sendNoteOff(snareDrum, 0, 1);
signalTest2 = 0;
}

/*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

if(velocity >= 120)


velocity = 125;
else if(velocity < 0)
velocity = 0;

MIDI.sendNoteOn(hihatClosed, velocity, 1);


MIDI.sendNoteOff(hihatClosed, 0, 1);
signalTest3 = 0;
}

/*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;

if(velocity > 120)


velocity = 125;
else if(velocity < 0)
velocity = 0;

MIDI.sendNoteOn(crash, velocity, 1);


MIDI.sendNoteOff(crash, 0, 1);
signalTest4 = 0;
}
58

/*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;

MIDI.sendNoteOn(kick, velocity, 1);


MIDI.sendNoteOff(kick, 0, 1);
signalTest5 = 0;
}
}
59

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:");
}

Das könnte Ihnen auch gefallen