Arduino - all 6 analog inputs failure ?!

Hi,

at my Arduino Uno (clone) all 6 analog inputs not working... the reading of them is 1023 regardless of the input voltage, even is connected to ground... behaves as if all analog inputs digital outputs high level

microcontroller may be defective or may be in bootloader?
has anyone seen this?

Can you load a simple sketch like Blink into it? Does the built-in LED blink properly when you do that?

Measure your sketch is not calling pinMode(INPUT) on the pins (and that the internal pull-ups are not being enabled.)

What is the voltage on the Vref pin?

Post your sketch.

I try again my "old" sketch from Nicu FLORICA (niq_ro): Arduino si o intrare analogica, afisare pe LCD (an article in roumanian english, but sketch are in english :astonished:

I think all 6 inputs are faulty... I remembered that about a month ago one experiences the power supply has failed and the Arduino was like multimeter, I just using only 2 inputs and I'm not checked if something hapenend .. Nicu FLORICA (niq_ro): Arduino ca multimetru (2)

I think that's it, must put a new ATMega 328P in Arduino board...

I change original 328P with another with bootloader and ... same problem... value read is 1023, even if put A0 input at GND or 3V3....

skech is "classical":

*/
  AnalogReadSerial
  Reads an analog input on pin 0, prints the result to the serial monitor.
  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
 
 This example code is in the public domain.
 */

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
  delay(10);        // delay in between reads for stability
}

Please read the posts and answer the questions.
Some very experienced users ask a simple question, to pinpoint the problem.

Someone asked if the 'Blink' example is working.
Someone asked if what the Vref voltage is.

If you answer these questions, we have a few more questions, and we should be able to find the problem.

sorry ...
my Arduino works with Blink sketch... works with all sketch who not use analog inputs...
Vref=5V

hmm... now works with above sketch, but does not work at the voltage input is read and write PWM, sketch is from EXAMPLE -> 03.Analog -> AnalogInOutSerial

If I remove the resistor serially connected with LED, Arduino correctly read the voltage on the input A0 (I tested with entry to the table, 3.3V and 5V)...

That could be power problem or bad soldering.

Do you power the Arduino with the USB bus ?
Could you try an adapter ?
Can you tell what kind of clone ?
Some clones look almost the same as the real Arduino, but have very cheap components, like the most cheap X-tal and capacitors. Perhaps one of the capacitors is not okay.
Some clones don't look like the real Arduino, but have good components.

in this weak-end I will measure all conections and try correct all soldering...
is a clone ... R2 version of Uno... called "design in Italy" noi "made in Italy"...
now is powered with USB bus, but I will test with external power supply...

niq_ro:
If I remove the resistor serially connected with LED, Arduino correctly read the voltage on the input A0 (I tested with entry to the table, 3.3V and 5V)...

What serially connected LED?

I have problems with this sketch(from EXAMPLE -> 03.Analog -> AnalogInOutSerial)

/*
  Analog input, analog output, serial output
 
 Reads an analog input pin, maps the result to a range from 0 to 255
 and uses the result to set the pulsewidth modulation (PWM) of an output pin.
 Also prints the results to the serial monitor.
 
 The circuit:
 * potentiometer connected to analog pin 0.
   Center pin of the potentiometer goes to the analog pin.
   side pins of the potentiometer go to +5V and ground
 * LED connected from digital pin 9 to ground
 
 created 29 Dec. 2008
 modified 9 Apr 2012
 by Tom Igoe
 
 This example code is in the public domain.
 
 */

// These constants won't change.  They're used to give names
// to the pins used:
const int analogInPin = A3;  // Analog input pin that the potentiometer is attached to
const int analogOutPin = 9; // Analog output pin that the LED is attached to

int sensorValue = 0;        // value read from the pot
int outputValue = 0;        // value output to the PWM (analog out)

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600); 
}

void loop() {
  // read the analog in value:
  sensorValue = analogRead(analogInPin);            
  // map it to the range of the analog out:
  outputValue = map(sensorValue, 0, 1023, 0, 255);  
  // change the analog out value:
  analogWrite(analogOutPin, outputValue);           

  // print the results to the serial monitor:
  Serial.print("sensor = " );                       
  Serial.print(sensorValue);      
  Serial.print("\t output = ");      
  Serial.println(outputValue);   

  // wait 2 milliseconds before the next loop
  // for the analog-to-digital converter to settle
  // after the last reading:
  delay(2);                     
}

I use this schematic for test (without "adapter module")

PS: My Arduino works well as ac dimmer with digital control, but may not use Analog for this (see my article at Nicu FLORICA (niq_ro): Variator de tensiune pentru un bec cu Arduino (II) )

Resistors value for RGB LED are:

I've thought that I could solve the problem in my clone R2 for use with the digital outputs and analog inputs by reducing the output current from 17mA approx. 0.1 .. 0.4 mA (depends on the gain of the transistor)

How to use this forum

Code tags.

niq_ro:
Hi,

at my Arduino Uno (clone) all 6 analog inputs not working... the reading of them is 1023 regardless of the input voltage, even is connected to ground... behaves as if all analog inputs digital outputs high level

This suggests the problem is with the ADC unit itself, or the analog multiplexer, rather than the pins
themselves.

One possible test might be this sketch: http://arduino.cc/forum/index.php/topic,8140.0.html - it uses the ADC
to read the on-chip internal temperature sensor and exercises the ADC without using any analog pin. If this is also
failing to return reasonable values it strongly implies the ADC is burnt-out.

only now I realized if I measure the voltage without the LED connected to output Vref = 5V, but if that couple LED Vref "falls" at zero volts

I need to study better clone scheme, which we found at http://arduino.cc/en/uploads/Main/arduino-uno-rev2-schematic.pdf

MarkT:
One possible test might be this sketch: http://arduino.cc/forum/index.php/topic,8140.0.html - it uses the ADC
to read the on-chip internal temperature sensor and exercises the ADC without using any analog pin. If this is also
failing to return reasonable values it strongly implies the ADC is burnt-out.

without LED value is ok, "23.35" but with LED value is "681.00"... :astonished:

I solved the problem thanks to your advice ... on my board with RGB LED was a short between pins VREF and GND ... :*