All pins (Analog IN and digital 2-13) show a voltage with nothing else connected

Hey all -

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.

Hello, thanks for the response!

I am using this piezo vibration sensor: Piezo Vibration Sensor - Small Horizontal - SEN-09198 - SparkFun Electronics

I didn't use any resistor. Just grounded one side and put the other side of the sensor into A0.

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 :~

Any pin with nothing attached can read anything.
Read this:-
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html
Applies equally to analogue inputs.

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.

Do you have the internal pullup turned on?

A piezo sensor is just a capacitor with a dielectric that generates voltage from vibration.

Put a 1M resistor in parallel with it.

KeithRB:
Do you have the internal pullup turned on?

I believe so... my code for testing the sensor is as follows -

int analogPin = 0;
int val = 0;

void setup()
{
pinMode(analogPin, INPUT);
Serial.begin(9600);
}

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.

Curious. Are you sure there was continuity? If you have a 100k resistor, put that across it.

Did you just twist the resistor wires together, solder them, or use clip leads?

What if you have the resistors from the Analog pin to ground, without the piezo sensor?

polymorph:
Curious. Are you sure there was continuity? If you have a 100k resistor, put that across it.

Did you just twist the resistor wires together, solder them, or use clip leads?

What if you have the resistors from the Analog pin to ground, without the piezo sensor?

I'm not sure what you mean by your first sentence, what should I put the 100k resistor across?

The resistors are all pushed into a bread board.

If I put A0 ---- (200k Ohm resistor) --- OV. A0 reads 0 volts.

Thanks for all your help and suggestions so far, I really appreciate it. XD

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.

OK, so it sounds like it is working now.