Whether my Arduino UNO board analog pins shorted? I see same input on all

I am puzzled. I just connected 3.3 V input to the Analog pin A5 of the Arduino UNO. On the script, I am reading all the input pins. Surprizingly, all the pins are giving voltage as that of A5 pin. This made me think whether all of them shorted?

code:


    int a0_analogPin = A0; 
    float a0_val = 0; 
    int a1_analogPin = A1; 
    float a1_val = 0;
    int a2_analogPin = A2; 
    float a2_val = 0;
    int a3_analogPin = A3; 
    float a3_val = 0; 
    int a4_analogPin = A4; 
    float a4_val = 0; 
    int a5_analogPin = A5; 
    float a5_val = 0; 
    
    void setup() {
      Serial.begin(9600);           //  setup serial
      pinMode(a0_analogPin,INPUT);
      pinMode(a1_analogPin,INPUT);
      pinMode(a2_analogPin,INPUT);
      pinMode(a3_analogPin,INPUT);
      pinMode(a4_analogPin,INPUT);
      pinMode(a5_analogPin,INPUT);  
      Serial.println("A0_val,A1_val,A2_val,A3_val,A4_val,A5_val");
    }
    
    void loop() {
      a0_val = analogRead(a0_analogPin)*5.0/1023.0;  // read the input pin
      Serial.print(a0_val);          // debug value
      Serial.print(",");
      a1_val = analogRead(a1_analogPin)*5.0/1023.0;  // read the input pin
      Serial.print(a1_val);  
      Serial.print(",");
      a2_val = analogRead(a2_analogPin)*5.0/1023.0;  // read the input pin
      Serial.print(a2_val);  
      Serial.print(",");
      a3_val = analogRead(a3_analogPin)*5.0/1023.0;  // read the input pin
      Serial.print(a3_val);      
      Serial.print(",");
      a4_val = analogRead(a4_analogPin)*5.0/1023.0;  // read the input pin
      Serial.print(a4_val);    
      Serial.print(",");
      a5_val = analogRead(a5_analogPin)*5.0/1023.0;  // read the input pin
      Serial.println(a5_val);        
    }

Board:
enter image description here

Serial Monitor:
enter image description here

@Delta_G True, they are not connected to any thing now. I want them read 0 since nothing is connected to them.

@Delta_G After your comment, I just connected remaining 5 analog inputs to ground (through a resistor and led). Surprisingly I am seeing a better result that I wanted:
Only one analog is at 3.3 V, which is good. But the remaining pins continue to show around 1 V. Is this normal with arduino?

No but it's normal for what you did.
Try connecting the other inputs directly to ground

@Delta_G @jim-p You guys are amazing. Now the result is amazing. I just connected one analog input to a 5 V, another to a 3.3 V source, remaining four grounded. Here is the result:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.