Capacitance while reading multiple pins

I'm using an Arduino Uno and when I take the 5V pin and I put it in the A5 pin, I still get a signal from the A0 pin. Also, there's a decay over time and it is not on/off (See picture).

I tried reading the A0 pin with the digitalRead() function and it takes a long time to get back to the 0 state. It seems the decay also happens.

How can I make the pins independant from each other and remove the decay from the pins when reading them.

Here's the code I used:

float v1, v2;


void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(A0, INPUT);
  pinMode(A5, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  v1 = analogRead(A0);
  v2 = analogRead(A5);
  Serial.println(v1);

Thanks!

What is connected to the pin? Reading a floating pin (one not connected to anything) will produce the behavior you see - or, depending on ambient electrical noise, and the length of wire attached to the pin, near-random numbers. Don't read a floating pin and expect to get meaningful results.

Reading a very high impedance voltage source can also take several reads to get the correct result, as there isn;t time for it to charge/discharge the sample-and-hold capacitor during the sample period...

In the latter case there are techniques to get better results. In the former, you're trying to do something meaningless (measuring the voltage on a pin without a defined voltage)