Project 6: Verfication testing, of Piezoelectric Sensor.
2017-12-03
Objective:
To demonstrate basic functionality of piezoelectric sensor.
The project uses code from:
Link to Piezo Drum Kit Quickstart Guide.
The web article was article written by C. Taylor. Refer to his article for technical information. Intent here is to get the sensor tested so I can begin next step to create some custom drums. This project uses code compiled from the Arduino IDE. Use at your own risk.
Materials:
1. Linux Mint workstation with Keyboard and mouse.
2. Arduino Uno connected by USB cable to computer.
3. Piezoelectric sensor
4. 10 MΩ pull down resistor.
5. Solder Iron.
6. Solder, flux, and other cleaning materials
7. Misc. 22AWG Jumper Wires
Software:
1. Linux OS - used Raspbian2. Arduino IDE 1.8.5 - GUI provided by Arduino to upload instructions to microcontroller. Check to ensure serial plotter is available.
Code:
Code from sparkfun. Use at your own risk.#define DRUM1 2 // Our analog pin
byte val = 0; // Initializing the variable for the voltage value
void setup()
{
Serial.begin(9600); // Initializing the serial port at 9600 baud
}
void loop()
{
val = analogRead(DRUM1); // Read the voltage
Serial.println(val, DEC); // Print the voltage to the terminal
}
Hardware Set-Up, Compiling, and Testing:
1. Simply plug in circuit as per diagram.