Crazy dancing numbers on analog input pins

Wierd. I have noticed this for some time and wanted to put it finally on the forum in the hopes someone can clarify what is happening and offer a solution. Im using the decimianove, XP, USB 1.0, FTDI drivers properly installed, and am running using Pduino .5 beta 8 into puredata. I power up the computer, plug in the arduino, open the puredata, open the Pduino arduino patches, see the arduino, open the com/serial port, and see the analog pins dancing wild numbers across the display. Im guessing these are voltages picked up from the analog ins. I hook something up to pin number 0 and all other pins change to the voltage readings of pin 0 with nothing hooked up to them.

I simply want them to show no numbers--ie-no erratic voltages-- when nothing is hooked up.

can someone enlighten me as to how to do this and as to why the arduino seems to be picking up ghosts from space and showing it as data?

would be much appreciated. -Steven

Just read through all of my posts on the forum and see I posted this question....or one quite similar many moons ago. Still looking for answers though. I`ve yet to fully understand this issue.

Well it happens because with nothing wired to an analog input pin, the pin is 'floating' and is not a valid input. So you are just measuring noise from capacitance coupling. There is really no point in measuring a analog input pin that has nothing wired to it, is there? If you are not going utilize a analog input pin with a real external signal, but insist on reading it anyway and wish a zero measurement value, then you can just either ground the input pin or wire an external pull down resistor to ground of say 10k ohms (value not critical).

Lefty

I'm no expert, but the easiest way would be to tie the pins to a specific voltage through pull-up/pull-down resistor. Since the pins are analog, my assumption would be that you're using a potentiometer or photo-resistor of some sort. Basically, I'm saying that you need to hook up whatever sensor you're using in a voltage divider configuration (http://en.wikipedia.org/wiki/Voltage_divider), using the Arduino to measure the voltage at the point between the two resistors.

Note that this configuration will only work for a variable resistor/photoresistor. You should use something else if your sensor produces a voltage (mics, piezos, passive IR stuff, etc).

10k resistor between the analog input pin and ground. i`ll give it a whirl. gratsi gratsi

and regarding the voltage divider, ya -- that should perhaps come along with an arduino package....a page or two about hooking up sensors effectively.

how would you hook up a sensor that emits a voltage rather than one that has a fluctuating resistance?

how would you hook up a sensor that emits a voltage rather than one that has a fluctuating resistance?

Simple as long as the signal can only span the range of 0 to +5vdc (no negitive voltages allowed and nothing over +5.5vdc allowed) then just wire the signal directly to the analog input pin and then wire a Arduino ground pin the the sensor's ground.

If the signal can go negitive or over +5.5vdc then other external components are required to make the signal Arduino safe.

Lefty

Thanks Lefty. I really appreciate it. -Steven

Well all of that but maybe part of the reason is that you're using a board I have never heard of :P

decimianove

I have heard a few variations but that is a new one on me ;D

Mowcius

L

ya, the keyboard im typing on is a bit sketchy. sometimes the d and the s dont really work too unless i pound on them like the wild hammer game found at the carnival.

yeah but that would still make decimilanove...

The board is called the duemilanove. The previous USB board was called the diecimila. :)

Mowcius

yeah but that would still make decimilanove...

The board is called the duemilanove. The previous USB board was called the diecimila.

Mowcius

I knew that learning this C/C++ programming was going to be hard for me but geez, did they have to use such strange spellings for some of their functions. ;D

Lefty

Ahh well that's italian for you :P

Mowcius

If the analog pins are erratic, check your ground connections.