Ardumotive Arduino Greek Playground
  • Home
    • About us
    • Contact
    • License
  • Arduino
    • Tutorials
    • Workshop
  • Raspberry Pi
  • DIY 3D Printer
  • News
    • Events >
      • Unboxing & Review
    • Blog
The 1st Arduino Playground in Greece - Open Source Hardware

Piezo Vibration Sensor

Available Languages
Picture
Picture

Introduction 

Picture
In this tutorial we will show you how to use the Piezo Vibration Sensor with the Arduino UNO board. This vibration sensor loaded by a mass to offer high sensitivity at low frequencies. Useful for detecting vibration and ‘tap’ inputs from a user. Can also be used for impact sensing or a flexible switch.

​
So let's see how it works!
​


What you will need - Hardware


​For this tutorial you will need:
  • Arduino uno
  • Piezo Vibration Sensor
  • 1MΩ Resistor
  • Breadboard (or breadboard shield)
  • Some breadboard cables

The Circuit

Picture
The connections are easy, see the image above with breadboard circuit schematic.
  • +  pin to Arduino A0 Pin
  • -   pin to Arduino GND
  • 1MΩ resistor between them

The code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
const int PIEZO_PIN = A0; // Piezo output

void setup() 
{
  Serial.begin(9600);
}

void loop() 
{
  // Read Piezo ADC value in, and convert it to a voltage
  int piezoADC = analogRead(PIEZO_PIN);
  float piezoV = piezoADC / 1023.0 * 5.0;
  Serial.println(piezoV); // Print the voltage.
  delay(250);
}
Download the code from here and open it with Arduino IDE.
piezo_vibration_sensor.zip
File Size: 0 kb
File Type: zip
Download File

Serial Monitor

Picture

Well done!

You have successfully completed one more Arduino "How to use the Piezo Vibration Sensor "

I hope you liked this, let me know in the comments.
Picture

Search Engine

Picture

Licence 

Picture

Help us to grow up!

Picture


Donate us
About us
License
Cookies policy

Visit the biggest Arduino Shop in Greece!

Picture
find us on dwrean.net
find us on Codebender
find us on Instructables
Developed and designed by Vasilakis Michalis Copyright © 2013 Ardumotive All Rights Reserved
All trademarks referenced herein are properties of their
Powered by Create your own unique website with customizable templates.
Design by DivTag Templates