Project Report

17
A Drum Trigger Device for Detecting Drum Vibration and Playback Through Speaker Project Group 7 Michael Brauch, ECE Brian Foppe, EE Yifang Ni, EE Josh Witmer, EE Faculty Advisor: Professor Robert O’Connell – Ph.D. Prepared for: ECE 3110 – ECE Projects Lab, University of Missouri April 6, 2014 Abstract: The project is a drum trigger that senses vibration on each hit of the drum pad and plays a prerecorded sound out of a speaker, as well as lights up an LED. The control unit that takes in each hit of the drum pad through a vibration sensor, and outputs it through an LED, as well as a speaker. We used the amplifier circuit to isolate and improve the audio signal coming from the controller to the speaker. After building the trigger we were able to get the audio

Transcript of Project Report

Page 1: Project Report

A Drum Trigger Device for Detecting Drum Vibration and Playback Through Speaker

Project Group 7Michael Brauch, ECE

Brian Foppe, EEYifang Ni, EE

Josh Witmer, EE

Faculty Advisor: Professor Robert O’Connell – Ph.D.

Prepared for: ECE 3110 – ECE Projects Lab, University of Missouri

April 6, 2014

Abstract: The project is a drum trigger that senses vibration on each hit of the drum pad and plays a

prerecorded sound out of a speaker, as well as lights up an LED. The control unit that takes in each hit of

the drum pad through a vibration sensor, and outputs it through an LED, as well as a speaker. We used

the amplifier circuit to isolate and improve the audio signal coming from the controller to the speaker.

After building the trigger we were able to get the audio file to play through the speaker as well as light up

the LED’s. The speaker we used was extremely small and was not loud enough to hear the audio

differences. Also, the way we hooked up the vibration sensor was affected by other vibrations other than

the drum strike. The program on the microcontroller ran fast enough to process quick drum strikes, but

not fast enough for a drum roll. Overall the drum trigger was able to function properly with few issues.

Index Terms: Drum trigger, vibration sensor, MBED microcontroller, signal processing.

Page 2: Project Report

Introduction

The project is a drum trigger that uses a vibration sensor to detect each hit of a drum pad and produces an

prerecorded audio sound through a speaker. The problems this project addresses is the use of

microphones in live and studio uses. When using microphones, many difficulties arise such as volume

level, feedback, spacing issues, cost, and overall sound quality and dynamics. Current state of the art

drum triggers are very similar to what we are constructing, and solve the same issues as previously

mentioned.

Proposed Implementation

Below is the Functional Block Diagram used for the drum trigger:

Figure 1 – Functional Block Diagram

Page 3: Project Report

Process Elements

Drum Vibration Sensor U1: Reads vibrations from the drum pad and sends it to the Process

Control Unit U2.

Process Control Unit U2: Takes in the signal from Drum Vibration Sensor U1 and the USB

Reader U4. The Process Control Unit then sends it to be the Amplifier A1, and the Drum Strike

Annunciator U3.

Drum Strike Annunciator U3: Receives data from the Process Control Unit U2 and then lights up

an LED light.

SD Reader U4: Transmits a .wav file to the Process Control Unit U2.

Amplifier A1: Amplifies the playable audio from the Process Control Unit U2 and transmits the

amplified sound to the Speaker U5.

Speaker U5: Plays audio received from the Amplifier A1.

Signal Lines

W1 – Sensor Data: Analog line that connects sensor and Process Control Unit U2.

W2 - Audio Data: Analog line that connects Process Control Unit U2 and Amplifier A1.

W3 – Annunciator Signal: Analog line that connects Process Control Unit U2 and Drum Strike

Annunciator U3.

W4 – Audio File: Analog line that connects SD reader to U4 to the Process Control Unit U2.

W5 – Amplified Audio: Analog line that connects Amplifier A5 to the Speaker U6.

Page 4: Project Report

Table 1 – Ownership Table for Functional Block Diagram

Ref. Des. Process Element Assigned To

U1 Drum Vibration Sensor Josh WitmerU2 Process Control Unit Brian FoppeU3 Drum Strike Annunciator Brian FoppeU4 USB Reader Brian FoppeU5 Audio Processor Yifang NiU6 Amplifier Yifang NiU7 Speaker Josh Witmer

Table 2 – Technology Stack Diagram

Drum Trigger API

Process Control

Vibration Sensor Speaker Output LED FlashPlay .wav

FileRead USB

Vibration Sensor: Reads vibration data coming from the contact of drum stick and drum pad.

Speaker Output: Plays a sound for each signal from sensor.

LED Flash: Lights up LED for each signal from sensor.

Play .wav File: Plays the .wav through the speaker.

Read USB: Reads .wav file from the USB drive.

Process Control: Manages signal from each of the hardware elements.

Green: Device Driver Yellow: Process Control

Page 5: Project Report

Table 3 – Ownership Table for Technology Stack Diagram

Technology/Layer Software Element Assigned ToDevice Driver Vibration Sensor Michael BrauchDevice Driver Speaker Output Michael BrauchDevice Driver LED Flash Michael BrauchDevice Driver Play .wav File Michael BrauchDevice Driver Read USB Michael BrauchProcess Control Process Control Michael Brauch

Safety Issues

To prevent electrostatic discharge (ESD), do not touch the board without proper grounding equipment.

Page 6: Project Report

Specifications

Table 4- System Sepcifications

System SpecificationsUnit Number Description Property Min Max

1U1 Drum Vibration Sensor Current 400uATemperature -20 C 70 C

2U2 Process Control Unit Voltage 4.5V 9V

Current100m

A 200mA2U3 Drum Strike Annunciator Voltage 4.5V 9V

Current100m

A 200mA2U4 SD Reader Volatge 100V

Temperature -20 C 85 CCurrent 0.5A

2A5 Amplifier (LM 386) Voltage 4V 12VTemperature 0 C 70 C

2U6 Speaker Power Rating 0.5WImpedence 8 ohm 8 ohm

System Entire System Softest Volume 0.495V 0.515VSoft Volume 0.515V 0.530VHigh Volume 0.530V 0.550V

Highest Volume 0.550V 1VLowest Light 0.495V 0.515V

Low Light 0.515V 0.530VBright Light 0.530V 0.550V

Brightest Light 0.550V 1V

Table 5 -Interconnect Specifications

Interconnect SpecificationsInterconnect

Ref. Desig.Wire

#Connector Ref. Des. Pin #

Mates With Ref. Des. Signal Description Wire Gauge

Wire Color

Wire Specification

W1 1 P1 1 F1 Sensor Data 22 Brown solid, 300V, PVC

W2 1 P2 2 F2 Audio Data 22 Black solid, 300V, PVC

W3 1 N/A N/A Aunnuciator Signal 22 Red solid, 300V, PVC

W4 1 P3 4 F3 Audio File 22 White solid, 300V, PVC

W5 1 P4 5 F4 Amplified Audio 22 Yellow solid, 300V, PVC

Page 7: Project Report

Software SpecificationsTechnology

Stack Element

NameSoftware Category

Function Prototype

Function Description

Function Parameter(s) Description Returns Assigned To

Vibration Sensor

Device Driver

int read(AnalogIn)

Returns a number between 0 and 100 that represents the

voltage in percentages

AnalogIn - voltage

coming in

A integert value representing the current

input voltage =, normalized to a 16-bit

value

Michael Brauch

Speaker Output

Device Driver

void play(FILE *wavefile)

Plays .wav file through speaker

FILE *wavefile

- .wav file on SD card

N/A Michael Brauch

Read SDDevice Driver

FILE fopen(FILE *wavefile)

Reads the .wav file to be played

FILE *wavefile

- .wav file on SD card

FILE on the SD card Michael Brauch

LED LightDevice Driver

int read(AnalogIn)

Returns a number between 0 and 100 that represents the

voltage in percentages

AnalogIn - voltage

coming in

A integer value representing the current

input voltage =, normalized to a 16-bit

value

Michael Brauch

Process Control

Process Control

int main()

Main program that runs the device and calls all necessary functions. Main

program is standard in MBED library

N/A int value 0 upon success Michael Brauch

Table 6- Software Specifications

Test of MBED Microcontroller

Abstract

A function generator will send a saw tooth pulse to the microcontroller to represent a drum strike. The

amplitude of the pulse will correspond to the intensity of the drum strike. This will make sure the

microcontroller is differentiating between the different intensities of sound and correct LEDs lighting up.

The amplitude of the saw tooth wave will be measured with an oscilloscope.

Page 8: Project Report

Recommended Test Equipment

Table 7 - Recommended Test Equipment For MBED Microcontroller

Quantity Make Model Nomenclature1 MBED LPC1768 MBED Microcontroller1 National Instruments PXI -1033 Function Generator / Oscilloscope

Test Procedure

1. Turn on the DUT.

2. Hook up the function generator to the VIN pin on the DUT.

3. Set the function generator to a falling ramp wave form of 500 mHz.

4. Hook up oscilloscope before the VIN pin to measure the exact amplitude of wave going

into the DUT.

5. Slowly increase the amplitude of the wave, starting at 0 Volts and wait to observe when

the first LED turns on. Once the LED turns on record the amplitude in the table below.

6. Repeat step 5 for the remaining 3 LED lights.

Test Points and Measured Data

Table 8 - Measured Data for the MBED Microcontroller

Nominal Measured

LED Amplitude (VDC) Tolerance (VDC)Amplitud

ePass/Fail

LED1 0.495 0.01LED2 0.515 0.01LED3 0.53 0.01LED4 0.55 0.01

Page 9: Project Report

Test of Speaker Function

Abstract

There are four different signals being sent to the speaker that plays different intensities of sound.

This test is to only make sure that a sound is played to the speaker and that it will be in the range

of functionality for the speaker.

Recommended Test Equipment

Table 9 - Recommended Test Equipment For Speaker Function

Quantity Make Model Nomenclature1 MBED LPC1768 MBED Microcontroller1 National Instruments PXI -1033 Function Generator / Oscilloscope1 Spark Fun COM-09151 Speaker - 0.5W (8 ohm)1 Texas Instruments LM386 Operational Amplifier

Test Procedure

1. Turn on the DUT.

2. Hook up the function generator to the VIN pin on the DUT.

3. Set the function generator to a falling ramp wave form of 500 mHz.

4. Set the function generator to 0.505 VDC and make sure the speaker plays audio at each

pulse.

5. Repeat step 4 for the remaining 3 remaining amplitudes: 0.52 VDC, 0.54 VDC, and 0.56

VDC.

Page 10: Project Report

Test Points and Measured Data

Table 10 - Measured Data for Speaker Function

Amplitude (VDC) Pass/Fail0.5050.520.540.56

Amplifier Design

Figure 2 - Amplifier Design

Conclusion

According to our results, we found that the drum trigger worked well, though it did have

some difficulties detecting rapid hits to the drum pad. We found this to be due to the processing

speed of the microcontroller and may be improved if implementing a different programming

Page 11: Project Report

algorithm such as interrupts, or if the microcontroller had more processing power/more

processors.

During testing, as we hit the sensor we found it was to be very sensitive. Occasionally the

sensor would pick up excess vibrations from its surroundings (such as the wire moving, sensor

moving on the pad, noise from the desk which it was places on, voices in the room, etc.) which

would affect our results. We decreased the vibrations it would detect from the surroundings by

finding more specific ranges of voltage provided by the sensor using an oscilloscope. We could

also decrease excess vibrations by making the lead from the sensor longer, instead of right on the

board. This would allow us to isolate the sensor from its surroundings, preventing any unwanted

vibrations.

In regards to the speaker, since it was such a small device it could not handle the voltage

load from the audio signal that was sent from the microcontroller. The loudest the speaker could

play was barely louder than the drum strike itself, and was too quiet for a real world application.

We could improve upon this design by using a larger speaker that could handle a larger load, and

by amplifying it more through the operational amplifier.

As far as the SD card reader we purchased, it worked but was not labeled correctly with

the SD card that we were using. The clock and voltage input pins were swapped and thus took

quite some time to find the error. We used a volt meter to match up the correct pins to the SD

breakout board.

Overall, the drum trigger worked successfully with minor issues. If we had a larger

budget we could have optimized the speaker to play a louder and clearer sound. Also we could

have implemented a different, more precise vibration sensor to give us less noise.

Page 12: Project Report

Drum Vibrations

Sensor

Speaker

AmplifierSD Reader

Microcontroller

& Drum Strike

Drum Stick