I am currently developing a prototype that reads levels of vibration of excavation equipment and was wondering the best was to implement the sensor.
I am currently using a little piezo vibration sensor and have a few questions.
What socket would it be plugged into (Digital or analog)?
How would I control the sensitivity of it (Ie the threshold of when it reads back that the threshold has been met)?
I want to check every 60 seconds if the sensor is meeting or exceeding this threshold?
What is the vibration frequency that you are trying to measure? Do you know?
One option would be to amplify the piezo, rectify the signal and filter it. That yo can then measure via an analog pin and it will give you a straight analog value of the current maximum amount of vibration.
If you just hook it up to an analog pin, after amplifying, then you will be able to measure the instantaneous vibration, but you will have to take many many samples and find the highest value, or the average value, depending on your needs.
If the frequency isn’t too high then you can also look at a digital G sensor. The last one that I worked with sampled at 180 samples per second and is thus OK for vibration frequencies up to around 70Hz.
You can also look at an analog G sensor, which will not need amplification. Both G sensors will give you a calibrated G reading. The piezo you will have to calibrate yourself somehow.
I am currently using a small off the shelf piezo wired into a block and then plugged into an analog socket.
All i need is to correctly read the level from the sensor and then compare it against a common threshold value.
Then it might be fine. I just don’t know what the output voltage will be. Might be too little to measure directly.
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
namespace FEZ_Domino_Application2
{
public class Program
{
public static void Main()
{
OutputPort led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, ledState);
GHIElectronics.NETMF.Hardware.AnalogIn AN = new GHIElectronics.NETMF.Hardware.AnalogIn(GHIElectronics.NETMF.Hardware.AnalogIn.Pin.Ain0);
AN.SetLinearScale(-512, 512);//Set 0V as -512, +3V3 as +512. The resistors bias the pin to 1/2 of 3V3.
Int16 Count = 0;
int MaxVib = 0;
int An_Reading=0;
while (true)
{
// Sleep for 60 seconds
Thread.Sleep(60000);
//Get max. Many readings are required because if only one reading is taken then it probably will not be when the
//sensor is bent to the maximum. If the reading is taken at the exact wrong time then it might be busy swing
//form max + to max - and just at that moment be in the middle, then the reading will show zero.
MaxVib = 0;
for (Count = 0; Count < 1000; Count++)
{
//Get Analog Reading
An_Reading = AN.Read();
//Move negative values into positive range.
An_Reading = System.Math.Abs(An_Reading);
if (MaxVib < An_Reading)
{//Value read is bigger than current Max, set Max
MaxVib = An_Reading;
}
}
if (MaxVib > 100)
{//Too much vibration
led.Write(true);
}
else
{//All OK
led.Write(false);
}
}
}
}
}
The first thing I would want to do is characterize the ‘vibration’.
Using accelerometers to find out what the frequency range of vibrations are likely to be seen on such equipment and to know exactly what you are looking for. Once you have an idea of the type of signal you are trying to capture then you can look at what other types of transducers might be useful in capturing the signal. With the accelerometer you can then calibrate your other sensor.
The vibration is what you would get from a piece of construction equipment, such as an excavator or a floor saw.
I want to pick up when it reaches a certain level and then react to that.
What would be nice is to be able to pick up when the level gets to a certain point and then start a timer and then stop it when it goes below it. The main thing is to record how long does it stay at that level for.
@ Floatingleaf: The vibration frequency can vary wildly.
For a caterpillar it might be the engine speed. Under 100Hz
For a jack hammer it would be the hammer speed. maybe 20Hz
For a table saw it would be the speed of the blade, times the number of teeth on the blade. At 18000rpm(300rps) and, say, 50 teeth, that would give you a frequency for 15000Hz. Hence the whine…
You really need a spectrum analyzer to look at the frequency domain to know what you are measuring…
Same question:
I want to know if there is something standing on my scale.
If I design it to see if there is a car on the scale, then it will not detect a cat.
If I design it to see if a cat is on the scale then a car will break it.
Thus I need to know if I’m trying to detect a cat or a car.
In your case, if there isn’t enough vibration to excite the piezo enough to measure the signal directly then you will never see that the machine is running. In that case you must either amplify the signal or use a different sensor. On the other hand, if there is too much vibration then the sensor might provide a signal too big for the Panda, and blow it, or it might break the sensor in half.
On the Arduino you would open up a serial comms using the baud rate.
Is this why I cannot get this sensor to work correctly?
Would i be able to use the analog port using serial comms, in order to set the baud rate.
Would this be possible?
This link shows the sensor and the sample code for arduino