687/5000
Hello,
I'm pretty untaught of vibration measurement. my goal is to measure the natural vibration of a pc fan.
I have a piezo film sensor and the fan. I stuck the sensor on the fan so that the weight can swing freely.
parallel to the piezo I have a 1Mohm resistance. from there the "-" of the piezo goes to GND and the "+" to A0.
the program looks like this:
#include <Bridge.h>
#include <Console.h>
const int piezo = A0;
const int fan = 12;
String cmd;
void setup()
{
Bridge.begin();
Console.begin();
pinMode(fan, OUTPUT);
while(!Console);
}
void loop()
{
if(Console.available()>0)
{
char c = Console.read();
if (c == '\n')
{
functionChoose(cmd);
cmd = "";
}
else
{
cmd += c;
}
}
functionVibration();
delay(1000);
}
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
void functionChoose(String cmd)
{
cmd = cmd.substring(0,cmd.length()-1);
if((cmd == "fon") or (cmd == "foff"))
{
if(cmd == "fon")
{
digitalWrite(fan, HIGH);
zustand[0] = true;
Console.println("Fan ON");
}
else
{
digitalWrite(fan, LOW);
zustand[0] = false;
Console.println("Fan OFF");
}
}
}
float functionVibration()
{
int piezoADC = analogRead(piezo);
float piezoV = (piezoADC / 1023.0) * 5.0;
Console.println((String)"ADC: " + piezoADC + "\tVoltage: " + piezoV + " V");
return piezoV;
}
Unfortunately, I only get a very small value sporadically (1-10). Can I somehow increase the accuracy of the piezos? or is this simply not suitable for this measurement?
I am grateful for every help and every advice.
