element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Experimenting with Vibration Sensors
  • Challenges & Projects
  • Design Challenges
  • Experimenting with Vibration Sensors
  • More
  • Cancel
Experimenting with Vibration Sensors
Blog Experimenting with Vibration Sensors - Characterize RPM of Spinning Devices #4 (Detect Spinning Fan Obstructions)
  • Blog
  • Forum
  • Documents
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: zst123
  • Date Created: 26 Dec 2020 5:15 AM Date Created
  • Views 295 views
  • Likes 3 likes
  • Comments 3 comments
Related
Recommended

Experimenting with Vibration Sensors - Characterize RPM of Spinning Devices #4 (Detect Spinning Fan Obstructions)

zst123
zst123
26 Dec 2020

Experiment 2 (Detect Spinning Fan Obstructions)

 

This is a continuation of Experiment 1

Experimenting with Vibration Sensors - Characterize RPM of Spinning Devices #3 (Initial Setup & Tapping Experiment)

 

Please read my other blog posts too if you haven't

Experimenting with Vibration Sensors - zst123's Blog Posts

 

Objective

 

This experiment is of intermediate difficulty.

Previously I faced speed limitations when using the Arduino Graph Plotter and today I will create my own using Python PyQt.

After which, it is possible to do detailed analysis.

I will demonstrate an example use-case application to detect obstructions in spinning fans.

 

 

Setup (A faster PyQt Graph Plotter)

 

Using a faster graph will make it possible to do some detailed analysis.

 

I have written instructions on my GitHub page on how to set it up. You will need to install some dependencies like Python 3, PyQt, PySerial.

 

I have documented it all on my GitHub page. You can download my graph plotter program here

  • https://github.com/zst123/Element14_Vibration-Sensor-Experiments/tree/master/Experiment2

 

I have also updated the Mbed code for the microcontroller, the main changes are in red. The changes are necessary because I have removed the 100ms delay, and also increased the serial port baud rate so that the data can transfer to the PC faster.

 

#include "mbed.h"

 

static UnbufferedSerial serial_port(USBTX, USBRX, 57600);

 

AnalogIn sensor(A0);

DigitalOut green_led(LED1);

DigitalOut red_led(LED3);

 

int main() {

    char buffer[50];

    const uint16_t lower_threshold = 32768 - 7000;

    const uint16_t upper_threshold = 32768 + 7000;

   

    while(1) {

        uint16_t reading = sensor.read_u16();

       

        if (lower_threshold < reading && reading < upper_threshold) {

            green_led = true;

            red_led = false;

        } else {

            green_led = false;

            red_led = true;

        }

        int length = snprintf(buffer, 50, "%d\n", reading);

        serial_port.write((uint8_t *) buffer, length);

   }

}

 

 

Compile and drag & drop to program your board again.

 

Connect the board and run the Python 3 program in a Terminal.

 

The graph will appear instantly on the PC.

 

Test Results

 

Here’s a video of me testing the vibration sensor on a PyQT graph plot. It is extremely smooth!

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

 

Tapping on the sensor, it is now very easy to distinguish the profile of the tap waveform, between harder taps and softer taps.

 

From here we can realise how powerful the vibration sensor is if you can sample with a fast enough microcontroller.

 

Application – Detect Fan Obstructions

The idea for this application comes from the fact that an ideal fan will produce little vibrations when running smoothly. When there is an obstruction to the fan blades, more vibrations and sound will be produced.

I will use this handheld fan I found at home. I simply attached the sensor to the middle of the fan.

 

Here is a video of it in normal operation. There are 3 fan speeds and the amplitude of vibrations also increases slightly.

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

 

When there is an obstruction, we observe a large amplitude on the graph. The red LED turns on due to the threshold.

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

 

Continuous moments can be seen when a fan is spinning. And obstructions can cause a big spike in vibrations.

 

Conclusion

 

Today, I learnt that indeed this vibration sensor by Kemet is very sensitive even to small vibrations. There is a consistent pattern of vibration in normal operation that can be observed.

When there is an obstruction, the fan blades rub against the paper which amplifies the effects of the vibration. Hence, by detecting the amplitude, an obstruction detector application is possible.

 

The hardware setup is pretty much done and I will focus on collecting different data sets next time.

In the next post, I will experiment towards my goal of characterizing RPMs of spinning devices.

 

If you have any issues following through, please let me know and I will elaborate more next time. Leave your suggestions in the comments for what I should try out next!

Anonymous

Top Comments

  • neuromodulator
    neuromodulator over 1 year ago +1

    What sampling rate are you getting?

  • zst123
    zst123 over 1 year ago in reply to neuromodulator +1

    Good question. I decided to add some code to calculate for me the sampling rate.

    I added this line inside the receive callback. I'm actually seeing around 980 Hz quite consistently.

     

    print("Frequency…

Parents
  • neuromodulator
    neuromodulator over 1 year ago

    What sampling rate are you getting?

    • Cancel
    • Vote Up +1 Vote Down
    • Reply
    • More
    • Cancel
Comment
  • neuromodulator
    neuromodulator over 1 year ago

    What sampling rate are you getting?

    • Cancel
    • Vote Up +1 Vote Down
    • Reply
    • More
    • Cancel
Children
  • zst123
    zst123 over 1 year ago in reply to neuromodulator

    Good question. I decided to add some code to calculate for me the sampling rate.

    I added this line inside the receive callback. I'm actually seeing around 980 Hz quite consistently.

     

    print("Frequency", (len(axis_time)-1) / (axis_time[-1]-axis_time[0]))

     

    Which means in theory I can do a Fourier transform analysis of up to 490 Hz. I understand that this microcontroller can go a lot faster. Right now I'm using Mbed to program it which is quite a heavy library. Probably I can optimise it by coding bare metal and changing from UART serial to USB communication instead. But it's a lot of work and 490 Hz should be more than sufficient for my tests around my home for now. What do you think?

    • Cancel
    • Vote Up +1 Vote Down
    • Reply
    • More
    • Cancel
  • neuromodulator
    neuromodulator over 1 year ago in reply to zst123

    From the video I had the feeling that you were getting aliasing, but 980 Hz should be good as long as its regular.

    • Cancel
    • Vote Up 0 Vote Down
    • Reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube