Pulling Vibration Data From Thing Speak and Visualizing It Using Google Charts
by thinghz in Circuits > Wireless
35 Views, 0 Favorites, 0 Comments
Pulling Vibration Data From Thing Speak and Visualizing It Using Google Charts
"Visualizing Sensor data made easier"
Google charts is an interactive way to visualize and analyze the data it can be anything like data from drive, sheets, remote sensor data. Here in this instructable we will be making use of this amazing functionality to analyze the vibration data from remote sensor in to our website. In last couple of instructables we came to know that how vibration analysis can affect in improving the downtime and irregular vibration in machines. The regular vibration analysis actually improves the fault tolerance of machines.
In this instructable we will be using Google Charts to visualize the sensor data. It provides us many options like line charts, Area Charts, pi charts, Histogram, multi value charts etc. So, here we will be learning about the following:
- Wireless Vibration and Temperature Sensors.
- Hardware Setup.
- Gathering the data using Wireless gateway device.
- Publishing the sensor data to ThingSpeak.
- Importing the recent data from ThingSpeak..
- Visualizing the data in Google Charts .
- Loading the charts in the webpage
Hardware and Software Specifications
Software Specification
Hardware Specification
Guidelines to Check Vibration in the Machines
As mentioned in the last instructable " Mechanical Vibration Analysis of Induction Motors ". There are certain guidelines that are to be followed in order to segregate the fault and fault identifying vibration. For the brief rotational speed frequency is one of them. Rotation speed frequencies are characteristic of different faults.
- 0.01g or Less - Excellent condition - The machine is properly working.
- 0.35g or less - Good condition. The machine is working fine. No action required unless the machine is noisy. There can be a rotor eccentricity fault.
- 0.75g or more - Rough Condition- Need to check the motor there can be rotor eccentricity fault if the machine is making too much noise.
- 1g or more - Very Rough condition - There can be a severe fault in a motor. The fault might be due to bearing fault or bending of the bar. Check for the noise and temperature
- 1.5g or more- Danger Level- Need to repair or change the motor.
- 2.5g or More -Severe Level-Shut down the machinery immediately.
Getting the Vibration Sensor Values
The vibration values, that we are getting from the sensors are in milis. These consists of the following values.
- RMS value- root mean square values along all three axes.The peak to peak value can be calculated as
peak to peak value = RMS value/0.707
- Min value- Minimum value along all three axes
- Max values- peak to peak value along all three axes.The RMS value can be calculated using this formula
RMS value = peak to peak value x 0.707
In the graph mentioned in next step we can see that we had some irregular vibration. But these vibrations were under the safe criteria and were not of any concern. The vibrations were usder o.75g. If in case subjected to faulty motor with high rotor eccentricity can show some irregular vibrations.
Setting Up Thing Speak Account and Publishing Sensor Values to Thing Speak
For setting up ThingSpeak account you can follow this tutorial.
After finishing setting up Thingspeak account we will be publishing the sensor values to cloud,Here we are using ThingSpeak MQTT API for the same.
Publish and Subscribe using ThingSpeak MQTT
- Publishing to channel feed channels/channelID/publish/WriteAPIKey
- Publishing to a particular field channels/channelID/publish/fields/fieldNumber
- Subscribe to the channel field channels/channelID/subscribe/ format/APIKey
- Subscribe to the private channel feed channels/channelID/subscribe/fields/fieldNumber/format
- Subscribe to all fields of a channel. channels/channelID/subscribe/fields/fieldNumber/apikey
Visualizing the Sensor Data on ThingSpeak
Visualizing ThingSpeak Data in Google Charts
Google Charts provides very efficient way to visualize data on your website or static webpages. From simple line charts to complex hierarchical tree maps, the google chart gallery provides a large number of ready-to-use chart types.
To Visualize the charts you can go through this link.
follow these steps to create google chart and load it in your website or any webpage
- load the google jsapi and google charts API in to your html code.
- The call folowing method from google charts API to load the charts
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(draw);
- then add columns and rows to chart.
data = new google.visualization.DataTable();
//chart = new google.visualization.LineChart(document.getElementById('htchart')); chart = new google.visualization.AreaChart(document.getElementById('chart_div')); data.addColumn('string','Time'); data.addColumn('number','RMSX'); data.addColumn('number','RMSY');
- draw the chart
chart.draw(data, opt);
To visualize the graphs and to watch a live analysis you can visit this page.
Email Notification for Vibration Alert
We are using IFTTT applets to give real-time weather report Email notification to the user. For more on IFTTT setup you can go through this blog. So, We have implemented it through ThingSpeak. We are sending an Email Notification to the user whenever the change in Temperature occurs in a machine. It will trigger an email notification “What a beautiful day”. Every day at around 10:00 am (IST) we will be getting an email notification
Overall Code
The firmware of this setup can be found in this GitHub repository