Input differences in analog pins (and digital too)

This may be happening to other Forum members.

I tested all Arduino pins as inputs, in order to see why I am having trouble processing signals of some sensors. Here is what I discover.

After testing all analog pins of Arduino Diecimila, I got the folowing results:

Analog Pins (using a 10K pot as input)
Pin 0: 0 to 1023 value range.
Pin 1: 0 to 1019 value, but with a completely different curve.
Pin 2: 0 to 1023 value, equal to pin 0.
Pin 3: 0 to 1023 value, similar to pins 0 and 2.
Pin 4: 0 to 8 value range only, different to all other pins. !!!!!!!!!!!!
Pin 5: 0 to 1023 value range, similar to pins 0, 2 and 3.

Conclussion1 : not all pins are equal. One should test this before wiring, as similar signals will be treated differently by different input pins!
Conclussion2: Accordingly, signals must be processed individually.
Conclussion3: Ohms value is not directly reflected on value displayed, neither is input voltage.

This is what I discover for digital pins:

Digital Pins (using a button as input)

Pins 0 and 1 used to communicate with computer.
Pin 3: work.
Pin 4: work
Pin 5: work
Pin 6-12 Used by LCD screen
Pin 13: work
Pin 14: used by LCD screen
Pin 15: work, but mix (interfere) with pin 13
Pin 16: GND

Are this results normal?
What is the experience of other Forum members?

Old Beaver

I just ran a test with a ATmega168 board and all 6 analog inputs vary as expected from 0 to 1023 as the voltage through a 10k pot varies from 0 to 5 volts.

Perhaps you have damaged some of the analog inputs on your chip. Do you have another one you can test with?

Analog Pins (using a 10K pot as input)
Pin 0: 0 to 1023 value range.
Pin 1: 0 to 1019 value, but with a completely different curve.
Pin 2: 0 to 1023 value, equal to pin 0.
Pin 3: 0 to 1023 value, similar to pins 0 and 2.
Pin 4: 0 to 8 value range only, different to all other pins. !!!!!!!!!!!!
Pin 5: 0 to 1023 value range, similar to pins 0, 2 and 3.

I would say there is a hardware problem with pin 4 or it has been set low as a digital pin by referring to it as pin 18.

All the others look fine to me. If you research the AVR data sheet you will find an accuracy specification that might surprise you, ± 2 LSB Absolute Accuracy. If you require high accuracy or higher resolution analog input capabilities then you should research external A/D chips, there are many fine lab quality devices available. The AVR A/D are very handy and useful, but are not designed to be high quality A/D.

Lefty

Thanks for the responses and advice from Mem and RetroLefty.

Well, unfortunately, soon after I posted, I made a mistake and plugged 13.6 volts of my car battery the wrong way. The chip turned very hot.

After I discovered and corrected the +B supply, I tested the board with the serial cable and port of my PC, but, the board is not working any more.

The error mesage says "serial port not found", and COM5 dissapear from my Arduino menu. Maybe it is the serial port, maybe it is the chip.

So, it is time to look for a new Arduino or, as RetroLefty said, for a new chip. Maybe to plug a AT386 instead of the AT186.

Lefty wrote "there are many fine lab quality devices available. The AVR A/D are very handy and useful, but are not designed to be high quality A/D".

Very interesting!!! Some questions come to me immediately:

Where can I found and evaluate those quality chips?
Do they have a Forum like Arduino, where one can ask for help?
(This is a very important consideration for me, because I am not an electronic professional).
What are the prices of those chips?
Do they sell them already in a input-output board as Arduino, or such?
Or a kind of shield which I can customize to my needs?

I am just in a moment where I have to replace my board and should evaluate all the possible options.

Thank you very much.

OldBeaver

Well here is just one example that would work well with an Arduino using I2C communication buss. There are tons of others and you would really have to define your requirements and specifications to help further.

Lefty