Detect Vibrations Using a Piezoelectric Shock Tap Sensor Module

by RonFrtek in Circuits > Arduino

3840 Views, 6 Favorites, 0 Comments

Detect Vibrations Using a Piezoelectric Shock Tap Sensor Module

Visuino: Detect Vibrations using a Piezoelectric shock tap sensor module

In this tutorial we will learn how to detect shock vibrations using a simple Piezoelectric sensor Vibration module and Visuino.

Watch a demonstration video.

What You Will Need

FGRURU0K1UXJL1T.LARGE.jpg
1564948911.jpg
1.3-I2C-OLED.jpg
VisuinoAdvrtisementM5Stack5.jpg
F8KZFL7K1UXJL1S.LARGE.jpg
Half-Sized_Breadboard_-_Oblique_-_600__61198.1507056554.1280.1280.png
  1. Arduino UNO (or any other Arduino)
  2. Piezoelectric shock Vibration module
  3. OLED display
  4. Jumper wires
  5. Breadboard
  6. Visuino program: Download Visuino

The Circuit

2019-11-30_21-18-30.jpg

Connect Arduino positive pin [5v] to breadboard red line pin [positive]

Connect Arduino positive pin [GND] to breadboard blue line pin [negative]

Connect Piezo module pin [V] to breadboard positive pin [red line]

Connect Piezo module pin [G] to breadboard negative pin [blue line]

Connect Piezo module pin [DO] to arduino digital pin [7]

Connect OLED pin [VCC] to breadboard positive pin [red line]

Connect OLED pin [GND] to breadboard negative pin [blue line]

Connect OLED pin [SDA] to Arduino pin [SDA]

Connect OLED pin [SCL] to Arduino pin [SCL]

Start Visuino, and Select the Arduino UNO Board Type

FFR2XFGK1UXJLG8.LARGE.jpg
F8LR4HQK1UXJLG7.LARGE.jpg

To start programming the Arduino, you will need to have the Arduino IDE installed from here: https://www.arduino.cc/.

Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program Arduino UNO! The Visuino: https://www.visuino.eu also needs to be installed. Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino Add Components and Connect Them

2019-11-30_21-32-18.jpg
2019-11-30_21-38-43.jpg
2019-11-30_21-39-20.jpg
Add Components
  1. Add "text value" component
    Select "TextValue1" component and in the properties window set "Value" to "VIBRATION DETECTED"
  2. Add "Delay" component
    In properties window set "Interval (uS)" to 2000000
  3. Add "SSD1306/SH1106 OLED Display (I2C)" component

    Double click on "DisplayOLED1" component and in the elements window drag "Text Field" to the left and drag "Fill Screen" to the left
    Select on the left "Text Field1" and in the properties window set "Size" to 1, "x" to 0, "y" to 50

Connect components

  1. Connect Arduino digital pin out [7] to "Text Value1" component pin [clock]
  2. Connect Arduino digital pin out [7] to "Delay" component pin [start]
  3. Connect "Text Value1" component pin [Out] to "DisplayOLED1" > "Text Field1" pin [In]
  4. Connect "Delay1" pin [Out] to "DisplayOLED1" > "Fill Screen1" pin [Clock]
  5. Connect "DisplayOLED1" pin [Out] to Arduino I2C pin [In]

Generate, Compile, and Upload the Arduino Code

2020-10-30_13-20-50.jpg

In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE

In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)

Play

If you power the Arduino UNO module, and shake the piezo sensor you should see a message written on the OLED display.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here.You can download and open it in Visuino: https://www.visuino.eu