It's my first post here, please be gentle. I did try to research it but am not getting anywhere. I have a vibration sensor hooked up to A0 and had a loop when it detected an input over 0.1V to send a message over serial. It was working great, but now it sends constant messages. I checked A0 with my DMM and it is showing 0.245V with nothing connected to it. I am using the ground on the arduino board as my ground reference. I pressed RESET and loaded a different sketch onto the Arduino (blink) and still am getting the same thing. My other Arduino shows 0V on these same pins. Any help would be greatly appreciated!
What kind of vibration sensor ? You can paste the url to it in the text.
If it is a piezo vibration sensor, do you have 1M resistor parallel with the sensor ?
When the Arduino pins are not connected, or connected to a high impedance sensor like a piezo sensor, the voltage on that pin can be anything. It can be 0V, but also 5V, and everything in between.
EDIT: I wrote about a resistor in series, but it must be parallel.
Normal piezo elements (the round piezo things in toys) are very sensitive for noise. They need 1M resistor in parallel.
Those film vibration sensors are know to be much more sensitive for electrical noise. The datasheet says : "The active sensor area is shielded for improved RFI/EMI rejection". That is a big relief. But you still need a parallel resistor of 1M to get a more or less reliable analog value with the Arduino.
The resistor must be parallel to the sensor, I have edited my previous post :~
Sure, that article makes sense. My problem is that it shows ~0.3V regardless if I have my sensor plugged into A0 or not. If I flick the sensor it jumps to 0.5V-1.0V but the signal I need to measure lives around 0.1V and 0.3V. I could do a DC offset to put my signal on top of the noise but I'd rather figure out what's causing the voltage float.
void loop()
{
val = analogRead(analogPin); Serial.println(val);
delay(500);
}
polymorph:
A piezo sensor is just a capacitor with a dielectric that generates voltage from vibration.
Put a 1M resistor in parallel with it.
I didn't have a 1M resistor but I did have about 0.4M worth of resistors I put in series with each other then in parallel with the vibration sensor. It didn't change the readings.
I think you're right... I need a bigger parallel resistor. When I attach my DMM the arduino drops to reading 0V on A0 with only the vibration sensor hooked up to and the other side to gnd. When I flick the sensor it shows on my DMM and on the serial reader on arduino.